Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions srcpkgs/66-void/files/hostname
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void-live
2 changes: 2 additions & 0 deletions srcpkgs/66-void/files/locale.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LANG=en_US.UTF-8
LC_COLLATE=C
4 changes: 4 additions & 0 deletions srcpkgs/66-void/files/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NAME="void"
ID="void"
DISTRIB_ID="void"
PRETTY_NAME="void"
73 changes: 73 additions & 0 deletions srcpkgs/66-void/patches/0001-Makefile-adapt-for-66-void.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From b2d94d4a2505ab2b6f07b96e9373331f64489a0c Mon Sep 17 00:00:00 2001
From: mobinmob <mobinmob@disroot.org>
Date: Sat, 8 Oct 2022 08:21:14 +0300
Subject: [PATCH] Makefile: adapt for 66-void.

---
Makefile | 34 +++++++++-------------------------
1 file changed, 9 insertions(+), 25 deletions(-)

diff --git a/Makefile b/Makefile
index 08117ab..3ec70e2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-PREFIX ?= /usr/local
-SCRIPTS= 1 2 3 ctrlaltdel
+DESTDIR ?=
+PREFIX ?= /usr/local

all:
$(CC) $(CFLAGS) halt.c -o halt $(LDFLAGS)
@@ -8,41 +8,25 @@ all:
$(CC) $(CFLAGS) seedrng.c -o seedrng $(LDFLAGS)

install:
- install -d ${DESTDIR}/${PREFIX}/sbin
- install -m755 halt ${DESTDIR}/${PREFIX}/sbin
- install -m755 pause ${DESTDIR}/${PREFIX}/sbin
- install -m755 vlogger ${DESTDIR}/${PREFIX}/sbin
- install -m755 shutdown ${DESTDIR}/${PREFIX}/sbin/shutdown
- install -m755 modules-load ${DESTDIR}/${PREFIX}/sbin/modules-load
- install -m755 seedrng ${DESTDIR}/${PREFIX}/sbin/seedrng
- install -m755 zzz ${DESTDIR}/${PREFIX}/sbin
- ln -sf zzz ${DESTDIR}/${PREFIX}/sbin/ZZZ
- ln -sf halt ${DESTDIR}/${PREFIX}/sbin/poweroff
- ln -sf halt ${DESTDIR}/${PREFIX}/sbin/reboot
+ install -d ${DESTDIR}/${PREFIX}/bin
+ install -m755 pause ${DESTDIR}/${PREFIX}/bin
+ install -m755 vlogger ${DESTDIR}/${PREFIX}/bin
+ install -m755 modules-load ${DESTDIR}/${PREFIX}/bin/modules-load
+ install -m755 seedrng ${DESTDIR}/${PREFIX}/bin/seedrng
+ install -m755 zzz ${DESTDIR}/${PREFIX}/bin
+ ln -sf zzz ${DESTDIR}/${PREFIX}/bin/ZZZ
install -d ${DESTDIR}/${PREFIX}/share/man/man1
install -m644 pause.1 ${DESTDIR}/${PREFIX}/share/man/man1
install -d ${DESTDIR}/${PREFIX}/share/man/man8
install -m644 zzz.8 ${DESTDIR}/${PREFIX}/share/man/man8
- install -m644 shutdown.8 ${DESTDIR}/${PREFIX}/share/man/man8
- install -m644 halt.8 ${DESTDIR}/${PREFIX}/share/man/man8
install -m644 modules-load.8 ${DESTDIR}/${PREFIX}/share/man/man8
install -m644 vlogger.8 ${DESTDIR}/${PREFIX}/share/man/man8
- ln -sf halt.8 ${DESTDIR}/${PREFIX}/share/man/man8/poweroff.8
- ln -sf halt.8 ${DESTDIR}/${PREFIX}/share/man/man8/reboot.8
install -d ${DESTDIR}/etc/sv
install -d ${DESTDIR}/etc/runit/runsvdir
- install -d ${DESTDIR}/etc/runit/core-services
- install -m644 core-services/*.sh ${DESTDIR}/etc/runit/core-services
- install -m755 ${SCRIPTS} ${DESTDIR}/etc/runit
- install -m644 functions $(DESTDIR)/etc/runit
- install -m644 crypt.awk ${DESTDIR}/etc/runit
install -m644 rc.conf ${DESTDIR}/etc
install -m755 rc.local ${DESTDIR}/etc
- install -m755 rc.shutdown ${DESTDIR}/etc
install -d ${DESTDIR}/${PREFIX}/lib/dracut/dracut.conf.d
install -m644 dracut/*.conf ${DESTDIR}/${PREFIX}/lib/dracut/dracut.conf.d
- ln -sf /run/runit/reboot ${DESTDIR}/etc/runit/
- ln -sf /run/runit/stopit ${DESTDIR}/etc/runit/
cp -R --no-dereference --preserve=mode,links -v runsvdir/* ${DESTDIR}/etc/runit/runsvdir/
cp -R --no-dereference --preserve=mode,links -v services/* ${DESTDIR}/etc/sv/

--
2.38.0

43 changes: 43 additions & 0 deletions srcpkgs/66-void/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Template file for '66-void'
# Based heavily on the runit-void package and reusing
# the void-runit repository.
pkgname=66-void
# This the not a released version but the date of the
# last commit at this time.
version=20230208
revision=1
# This the the last commit hash at this time.
_void_runit_version=e9d35904c8d5802b623c1c015eb155d1affdfcdf
wrksrc="void-runit-${_void_runit_version}"

Check failure on line 11 in srcpkgs/66-void/template

View workflow job for this annotation

GitHub Actions / Lint templates

Template Lint

wrksrc is deprecated and should not be used
build_style=gnu-makefile
short_desc="Void Linux base package, adapted for 66"
maintainer="mobinmob <mobinmob@disroot.org>"
license="CC0-1.0"
homepage="https://github.com/void-linux/void-runit"
# distfiles="https://github.com/void-linux/void-runit/archive/${_void_runit_version}.tar.gz"
distfiles="https://github.com/void-linux/void-runit/archive/${_void_runit_version}.tar.gz"
checksum=e3fd74416dce2f208fcd9dae45987c3221177974fc68ab75efcd54108f684951
replaces="runit-void>=0"

make_dirs="
/etc/runit/core-services 755 root root
/etc/zzz.d/suspend 0755 root root
/etc/zzz.d/resume 0755 root root"

depends="boot-66serv"
conf_files="
/etc/hostname
/etc/locale.conf
/etc/rc.conf
/etc/rc.local"

post_install() {
vconf ${FILESDIR}/hostname
vconf ${FILESDIR}/locale.conf
# Create symlinks for init and init utilities
ln -s /usr/bin/66 "${DESTDIR}"/usr/bin/init
for i in reboot poweroff halt shutdown;
do
ln -s /etc/66/${i} "${DESTDIR}"/usr/bin/${i}
done
}
29 changes: 29 additions & 0 deletions srcpkgs/base-system-66/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Template file for 'base-system-66'
pkgname=base-system-66
version=0.114
revision=1
build_style=meta
short_desc="Void Linux base system meta package"
maintainer="mobinmob <mobinmob@disroot.org>"
# A minor modification of the base-system template
# maintained by Enno Boland <gottox@voidlinux.org>
license="Public Domain"
homepage="https://codeberg.org/mobinmob/66-voidlinux"
replaces="base-system>=0"

depends="
base-files>=0.77 ncurses coreutils findutils diffutils libgcc
dash bash grep gzip file sed gawk less util-linux which tar man-pages
mdocml>=1.13.3 shadow e2fsprogs btrfs-progs xfsprogs f2fs-tools dosfstools
procps-ng tzdata pciutils usbutils iana-etc openssh dhcpcd
kbd iproute2 iputils iw wpa_supplicant xbps nvi sudo wifi-firmware
void-artwork traceroute ethtool kmod acpid eudev 66-void removed-packages"

case "$XBPS_TARGET_MACHINE" in
*-musl) depends+=" musl";;
*) depends+=" glibc-locales";;
esac

case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*|ppc*) depends+=" linux";;
esac
2 changes: 2 additions & 0 deletions srcpkgs/boot-66serv/INSTALL.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Please re-enable the boot@system service after an update,
by running '66-enable -t boot -F boot@system".
2 changes: 2 additions & 0 deletions srcpkgs/boot-66serv/files/66
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/execlineb -P
66-boot -b "Booting Void Linux" -m
64 changes: 64 additions & 0 deletions srcpkgs/boot-66serv/files/66boot-initial-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/sh
# Copyright 2021 mobinmob <mobinmob@disroot.org>
# Use of this source code is governed by the 2-Clause BSD License
# that can be found in the LICENSE file at the root project directory.
# SPDX short identifier: BSD-2-Clause

# This scripts create basic trees and enables services.
# Excluding the common posix userland commands, the script needs 66-yeller
# (from 66-tools), 66-env, 66-tree and 66-enable (from 66).

# Variables for 66-yeller
export PROG="66boot-initial-setup"
export COLOR_ENABLED="1"
export CLOCK_ENABLED="0"

# Script must run as root, otherwise it creates trees
# as the user.
user=$(id -u)
[ "$user" != "0" ] && 66-yeller -F %r You need to run this script as root! %n && exit 1

# Information for the user, in case of failure. 66 output is informative, this
# is just a pointer to the docs.
msg_trees() {
# ${1} is the name of the tree
66-yeller -W %b "An action for the [${1}] tree failed.
Check the output before this message for a possibe cause and consult
the 66-tree documentation." %n
}

msg_services() {
# ${1} is the name of a service
66-yeller -F %r "Enabling the [${1}] service failed.
Check the output before this message for a possibe cause and consult
the 66-enable documentation." %n
exit 1
}

# Create the mandatory boot tree.
66-tree -nz boot || msg_trees boot
# Enable the boot@system service in the boot tree.
66-enable -z -F -t boot boot@system || msg_services boot@system

# Copy the default boot@conf so that it will survive updates and be accesible
# though /etc/66rc.conf. Also, remove the warning in the first lines of the file.
new_conf="/etc/66/conf/boot@system/version/boot@system"
[ ! -f "$new_conf" ] && cp /etc/66/conf/boot@system/version/.boot@system "$new_conf" && \
warn=$( sed -n -e "/##\ \[STARTWARN\]/p" /etc/66rc.conf | tr -d '[:space:]') && \
[ "$warn" = "##[STARTWARN]" ] && sed -i '1,5d' "$new_conf"

# Create default tree, enable it and make it current.
66-tree -z -nEc default || msg_trees default
# Enable switch-initutils oneshot service in the default tree.
66-enable -z switch-initutils || msg_services switch-initutils

# Create and enable runit tree.
66-tree -z -nE runit || msg_trees runit
# Enable the runit service in the runit tree.
66-enable -z -t runit runit || msg_services runit
# Start runit tree after the default tree.
66-tree -z -S default runit || msg_trees runit

# Print on succesfull completion
# shellcheck disable=SC2181
if [ "$?" = 0 ]; then 66-yeller %g "Basic trees created and services enabled succesfully!"; fi
109 changes: 109 additions & 0 deletions srcpkgs/boot-66serv/files/66boot-rcdotconf
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/sh
# Copyright 2021 mobinmob <mobinmob@disroot.org>
# Use of this source code is governed by the 2-Clause BSD License
# that can be found in the LICENSE file at the root project directory.
# SPDX short identifier: BSD-2-Clause

# This script reads a **valid** rc.conf and writes the values to the
# corresponding configuration options in the boot@system environment file.
# Excluding the common posix userland commands, the script needs 66-yeller
# (from 66-tools) and 66-env (from 66).

# Variables for 66-yeller
export PROG="66boot-rcdotconf"
export COLOR_ENABLED="1"
export CLOCK_ENABLED="0"


# Script must run as root.
user=$(id -u)
[ "$user" != "0" ] && 66-yeller -F %r You need to run this script as root! %n && exit 1

HOSTNAME=
HOSTNAME1=
HARDWARECLOCK=
TIMEZONE=
KEYMAP=
FONT=
FONT_MAP=
FONT_UNIMAP=
TTYS=

apply_conf_from_to(){
# Set configuration value ${3} from ${1} to ${2}
# ${1} is the conf option from /etc/rc.conf
# ${2} is the conf option from the boot@ conf file
# ${3} is the value from the /etc/rc.conf option/var
if [ -n "${3}" ]
then
66-env -t boot -r "${2}"=!"${3}" boot@system
66-yeller %g "${2} set to [${3}]." %n
fi
}

set_hostname() {
# ${1} HOSTNAME value
[ -r /etc/hostname ] && HOSTNAME1="$( cat /etc/hostname )" && export HOSTNAME1

if [ -n "${1}" ]
then
66-env -t boot -r HOSTNAME=!"${1}" boot@system
66-yeller %g "HOSTNAME set to [${1}]." %n
elif [ -n "$HOSTNAME1" ]
then
66-env -t boot -r HOSTNAME=!"$HOSTNAME1" boot@system
66-yeller %g "HOSTNAME set to [$HOSTNAME1]." %n
elif [ -z "${1}" ] && [ -z "$HOSTNAME1" ]
then
66-env -t boot -r HOSTNAME=!void-live boot@system
66-yeller -W %b "No HOSTNAME set, reverting
to the default [void-live]." %n
fi
}

set_ttys() {
# Same positional args as apply_conf_from_to
if [ -n "${3}" ]
then
if [ "${3}" -lt 11 ] && [ "${3}" -gt 0 ]
then
apply_conf_from_to "${1}" "${2}" "${3}"
else
66-env -t boot -r TTY=!4 boot@system
66-yeller -W %b "${3} TTYS is not valid as a tty number,
reverting to the default [4]." %n
exit 1
fi
else
66-env -t boot -r TTY=!4 boot@system
66-yeller -W %b "TTY number not set, reverting
to the default [4]." %n
fi
}

check_tz() {
# On installation timezone can be set by symlink and not by the
# TIMEZONE key in rc.conf. In that case follow the symlink.
if [ "$(realpath /etc/localtime | cut -d / -f 1,2,3,4)" = "/usr/share/zoneinfo" ]; then
TIMEZONE="$(realpath /etc/localtime | cut -d / -f 5,6)"
export TIMEZONE
fi
}


# shellcheck disable=SC1091
. /etc/rc.conf

check_tz
set_hostname "$HOSTNAME"
apply_conf_from_to TIMEZONE TZ "$TIMEZONE"
apply_conf_from_to HARDWARECLOCK HARDWARECLOCK "$HARDWARECLOCK"
apply_conf_from_to KEYMAP KEYMAP "$KEYMAP"
apply_conf_from_to FONT_MAP FONT_MAP "$FONT_MAP"
apply_conf_from_to FONT FONT "$FONT"
apply_conf_from_to FONT_UNIMAP FONT_UNIMAP "$FONT_UNIMAP"
set_ttys TTYS TTY "$TTYS"

66-yeller %g "Please re-enable the boot@system service
for the changes to take effect by running (as root):
'66-enable -F -t boot boot@system' " %n
Loading
Loading