From 2977bbbfa03059a1bcc4429339c6b32d5f58e69b Mon Sep 17 00:00:00 2001 From: mobinmob Date: Sun, 16 Oct 2022 16:16:17 +0300 Subject: [PATCH 1/5] New package: boot-66serv-2.4.1 based on: https://github.com/void-linux/void-packages/pull/23122 https://github.com/void-linux/void-packages/pull/21142 --- srcpkgs/boot-66serv/INSTALL.msg | 2 + srcpkgs/boot-66serv/files/66 | 2 + .../boot-66serv/files/66boot-initial-setup | 64 ++++ srcpkgs/boot-66serv/files/66boot-rcdotconf | 109 +++++++ .../boot-66serv/files/66boot-storage-autoconf | 153 +++++++++ srcpkgs/boot-66serv/files/runit | 35 +++ srcpkgs/boot-66serv/files/runit-wrapsv@ | 9 + srcpkgs/boot-66serv/files/switch-initutils | 13 + srcpkgs/boot-66serv/files/switch-initutils-66 | 31 ++ srcpkgs/boot-66serv/files/sysctl.sh | 26 ++ ...evices-devices-first-pass-at-improvi.patch | 157 ++++++++++ ...ure-add-checks-to-make-the-process-m.patch | 295 ++++++++++++++++++ ...evices-devices-add-c-dev-null-to-the.patch | 68 ++++ ...igure-configure-add-back-tmpfile-con.patch | 34 ++ ...onfigure-configure-fix-zfs-detection.patch | 39 +++ ...dmraid-first-pass-at-making-the-serv.patch | 41 +++ ...mdraid-first-pass-at-adding-mdraid-s.patch | 83 +++++ ...ate-configuration-to-reflect-changes.patch | 71 +++++ ...ure-add-support-for-mdraid-add-some-.patch | 95 ++++++ ...-MDRAID-and-CHECK_CONFIGURATION-as-c.patch | 39 +++ .../patches/0011-configure-more-fixes.patch | 79 +++++ .../patches/0012-configure-more-changes.patch | 60 ++++ ...-ZFS_IMPORT-check-only-with-CHECK_CO.patch | 25 ++ ...-service-boot-try-to-have-consistent.patch | 58 ++++ ...re-add-code-for-MDRAID-and-CHECK_CON.patch | 117 +++++++ ...unt-swap-partially-revert-previous-c.patch | 28 ++ ...ure-properly-disable-devices-mdraid-.patch | 62 ++++ ...ure-add-a-message-and-a-small-sleep-.patch | 50 +++ ...-information-abouts-keys-that-do-not.patch | 102 ++++++ ...odules-system-use-the-void-runit-mod.patch | 31 ++ ...sctl-use-code-from-runit-void-for-sy.patch | 29 ++ ...nt-efivarfs-rw-to-follow-voidlinux-p.patch | 26 ++ .../0023-Remove-tmpfiles-support.patch | 210 +++++++++++++ srcpkgs/boot-66serv/template | 61 ++++ 34 files changed, 2304 insertions(+) create mode 100755 srcpkgs/boot-66serv/INSTALL.msg create mode 100644 srcpkgs/boot-66serv/files/66 create mode 100755 srcpkgs/boot-66serv/files/66boot-initial-setup create mode 100755 srcpkgs/boot-66serv/files/66boot-rcdotconf create mode 100755 srcpkgs/boot-66serv/files/66boot-storage-autoconf create mode 100644 srcpkgs/boot-66serv/files/runit create mode 100644 srcpkgs/boot-66serv/files/runit-wrapsv@ create mode 100755 srcpkgs/boot-66serv/files/switch-initutils create mode 100644 srcpkgs/boot-66serv/files/switch-initutils-66 create mode 100755 srcpkgs/boot-66serv/files/sysctl.sh create mode 100644 srcpkgs/boot-66serv/patches/0001-service-system-devices-devices-first-pass-at-improvi.patch create mode 100644 srcpkgs/boot-66serv/patches/0002-configure-configure-add-checks-to-make-the-process-m.patch create mode 100644 srcpkgs/boot-66serv/patches/0003-service-system-devices-devices-add-c-dev-null-to-the.patch create mode 100644 srcpkgs/boot-66serv/patches/0004-module-boot-configure-configure-add-back-tmpfile-con.patch create mode 100644 srcpkgs/boot-66serv/patches/0005-configure-configure-fix-zfs-detection.patch create mode 100644 srcpkgs/boot-66serv/patches/0006-devices-devices-dmraid-first-pass-at-making-the-serv.patch create mode 100644 srcpkgs/boot-66serv/patches/0007-devices-devices-mdraid-first-pass-at-adding-mdraid-s.patch create mode 100644 srcpkgs/boot-66serv/patches/0008-doc-boot-.md-update-configuration-to-reflect-changes.patch create mode 100644 srcpkgs/boot-66serv/patches/0009-configure-configure-add-support-for-mdraid-add-some-.patch create mode 100644 srcpkgs/boot-66serv/patches/0010-service-boot-add-MDRAID-and-CHECK_CONFIGURATION-as-c.patch create mode 100644 srcpkgs/boot-66serv/patches/0011-configure-more-fixes.patch create mode 100644 srcpkgs/boot-66serv/patches/0012-configure-more-changes.patch create mode 100644 srcpkgs/boot-66serv/patches/0013-configure-do-the-ZFS_IMPORT-check-only-with-CHECK_CO.patch create mode 100644 srcpkgs/boot-66serv/patches/0014-doc-boot-.md-and-service-boot-try-to-have-consistent.patch create mode 100644 srcpkgs/boot-66serv/patches/0015-Makefile-configure-add-code-for-MDRAID-and-CHECK_CON.patch create mode 100644 srcpkgs/boot-66serv/patches/0016-service-mount-mount-swap-partially-revert-previous-c.patch create mode 100644 srcpkgs/boot-66serv/patches/0017-configure-configure-properly-disable-devices-mdraid-.patch create mode 100644 srcpkgs/boot-66serv/patches/0018-configure-configure-add-a-message-and-a-small-sleep-.patch create mode 100644 srcpkgs/boot-66serv/patches/0019-doc-boot-.md-Add-information-abouts-keys-that-do-not.patch create mode 100644 srcpkgs/boot-66serv/patches/0020-system-modules-modules-system-use-the-void-runit-mod.patch create mode 100644 srcpkgs/boot-66serv/patches/0021-system-system-sysctl-use-code-from-runit-void-for-sy.patch create mode 100644 srcpkgs/boot-66serv/patches/0022-populate-sys-mount-efivarfs-rw-to-follow-voidlinux-p.patch create mode 100644 srcpkgs/boot-66serv/patches/0023-Remove-tmpfiles-support.patch create mode 100755 srcpkgs/boot-66serv/template diff --git a/srcpkgs/boot-66serv/INSTALL.msg b/srcpkgs/boot-66serv/INSTALL.msg new file mode 100755 index 000000000000..72e28e5a9974 --- /dev/null +++ b/srcpkgs/boot-66serv/INSTALL.msg @@ -0,0 +1,2 @@ +Please re-enable the boot@system service after an update, +by running '66-enable -t boot -F boot@system". diff --git a/srcpkgs/boot-66serv/files/66 b/srcpkgs/boot-66serv/files/66 new file mode 100644 index 000000000000..2e5bb6a10a5f --- /dev/null +++ b/srcpkgs/boot-66serv/files/66 @@ -0,0 +1,2 @@ +#!/usr/bin/execlineb -P +66-boot -b "Booting Void Linux" -m diff --git a/srcpkgs/boot-66serv/files/66boot-initial-setup b/srcpkgs/boot-66serv/files/66boot-initial-setup new file mode 100755 index 000000000000..ae90f3c90963 --- /dev/null +++ b/srcpkgs/boot-66serv/files/66boot-initial-setup @@ -0,0 +1,64 @@ +#!/bin/sh +# Copyright 2021 mobinmob +# 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" ] && printf "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 diff --git a/srcpkgs/boot-66serv/files/66boot-rcdotconf b/srcpkgs/boot-66serv/files/66boot-rcdotconf new file mode 100755 index 000000000000..f62c11c4d243 --- /dev/null +++ b/srcpkgs/boot-66serv/files/66boot-rcdotconf @@ -0,0 +1,109 @@ +#!/bin/sh +# Copyright 2021 mobinmob +# 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" ] && printf "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 \ No newline at end of file diff --git a/srcpkgs/boot-66serv/files/66boot-storage-autoconf b/srcpkgs/boot-66serv/files/66boot-storage-autoconf new file mode 100755 index 000000000000..4d3bbca5ad2b --- /dev/null +++ b/srcpkgs/boot-66serv/files/66boot-storage-autoconf @@ -0,0 +1,153 @@ +#!/bin/sh + +# Copyright 2021 mobinmob +# 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 determines if the system has dmraid, luks, zfs, btrfs, +# volumes, a swap partition or swapfile and configures the environment +# file of the boot@system service accordingly. +# Excluding the common posix userland commands, the script needs 66-which and 66-yeller +# (from 66-tools), 66-env (from 66) and blkid (from util-linux). + +# Variables for 66-yeller +export PROG="66boot-storage-autoconf" +export COLOR_ENABLED="1" +export CLOCK_ENABLED="0" + +# Script must run as root. +user=$(id -u) +[ "$user" != "0" ] && printf "You need to run this script as root!\n" && exit 1 + + + +detect_fs() { + # Uses blkid to detect partition TYPEs. The result is the number + # of detected partitions. + export "${1}"_detected="$(blkid -c /dev/null --match-token=TYPE="${1}" | wc -l )" +} + +detect_swapfile() { + # Finds swap references in /etc/fstab. + swapfile_detected="$(awk '!/^(#)/' /etc/fstab | awk '$3=="swap" ' | wc -l )" + export swapfile_detected +} + +detect_util() { + # Uses 66-which to determine if a utility exists. + # Output is $fs_util_exitst=0 (or 1) + # ${1} is the variable for the utility, in the form of "$fs_util" + # ${2} is the name of the executable + export "${1}"_exists="$(66-which "${2}" | wc -l)" +} + +check_and_apply_conf() { + # Checks for partition types and the existance of the relevant utilities. + # Outputs user information + # ${1} is in the form of $fs_detected + # ${2} is in the form of $fs_name_exists + # ${3} is the name of the configuration variable + # ${4} is the user-friendly name for the configuration option + # ${5} name of the utility needed for the block device type + # ${6} is the name of the package that contains the program + # ${6} is **distribution-dependent** + if [ "${1}" != "0" ] && [ "${2}" = "1" ] + then + 66-env -t boot -r "${3}"=!yes boot@system + 66-yeller %g "${4} detected and enabled!" %n + elif [ "${1}" != "0" ] && [ "${2}" = "0" ] + then + 66-env -t boot -r "${3}"=!no boot@system + 66-yeller -W %y "${4} detected but cannot be enabled,\n because the ${5} program is not installed. Please install the ${6} \n package and run this script again!" %n + elif [ "${1}" = "0" ] + then + 66-env -t boot -r "${3}"=!no boot@system + 66-yeller %b "${4} not detected!" %n + fi + +} + +check_and_apply_conf_zpool() { + # Checks for the zfs pool import method if ZFS is enabled. + # Outputs user information + # ${1} is in the form of $fs_detected + # ${2} is in the form of $fs_name_exists + if [ "${1}" != "0" ] && [ "${2}" = "1" ] + then + 66-env -t boot -r "ZFS"=!yes boot@system + if [ -e /etc/zfs/zpool.cache ] + then + 66-env -t boot -r ZFS_IMPORT=!zpoolcache boot@system + 66-yeller %g "ZFS import method configured as zpoolcache." %n + else + 66-env -t boot -r ZFS_IMPORT=!scan boot@system + 66-yeller %g "ZFS import method configured as scan." %n + fi + fi + +} + +# Use detect fs for all types we want +detect_fs btrfs +detect_fs zfs_member +detect_fs crypto_LUKS +detect_fs LVM2_member + +# dmraid supports multiple TYPEs of *-raid-member devices. +# find them first and add the sum of the *_detected values to +# dmraid_detected. +detect_fs ddf_raid_member +detect_fs isw_raid_member +detect_fs lsi_mega_raid_member +detect_fs via_raid_member +detect_fs silicon_medley_raid_member +detect_fs nvidia_raid_member +detect_fs promise_fasttrack_raid_member +detect_fs hpt45x_raid_member +detect_fs hpt37x_raid_member +detect_fs adaptec_raid_member +detect_fs jmicron_raid_member + +# shellcheck disable=SC2154 +dmraid_detected=$((ddf_raid_member_detected+isw_raid_member_detected\ ++lsi_mega_raid_member_detected+via_raid_member_detected\ ++silicon_medley_raid_member_detected+nvidia_raid_member_detected\ ++promise_fasttrack_raid_member_detected+hpt37x_raid_member_detecter\ ++hpt45x_raid_member_detected+adaptec_raid_member_detected\ ++jmicron_raid_member_detected)) + +# swap can be detected by blkid if it is a partition or it can be a swapfile +# declared in fstab +detect_fs swap +detect_swapfile +swap_detected=$((swap_detected+swapfile_detected)) + +# Use detect_util for all utilities +detect_util btrfs_util btrfs +detect_util zfs_util zfs +detect_util luks_util cryptsetup +detect_util lvm_util lvchange +detect_util dmraid_util dmraid +detect_util swap_util swapon + +# Finally detect and apply the configuration +# shellcheck disable=SC2154 +check_and_apply_conf "$btrfs_detected" "$btrfs_util_exists" BTRFS BTRFS btrfs "[btrfs_progs]" +# shellcheck disable=SC2154 +check_and_apply_conf "$zfs_detected" "$zfs_util_exists" ZFS ZFS zfs "[zfs]" +# shellcheck disable=SC2154 +check_and_apply_conf_zpool "$zfs_detected" "$zfs_util_exists" ZFS +# shellcheck disable=SC2154 +check_and_apply_conf "$crypto_LUKS_detected" "$luks_util_exists" CRYPTTAB LUKS cryptsetup "[cryptsetup]" +# shellcheck disable=SC2154 +check_and_apply_conf "$LVM2_member_detected" "$lvm_util_exists" LVM LVM lvchange "[lvm2]" +# shellcheck disable=SC2154 +check_and_apply_conf "$dmraid_detected" "$dmraid_util_exists" DMRAID DMRAID dmraid "[dmraid]" +# shellcheck disable=SC2154 +check_and_apply_conf "$swap_detected" "$swap_util_exists" SWAP SWAP swapon "[util-linux]" + + +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 \ No newline at end of file diff --git a/srcpkgs/boot-66serv/files/runit b/srcpkgs/boot-66serv/files/runit new file mode 100644 index 000000000000..1e6bc6872f78 --- /dev/null +++ b/srcpkgs/boot-66serv/files/runit @@ -0,0 +1,35 @@ +[main] +@type = classic +@version = @VERSION@ +@description = "runit" +@user = (root) + +[start] +@build = custom +@shebang = "/bin/sh" +@execute = ( +exec 2>&1 + +PATH=/usr/bin:/usr/sbin +runlevel=66 + +runsvchdir "${runlevel}" +s6-mkdir -v -p /run/runit/runsvdir +ln -s /etc/runit/runsvdir/current /run/runit/runsvdir/current +s6-rmrf /var/service/current +s6-rmrf /var/service/supervise + +exec s6-env -i PATH=$PATH \ + runsvdir -P /run/runit/runsvdir/current + ) + +[stop] +@build = custom +@shebang = "/bin/sh -c" +@execute = ( + sv force-stop /var/service/* && + sv exit /var/service/* ) + +[logger] +@backup = 3 +@maxsize = 1000000 \ No newline at end of file diff --git a/srcpkgs/boot-66serv/files/runit-wrapsv@ b/srcpkgs/boot-66serv/files/runit-wrapsv@ new file mode 100644 index 000000000000..90349947127b --- /dev/null +++ b/srcpkgs/boot-66serv/files/runit-wrapsv@ @@ -0,0 +1,9 @@ +# The service takes the runit service name as @I - e.g. runit-wrapsv@cupsd +[main] +@type = classic +@version = @VERSION@ +@description = "wrapper for @I runit service" +@user = ( root ) + +[start] +@execute = ( /etc/sv/@I/run ) diff --git a/srcpkgs/boot-66serv/files/switch-initutils b/srcpkgs/boot-66serv/files/switch-initutils new file mode 100755 index 000000000000..9876234ddaa3 --- /dev/null +++ b/srcpkgs/boot-66serv/files/switch-initutils @@ -0,0 +1,13 @@ +# This core service checks for /usr/bin/{reboot,poweroff,halt,shutdown} +# and if they are part of 66 it deletes them and moves the runit +# utilities in their place. It runs by default. There is a similar +# oneshot service for 66 that does the opposite and should be enabled. +# The script make sure that the user has the proper utilities for the +# init system they are currently running. + +for i in reboot poweroff halt shutdown; do + if test -e /usr/bin/${i}.runit; then + rm /usr/bin/${i} + mv /usr/bin/${i}.runit /usr/bin/${i} + fi + done diff --git a/srcpkgs/boot-66serv/files/switch-initutils-66 b/srcpkgs/boot-66serv/files/switch-initutils-66 new file mode 100644 index 000000000000..f622a736f7a8 --- /dev/null +++ b/srcpkgs/boot-66serv/files/switch-initutils-66 @@ -0,0 +1,31 @@ + +# This oneshot service checks for /usr/bin/{reboot,poweroff,halt,shutdown} +# and if they are part of runit-void it renames them and copies the 66 +# utilities in their place. It must be enabled, especially if one +# changes between the two init systems. There is a similar script for +# runit core-services that does the opposite and runs by default with runit. +# The service makes sure that the user has the proper utilities for the +# init system they are currently running. + +[main] +@type = oneshot +@version = @VERSION@ +@description = "Switch initutils" +@user = ( root ) + +[start] +@build = custom +@shebang = "/bin/sh -c" +@execute = ( + +poweroff_util=$(readlink -f /usr/bin/poweroff) + +if grep -q "s6-svscan" /proc/1/cmdline && [ $(pgrep -u root 66-shutdownd) ]; then + if [ "$poweroff_util" != /usr/bin/poweroff ]; then + for i in reboot poweroff halt shutdown; do + mv /usr/bin/${i} /usr/bin/${i}.runit + cp /etc/66/${i} /usr/bin/${i} + done + fi +fi +) diff --git a/srcpkgs/boot-66serv/files/sysctl.sh b/srcpkgs/boot-66serv/files/sysctl.sh new file mode 100755 index 000000000000..3a7c6f85b898 --- /dev/null +++ b/srcpkgs/boot-66serv/files/sysctl.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Copy of the 08-syctl.sh script of the void-runit project, +# that is in the public domain. +# Latest version of the upstream script is in: +# https://github.com/void-linux/void-runit/blob/master/core-services/08-sysctl.sh +# Licence information is available in the README.md: +# https://github.com/void-linux/void-runit#readme + +if [ -x /sbin/sysctl -o -x /bin/sysctl ]; then + mkdir -p /run/vsysctl.d + for i in /run/sysctl.d/*.conf \ + /etc/sysctl.d/*.conf \ + /usr/local/lib/sysctl.d/*.conf \ + /usr/lib/sysctl.d/*.conf; do + + if [ -e "$i" ] && [ ! -e "/run/vsysctl.d/${i##*/}" ]; then + ln -s "$i" "/run/vsysctl.d/${i##*/}" + fi + done + for i in /run/vsysctl.d/*.conf; do + sysctl -p "$i" + done + rm -rf -- /run/vsysctl.d + sysctl -p /etc/sysctl.conf +fi diff --git a/srcpkgs/boot-66serv/patches/0001-service-system-devices-devices-first-pass-at-improvi.patch b/srcpkgs/boot-66serv/patches/0001-service-system-devices-devices-first-pass-at-improvi.patch new file mode 100644 index 000000000000..cfc3239d9f2e --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0001-service-system-devices-devices-first-pass-at-improvi.patch @@ -0,0 +1,157 @@ +From fd57e39ac0214f0009998329f81abf843f3efb82 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Tue, 17 May 2022 17:18:33 +0300 +Subject: [PATCH 01/23] service/system/devices/devices-*: first pass at + improving user warnings and general behavior. More information on the + [PR](https://framagit.org/pkg/obmods/boot-66serv/-/merge_requests/16) + +--- + .../service/system/devices/devices-btrfs | 18 +++++++------- + .../service/system/devices/devices-crypttab | 17 ++++++++----- + .../boot@/service/system/devices/devices-lvm | 24 ++++++++----------- + .../boot@/service/system/devices/devices-zfs | 15 +++++++----- + 4 files changed, 40 insertions(+), 34 deletions(-) + +diff --git a/module/boot@/service/system/devices/devices-btrfs b/module/boot@/service/system/devices/devices-btrfs +index dc46638..987d29c 100644 +--- a/module/boot@/service/system/devices/devices-btrfs ++++ b/module/boot@/service/system/devices/devices-btrfs +@@ -1,7 +1,7 @@ + [main] + @type = oneshot + @version = @vers@ +-@description = "Active btrfs devices" ++@description = "Activate btrfs devices" + @user = ( root ) + @depends = ( udevadm ) + @options = ( !log ) +@@ -10,11 +10,13 @@ + @execute = + ( + if { 66-yeller -cdp devices-btrfs -1 /dev/console starts... } +- if -nt { +- +- if { 66-which -q btrfs } +- btrfs device scan +- +- } +- 66-yeller -fcdp devices-btrfs -1 /dev/console crashed! ++ ifelse { blkid --match-token=TYPE="btrfs" } ++ { ifelse -n { 66-which -q btrfs } ++ { if { 66-yeller -cdp device-btrfs -1 /dev/console No btrfs program available, check your configuration! } exit 0 } ++ if -nt { ++ btrfs device scan ++ } ++ 66-yeller -fcdp devices-btrfs -1 /dev/console crashed! } ++ ++ 66-yeller -cdp device-btrfs -1 /dev/console no btrfs volumes available! + ) +diff --git a/module/boot@/service/system/devices/devices-crypttab b/module/boot@/service/system/devices/devices-crypttab +index fd491ef..b1c327b 100644 +--- a/module/boot@/service/system/devices/devices-crypttab ++++ b/module/boot@/service/system/devices/devices-crypttab +@@ -10,13 +10,15 @@ + @execute = + ( + if { 66-yeller -cdp devices-crypttab -1 /dev/console starts... } +- if -nt { ++ ifelse { blkid --match-token=TYPE="crypto_LUKS" } + +- execl-toc -e ${script_conf} +- if { execl-cmdline -s { 66-olexec awk -f ${script_file} ${script_conf} } } +- +- foreground { ++ { ++ ifelse { execl-toc -X -e ${script_conf} } ++ { if -nt { ++ if { execl-cmdline -s { 66-olexec awk -f ${script_file} ${script_conf} } } ++ foreground { + ++ if { blkid --match-token=TYPE="LVM2_member" } + if { 66-which -q vgchange } + if { 66-yeller -cdp devices-crypttab -1 /dev/console Activating LVM devices for dm-crypt... } + if -nt { +@@ -26,7 +28,10 @@ + 66-yeller -cdp devices-crypttab -1 /dev/console unable to activate LVM devices + } + } +- 66-yeller -fcdp devices-crypttab -1 /dev/console crashed! ++ 66-yeller -fcdp devices-crypttab -1 /dev/console crashed! } ++ if { 66-yeller -cdp device-crypttab -1 /dev/console no ${script_conf} available, check your installation and configuration! } exit 0 } ++ ++ 66-yeller -cdp device-crypttab -1 /dev/console no encrypted volumes available! + ) + + [environment] +diff --git a/module/boot@/service/system/devices/devices-lvm b/module/boot@/service/system/devices/devices-lvm +index df1429e..3a5068d 100644 +--- a/module/boot@/service/system/devices/devices-lvm ++++ b/module/boot@/service/system/devices/devices-lvm +@@ -1,7 +1,7 @@ + [main] + @type = oneshot + @version = @vers@ +-@description = "Active lvm devices" ++@description = "Activate lvm devices" + @user = ( root ) + @depends = ( udevadm ) + @options = ( !log ) +@@ -9,18 +9,14 @@ + [start] + @execute = + ( +- if { 66-yeller -cdp devices-lvm -1 /dev/console starts... } +- if -nt { +- +- if { 66-which -q lvmetad } +- execl-toc -d /run/lvm +- if { lvmetad -p /run/lvm/lvmetad.pid } +- if { 66-which -q vgchange } +- foreground { +- vgchange --sysinit -a ay ++if { 66-yeller -cdp devices-lvm -1 /dev/console starts... } ++ ifelse { blkid --match-token=TYPE="LVM2_member" } ++ { ifelse -n { 66-which -q vgchange } ++ { if { 66-yeller -cdp device-lvm -1 /dev/console No vgchange program available, check your configuration! } exit 0 } ++ if -nt { ++ vgchange --sysinit -a ay + } +- pkill lvmetad +- +- } +- 66-yeller -fcdp devices-lvm -1 /dev/console crashed! ++ 66-yeller -fcdp devices-lvm -1 /dev/console crashed! } ++ ++ 66-yeller -cdp device-lvm -1 /dev/console no lvm volumes available! + ) +diff --git a/module/boot@/service/system/devices/devices-zfs b/module/boot@/service/system/devices/devices-zfs +index c832647..fdfbe5f 100644 +--- a/module/boot@/service/system/devices/devices-zfs ++++ b/module/boot@/service/system/devices/devices-zfs +@@ -10,14 +10,17 @@ + @execute = + ( + if { 66-yeller -cdp devices-zfs -1 /dev/console starts... } +- if -nt { +- +- if { 66-which -q zfs } +- if { execl-cmdline -s { zfs mount ${mount_args} } } ++ ifelse { blkid --match-token=TYPE="zfs" } ++ { ifelse -n { 66-which -q zfs } ++ { if { 66-yeller -cdp device-zfs -1 /dev/console No zfs program available, check your configuration! } exit 0 } ++ if -nt { ++ if { execl-cmdline -s { zfs mount ${mount_args} } } + execl-cmdline -s { zfs share ${share_args} } ++ } ++ 66-yeller -fcdp devices-zfs -1 /dev/console crashed! } ++ ++ 66-yeller -cdp device-zfs -1 /dev/console no zfs volumes available!! + +- } +- 66-yeller -fcdp devices-zfs -1 /dev/console crashed! + ) + + [environment] +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0002-configure-configure-add-checks-to-make-the-process-m.patch b/srcpkgs/boot-66serv/patches/0002-configure-configure-add-checks-to-make-the-process-m.patch new file mode 100644 index 000000000000..1becf7808ae8 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0002-configure-configure-add-checks-to-make-the-process-m.patch @@ -0,0 +1,295 @@ +From cc9ac05ef06a8dcf871f950dd076ab536aa26a18 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 10 Jul 2022 17:12:03 +0300 +Subject: [PATCH 02/23] configure/configure: add checks to make the process + more robust + +- check for the existence of necessary keys +- check if keys have correct values +- check if btrfs, zfs, luks, dmraid etc volumes exist, the relevant +configuration options are valid and the utilities needed are present +- enable tests if CHECK_CONFIGURATION=yes. +--- + module/boot@/configure/configure | 230 ++++++++++++++++++++++++++++++- + 1 file changed, 224 insertions(+), 6 deletions(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index e6fed96..bcf2fad 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -10,19 +10,96 @@ export COLOR_ENABLED="${MOD_COLOR}" + service_dir="${MOD_MODULE_DIR}/service" + SV_REAL= + ++## sv_boolean_list contain keys that take yes or no as values + sv_boolean_list="CRYPTTAB SETUPCONSOLE FSTAB SWAP LVM \ +-DMRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER TMPFILE MODULE_KERNEL \ ++DMRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER MODULE_KERNEL \ + MODULE_SYSTEM RANDOMSEED MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP CGROUPS \ + MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP" +- ++## sv_container_list contained keys for options that are disabled in a container + sv_container_list="HARDWARECLOCK SETUPCONSOLE CRYPTTAB SWAP LVM DMRAID BTRFS \ + ZFS UDEV UDEV_ADM SYSCTL FORCECHCK CGROUPS MODULE_SYSTEM RANDOMSEED MNT_NETFS" ++## sv_container_list is used by the check funtions and has the same contents as the ++## sv_container_list, minus UDEV_ADM ++sv_container_list_check="HARDWARECLOCK SETUPCONSOLE CRYPTTAB SWAP LVM DMRAID BTRFS \ ++ZFS UDEV SYSCTL FORCECHCK CGROUPS MODULE_SYSTEM RANDOMSEED MNT_NETFS" ++## sv_extra_list_check is used by the check functions and contains keys that need ++## to be present but are not in the previous lists ++sv_extra_list_check="HOSTNAME TZ TTY KEYMAP FONT" + + die(){ +- 66-yeller -f "${@}" +- exit 111 ++ fatal_error_message="$( printf '%s' "${@}" )" ++ 66-yeller -f "%r $fatal_error_message %n" ++ exit 111 ++} ++ ++warn() { ++ warn_message="$( printf '%s' "${@}" )" ++ 66-yeller -W "%y $warn_message %n" ++} ++ ++emit_trace() { ++ trace_message="$( printf '%s' "${@}" )" ++ 66-yeller -t "%b $trace_message %n" ++} ++ ++## Detect functions. They use blkid(8) from util-linux to detect volume types ++## and 66-which to detect the needed utilities for the volume types ++ ++detect_fs() { ++ # Uses blkid to detect partition TYPEs. The result is the number ++ # of detected partitions. ++ export "${1}"_detected="$(blkid -c /dev/null --match-token=TYPE="${1}" | wc -l )" ++} ++detect_swapfile() { ++ # Finds swap references in /etc/fstab. ++ swapfile_detected="$(awk '!/^(#)/' /etc/fstab | awk '$3=="swap" ' | wc -l )" ++ export swapfile_detected + } ++detect_util() { ++ # Uses 66-which to determine if a utility exists. ++ # Output is $fs_util_exitst=0 (or 1) ++ # ${1} is the variable for the utility, in the form of "$fs_util" ++ # ${2} is the name of the executable ++ export "${1}"_exists="$(66-which "${2}" | wc -l)" ++} ++ ++detect_fs btrfs ++detect_fs zfs ++detect_fs crypto_LUKS ++detect_fs LVM2_member ++# dmraid supports multiple TYPEs of *-raid-member devices. ++# find them first and add the sum of the *_detected values to ++# dmraid_detected. ++detect_fs ddf_raid_member ++detect_fs isw_raid_member ++detect_fs lsi_mega_raid_member ++detect_fs via_raid_member ++detect_fs silicon_medley_raid_member ++detect_fs nvidia_raid_member ++detect_fs promise_fasttrack_raid_member ++detect_fs hpt45x_raid_member ++detect_fs hpt37x_raid_member ++detect_fs adaptec_raid_member ++detect_fs jmicron_raid_member ++dmraid_detected=$((ddf_raid_member_detected+isw_raid_member_detected\ +++lsi_mega_raid_member_detected+via_raid_member_detected\ +++silicon_medley_raid_member_detected+nvidia_raid_member_detected\ +++promise_fasttrack_raid_member_detected+hpt37x_raid_member_detecter\ +++hpt45x_raid_member_detected+adaptec_raid_member_detected\ +++jmicron_raid_member_detected)) ++# swap can be detected by blkid if it is a partition or it can be a swapfile ++# declared in fstab ++detect_fs swap ++detect_swapfile ++swap_detected=$((swap_detected+swapfile_detected)) ++detect_util btrfs_util btrfs ++detect_util zfs_util zfs ++detect_util luks_util cryptsetup ++detect_util lvm_util lvchange ++detect_util dmraid_util dmraid ++detect_util swap_util swapon + ++## Check functions. + check_empty_var(){ + name="${1}" var_value="${2}" + if [ -z "${var_value}" ]; then +@@ -30,7 +107,129 @@ check_empty_var(){ + fi + } + ++check_var_existance() { ++ # ${1} is a list with key names ++ for key in ${1} ++ do ++ eval key_value="\$${key}" ++ key_value="$key_value" ++ if [ -z "$key_value" ]; then ++ die "$key is not present or misconfigured. The process cannot continue, ++ please fix yout configuration and try again!" ++ fi ++ done ++} ++ ++check_boolean_var_values() { ++ # ${1} is a list of key names ++ # ${2} and ${2} are valid values for these keys ++ for key in ${1} ++ do ++ eval key_value="\$${key}" ++ key_value="$key_value" ++ if [ "$key_value" = "${2}" ]; then ++ emit_trace "$key has a correct value of [$key_value]" ++ elif [ "$key_value" = "${3}" ]; then ++ emit_trace "$key has a correct value of [$key_value]" ++ else ++ die " [${key_value}] is not a valid value for ${key}. The process cannot continue, ++please fix your configuration and try again!" ++ fi ++ done ++} ++ ++check_volume_sanity() { ++ # ${1} is the configuration key for the volume type ++ # ${2} is the value of the relevant detect_fs function ++ # ${3} is the value of the relevant detect_util_exists function ++ # ${4} is the name of the relevant utility ++ # Check if volumes of a certain type (${2}) exist, if the utility ++ # needed for the type exists and if that volume type is enabled ++ # in the environment file. ++ eval key_value="\$${1}" ++ key_value="$key_value" ++ [ "$key_value" = "yes" ] && [ "${2}" -gt 0 ] && [ "${3}" -eq 1 ] && \ ++ emit_trace "${1} is enabled and configured correctly" ++ [ "${1}" = "yes" ] && [ "${2}" -eq 0 ] && warn "${1} is set to ++ [ $key_value ] but there are no relevant volumes present. This is\ ++ a non-fatal warning, you may want to check your configuration" ++ [ "$key_value" = "yes" ] && [ "${2}" -gt 0 ] && [ "${3}" -eq 0 ] && \ ++ die "${1} is set to [$key_value], relevant volumes exist but [${4}] does not exist. \ ++The process cannot continue, please check your configuration and try again" ++ [ "$key_value" = "no" ] && [ "${2}" -gt 0 ] && \ ++ warn "${1} is set to [$key_value], but relevant volumes exist. \ ++This is a non-fatal warning but you should check your configuration!" ++} ++ ++check_tty_number() { ++ # TTY should between 1 and 11. Warn if it is 0, abort with an error ++ # if it is outside of this range. ++ key_value="$TTY" ++ if [ "${key_value}" -gt 11 ]; then ++ die "TTY should have a value between 1 and 11. The current value\ ++ of [$key_value] is not valid. The process cannot continue, please fix\ ++ your configuration and try again" ++ elif [ "$key_value" -lt 0 ]; then ++ die "TTY should have a value between 1 and 11. The process cannot\ ++ continue, please fix your configuration and try again" ++ elif [ "$key_value" -eq 0 ]; then ++ warn "TTY has a value of [0]. That is valid, but means that the\ ++ system will not have a configured tty." ++ else ++ emit_trace "TTY has a valid value. [$key_value] ttys will be\ ++ configured. " ++ fi ++} ++ ++check_tz() { ++ # TZ should have a timezone that exists as a value ++ execl-toc -n -X -e /usr/share/zoneinfo/"$TZ" && die "[ ${TZ} ] is not \ ++a valid value for TZ. The process cannot continue, please check your configuration and try again." ++ execl-toc -X -e /usr/share/zoneinfo/"$TZ" && emit_trace "TZ is correctly configured, with a\ ++ value of [${TZ}]." ++} ++ ++check_keymap() { ++ # KEYMAP value is checked against a generated list of keymaps in the system ++ keymap_list="" ++ keymap_list="$(find /usr/share/kbd/keymaps/ -type f -iname "*.map.gz" -printf "%f " | sed 's|.map.gz||g')" ++ keymap_exists= ++ for keymap in $keymap_list; ++ do ++ [ "$keymap" = "${KEYMAP}" ] && export keymap_exists=1 ; ++ done ++ if [ "$keymap_exists" = "1" ] ; ++ then ++ emit_trace "KEYMAP is correctly configured with a value of [${KEYMAP}]." ++ else ++ die "[${KEYMAP}] is not a valid value for KEYMAP. The process cannot continue,\ ++ please check your configuration and try again." ++ fi ++} ++check_consolefont() { ++ # FONT value is checked against a generated list of console fonts that ++ # exist in the system. Currently psf and psfu types are listed, compressed ++ # with gz. We will see if that is enough. ++ console_fontlist="" ++ console_fontlist="$(find /usr/share/kbd/consolefonts/ -type f -iname "*.psf.gz" -printf "%f " | sed 's|.psf.gz||g')" ++ console_fontlist="$console_fontlist $(find /usr/share/kbd/consolefonts/ -type f -iname "*.psfu.gz" -printf "%f " | sed 's|.psfu.gz||g')" ++ font_exists= ++ for font in $console_fontlist; ++ do ++ [ "$font" = "${FONT}" ] && export font_exists=1 ; ++ done ++ if [ "$font_exists" = "1" ] ; ++ then ++ emit_trace "FONT is correctly configured with a value of [${FONT}]." ++ else ++ die " [${FONT}] is not a valid value for FONT. The process cannot continue,\ ++ please check your configuration and try again." ++ fi ++} ++ + retrieve_sv_name(){ ++ # Matches the configuration key of the environment section/file to the name ++ # of the corresponding service frontend. + sv=${1} + case ${sv} in + HARDWARECLOCK) SV_REAL="system-hwclock" ;; +@@ -46,7 +245,6 @@ retrieve_sv_name(){ + SYSCTL) SV_REAL="system-sysctl" ;; + FORCECHCK) SV_REAL="system-fsck" ;; + LOCAL) SV_REAL="local-rc" ;; +- TMPFILE) SV_REAL="local-tmpfiles" ;; + MODULE_KERNEL) SV_REAL="modules-kernel" ;; + MODULE_SYSTEM) SV_REAL="modules-system" ;; + RANDOMSEED) SV_REAL="system-random" ;; +@@ -127,6 +325,26 @@ sv_comment_real() { + fi + } + ++ ++# Check the configuration if CHECK_CONFIGURATION is set to "yes" in the ++# environment section/file ++if [ "${CHECK_CONFIGURATION}" = "yes" ]; then ++ check_var_existance "$sv_boolean_list" ++ check_var_existance "$sv_container_list_check" ++ check_var_existance "$sv_extra_list_check" ++ check_boolean_var_values "$sv_boolean_list" "yes" "no" ++ check_tty_number ++ check_tz ++ check_keymap ++ check_consolefont ++ check_volume_sanity BTRFS "$btrfs_detected" "$btrfs_util_exists" btrfs ++ check_volume_sanity ZFS "$zfs_detected" "$zfs_util_exists" zfs ++ check_volume_sanity CRYPTTAB "$crypto_LUKS_detected" "$luks_util_exists" cryptsetup ++ check_volume_sanity LVM "$LVM2_member_detected" "$lvm_util_exists" lvchange ++ check_volume_sanity DMRAID "$dmraid_detected" "$dmraid_util_exists" dmraid ++ check_volume_sanity SWAP "$swap_detected" "$swap_util_exists" swapon ++fi ++ + 66-yeller %benable%n service: "tty-earlier@tty12" + touch "${service_dir}/tty-earlier@tty12" || die "unable to create ${service_dir}/tty-earlier@tty12" + +@@ -210,4 +428,4 @@ else + done + fi + +-66-yeller "%bsuccessfully%n configured" ++66-yeller "%bsuccessfully%n configured" +\ No newline at end of file +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0003-service-system-devices-devices-add-c-dev-null-to-the.patch b/srcpkgs/boot-66serv/patches/0003-service-system-devices-devices-add-c-dev-null-to-the.patch new file mode 100644 index 000000000000..fdbbbc59fa73 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0003-service-system-devices-devices-add-c-dev-null-to-the.patch @@ -0,0 +1,68 @@ +From b600e122710af5dc92e74988b68aa7583d922487 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 10 Jul 2022 17:13:45 +0300 +Subject: [PATCH 03/23] service/system/devices/devices-* : add -c /dev/null to + the blkid command in order to avoid using a cachefile for the detection. + +--- + module/boot@/service/system/devices/devices-btrfs | 2 +- + module/boot@/service/system/devices/devices-crypttab | 2 +- + module/boot@/service/system/devices/devices-lvm | 2 +- + module/boot@/service/system/devices/devices-zfs | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/module/boot@/service/system/devices/devices-btrfs b/module/boot@/service/system/devices/devices-btrfs +index 987d29c..3e5fcec 100644 +--- a/module/boot@/service/system/devices/devices-btrfs ++++ b/module/boot@/service/system/devices/devices-btrfs +@@ -10,7 +10,7 @@ + @execute = + ( + if { 66-yeller -cdp devices-btrfs -1 /dev/console starts... } +- ifelse { blkid --match-token=TYPE="btrfs" } ++ ifelse { blkid -c /dev/null --match-token=TYPE="btrfs" } + { ifelse -n { 66-which -q btrfs } + { if { 66-yeller -cdp device-btrfs -1 /dev/console No btrfs program available, check your configuration! } exit 0 } + if -nt { +diff --git a/module/boot@/service/system/devices/devices-crypttab b/module/boot@/service/system/devices/devices-crypttab +index b1c327b..07a0e36 100644 +--- a/module/boot@/service/system/devices/devices-crypttab ++++ b/module/boot@/service/system/devices/devices-crypttab +@@ -10,7 +10,7 @@ + @execute = + ( + if { 66-yeller -cdp devices-crypttab -1 /dev/console starts... } +- ifelse { blkid --match-token=TYPE="crypto_LUKS" } ++ ifelse { blkid -c /dev/null --match-token=TYPE="crypto_LUKS" } + + { + ifelse { execl-toc -X -e ${script_conf} } +diff --git a/module/boot@/service/system/devices/devices-lvm b/module/boot@/service/system/devices/devices-lvm +index 3a5068d..0da7390 100644 +--- a/module/boot@/service/system/devices/devices-lvm ++++ b/module/boot@/service/system/devices/devices-lvm +@@ -10,7 +10,7 @@ + @execute = + ( + if { 66-yeller -cdp devices-lvm -1 /dev/console starts... } +- ifelse { blkid --match-token=TYPE="LVM2_member" } ++ ifelse { blkid -c /dev/null --match-token=TYPE="LVM2_member" } + { ifelse -n { 66-which -q vgchange } + { if { 66-yeller -cdp device-lvm -1 /dev/console No vgchange program available, check your configuration! } exit 0 } + if -nt { +diff --git a/module/boot@/service/system/devices/devices-zfs b/module/boot@/service/system/devices/devices-zfs +index fdfbe5f..69c6b34 100644 +--- a/module/boot@/service/system/devices/devices-zfs ++++ b/module/boot@/service/system/devices/devices-zfs +@@ -10,7 +10,7 @@ + @execute = + ( + if { 66-yeller -cdp devices-zfs -1 /dev/console starts... } +- ifelse { blkid --match-token=TYPE="zfs" } ++ ifelse { blkid -c /dev/null --match-token=TYPE="zfs" } + { ifelse -n { 66-which -q zfs } + { if { 66-yeller -cdp device-zfs -1 /dev/console No zfs program available, check your configuration! } exit 0 } + if -nt { +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0004-module-boot-configure-configure-add-back-tmpfile-con.patch b/srcpkgs/boot-66serv/patches/0004-module-boot-configure-configure-add-back-tmpfile-con.patch new file mode 100644 index 000000000000..89e053009642 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0004-module-boot-configure-configure-add-back-tmpfile-con.patch @@ -0,0 +1,34 @@ +From 2c14f843c9de0405b5e6e959afc754c5c1b28842 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Wed, 28 Sep 2022 20:26:04 +0300 +Subject: [PATCH 04/23] module/boot@/configure/configure: add back tmpfile + configuration. + +--- + module/boot@/configure/configure | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index bcf2fad..2cdef3f 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -12,7 +12,7 @@ SV_REAL= + + ## sv_boolean_list contain keys that take yes or no as values + sv_boolean_list="CRYPTTAB SETUPCONSOLE FSTAB SWAP LVM \ +-DMRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER MODULE_KERNEL \ ++DMRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER TMPFILE MODULE_KERNEL \ + MODULE_SYSTEM RANDOMSEED MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP CGROUPS \ + MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP" + ## sv_container_list contained keys for options that are disabled in a container +@@ -245,6 +245,7 @@ retrieve_sv_name(){ + SYSCTL) SV_REAL="system-sysctl" ;; + FORCECHCK) SV_REAL="system-fsck" ;; + LOCAL) SV_REAL="local-rc" ;; ++ TMPFILE) SV_REAL="local-tmpfiles" ;; + MODULE_KERNEL) SV_REAL="modules-kernel" ;; + MODULE_SYSTEM) SV_REAL="modules-system" ;; + RANDOMSEED) SV_REAL="system-random" ;; +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0005-configure-configure-fix-zfs-detection.patch b/srcpkgs/boot-66serv/patches/0005-configure-configure-fix-zfs-detection.patch new file mode 100644 index 000000000000..0d5bdd28bf33 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0005-configure-configure-fix-zfs-detection.patch @@ -0,0 +1,39 @@ +From be5ea919956fe5e5a1913d8fd98c58577ae9ade6 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Wed, 28 Sep 2022 20:32:21 +0300 +Subject: [PATCH 05/23] configure/configure: fix zfs detection. + +--- + module/boot@/configure/configure | 2 +- + module/boot@/service/system/devices/devices-zfs | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index 2cdef3f..eca4903 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -64,7 +64,7 @@ detect_util() { + } + + detect_fs btrfs +-detect_fs zfs ++detect_fs zfs_member + detect_fs crypto_LUKS + detect_fs LVM2_member + # dmraid supports multiple TYPEs of *-raid-member devices. +diff --git a/module/boot@/service/system/devices/devices-zfs b/module/boot@/service/system/devices/devices-zfs +index 69c6b34..8968b04 100644 +--- a/module/boot@/service/system/devices/devices-zfs ++++ b/module/boot@/service/system/devices/devices-zfs +@@ -10,7 +10,7 @@ + @execute = + ( + if { 66-yeller -cdp devices-zfs -1 /dev/console starts... } +- ifelse { blkid -c /dev/null --match-token=TYPE="zfs" } ++ ifelse { blkid -c /dev/null --match-token=TYPE="zfs_member" } + { ifelse -n { 66-which -q zfs } + { if { 66-yeller -cdp device-zfs -1 /dev/console No zfs program available, check your configuration! } exit 0 } + if -nt { +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0006-devices-devices-dmraid-first-pass-at-making-the-serv.patch b/srcpkgs/boot-66serv/patches/0006-devices-devices-dmraid-first-pass-at-making-the-serv.patch new file mode 100644 index 000000000000..252ccb92e7d8 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0006-devices-devices-dmraid-first-pass-at-making-the-serv.patch @@ -0,0 +1,41 @@ +From e8c012d02d2ac37648420ad43eb8b44fdd071b03 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Wed, 28 Sep 2022 21:54:56 +0300 +Subject: [PATCH 06/23] devices/devices-dmraid: first pass at making the + service more robust. + +- make the check for the utility not fatal - exist with a warning +- make the dmraid invocation more verbose (it not easy to add the same +check as in other services) +- make the crash message a warning. +--- + .../boot@/service/system/devices/devices-dmraid | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/module/boot@/service/system/devices/devices-dmraid b/module/boot@/service/system/devices/devices-dmraid +index f1408ad..699fc5f 100644 +--- a/module/boot@/service/system/devices/devices-dmraid ++++ b/module/boot@/service/system/devices/devices-dmraid +@@ -9,12 +9,11 @@ + [start] + @execute = + ( +- if { 66-yeller -cdp devices-dmraid -1 /dev/console starts... } +- if -nt { +- +- if { 66-which -q dmraid } +- dmraid -i -ay +- +- } +- 66-yeller -fcdp devices-dmraid -1 /dev/console crashed! ++ if { 66-yeller -cdp devices-dmraid -1 /dev/console starts... } ++ ifelse -n { 66-which -q dmraid } ++ { if { 66-yeller -cdp device-dmraid -1 /dev/console No dmraid program available, check your configuration! } exit 0 } ++ if -nt { ++ dmraid -vv -i -ay ++ } ++ 66-yeller -Wcdp devices-dmraid -1 /dev/console crached - no raid volumes found! + ) +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0007-devices-devices-mdraid-first-pass-at-adding-mdraid-s.patch b/srcpkgs/boot-66serv/patches/0007-devices-devices-mdraid-first-pass-at-adding-mdraid-s.patch new file mode 100644 index 000000000000..e0a73a91765d --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0007-devices-devices-mdraid-first-pass-at-adding-mdraid-s.patch @@ -0,0 +1,83 @@ +From d95f82e086a8b85c003b67c2d1c91740fc48c0ab Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Wed, 28 Sep 2022 22:15:50 +0300 +Subject: [PATCH 07/23] devices/devices-mdraid: first pass at adding mdraid + support. - add devices-mdraid frontend service file - add devices-mdraid in + the @depends array of devices-crypttab, devices-lvm and in the @contents + array of system-devices. + +--- + .../service/system/devices/devices-crypttab | 2 +- + .../boot@/service/system/devices/devices-lvm | 2 +- + .../service/system/devices/devices-mdraid | 22 +++++++++++++++++++ + module/boot@/service/system/system-Devices | 1 + + 4 files changed, 25 insertions(+), 2 deletions(-) + create mode 100644 module/boot@/service/system/devices/devices-mdraid + +diff --git a/module/boot@/service/system/devices/devices-crypttab b/module/boot@/service/system/devices/devices-crypttab +index 07a0e36..68e882c 100644 +--- a/module/boot@/service/system/devices/devices-crypttab ++++ b/module/boot@/service/system/devices/devices-crypttab +@@ -4,7 +4,7 @@ + @description = "Activate encrypted devices" + @user = ( root ) + @options = ( !log ) +-@depends = ( udevadm devices-dmraid devices-lvm ) ++@depends = ( udevadm devices-dmraid devices-lvm devices-mdraid ) + + [start] + @execute = +diff --git a/module/boot@/service/system/devices/devices-lvm b/module/boot@/service/system/devices/devices-lvm +index 0da7390..ac75959 100644 +--- a/module/boot@/service/system/devices/devices-lvm ++++ b/module/boot@/service/system/devices/devices-lvm +@@ -3,7 +3,7 @@ + @version = @vers@ + @description = "Activate lvm devices" + @user = ( root ) +-@depends = ( udevadm ) ++@depends = ( udevadm devices-dmraid devices-mdraid ) + @options = ( !log ) + + [start] +diff --git a/module/boot@/service/system/devices/devices-mdraid b/module/boot@/service/system/devices/devices-mdraid +new file mode 100644 +index 0000000..d331c52 +--- /dev/null ++++ b/module/boot@/service/system/devices/devices-mdraid +@@ -0,0 +1,22 @@ ++[main] ++@type = oneshot ++@version = @vers@ ++@description = "Activate software raid devices" ++@user = ( root ) ++@depends = ( udevadm ) ++@options = ( !log ) ++ ++[start] ++@execute = ++( ++ if { 66-yeller -cdp devices-mdraid -1 /dev/console starts... } ++ ifelse { blkid -c /dev/null --match-token=TYPE="linux_raid_member" } ++ { ifelse -n { 66-which -q mdadm } ++ { if { 66-yeller -cdp device-mdraid -1 /dev/console No mdadm program available, check your configuration! } exit 0 } ++ if -nt { ++ mdadm -As ++ } ++ 66-yeller -fcdp devices-mdraid -1 /dev/console crashed! } ++ ++ 66-yeller -cdp device-mdraid -1 /dev/console no mdraid volumes available! ++) +diff --git a/module/boot@/service/system/system-Devices b/module/boot@/service/system/system-Devices +index de8e5e8..de10e56 100644 +--- a/module/boot@/service/system/system-Devices ++++ b/module/boot@/service/system/system-Devices +@@ -10,4 +10,5 @@ devices-btrfs + devices-crypttab + devices-lvm + devices-zfs ++devices-mdraid + ) +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0008-doc-boot-.md-update-configuration-to-reflect-changes.patch b/srcpkgs/boot-66serv/patches/0008-doc-boot-.md-update-configuration-to-reflect-changes.patch new file mode 100644 index 000000000000..4df67d21093e --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0008-doc-boot-.md-update-configuration-to-reflect-changes.patch @@ -0,0 +1,71 @@ +From 6d13228b4128900cb4c1ad00c67e2719616deae3 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Thu, 29 Sep 2022 19:48:32 +0300 +Subject: [PATCH 08/23] doc/boot@.md: update configuration to reflect changes + +--- + doc/boot@.md | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +diff --git a/doc/boot@.md b/doc/boot@.md +index 43f6480..02117bb 100644 +--- a/doc/boot@.md ++++ b/doc/boot@.md +@@ -88,25 +88,32 @@ Two different kinds of variables are used: + + - **LVM**: + - type: boolean. +- - description: uses the `lvmetad` and `vgchange` program to activate LVM partitions. If these programs is not installed on your system, the boot process **fail** even if the enable process finish successfully. ++ - description: uses the `vgchange` program to activate LVM partitions and `cryptsetup` to open luks volumes in them. If the programs are not installed in the system, or if lvm devices are not discovered, an warning is emmited. + + - **DMRAID**: + - type: boolean. +- - description: uses the `dmraid` program to activate RAID partitions. If the program is not installed on your system, the boot process **fail** even if the enable process finish successfully. ++ - description: uses the `dmraid` program to activate RAID devices. If the program is not installed in the system, or if dmraid devices are not discovered, a warning is emmited. ++ ++- **MDRAID**: ++ - type: boolean. ++ - description: uses the `mdadm` program to activate software raid (mdraid) devices. If the program is not installed in the system, or if mdraid devices are not discovered, a warning is emmited. + + - **BTRFS**: + - type: boolean. +- - description: uses the `btrfs` program to activate BTRFS partitions. If the program is not installed on your system, the boot process **fail** even if the enable process finish successfully. ++ - description: uses the `btrfs` program to activate BTRFS partitions. If the program is not installed in the system, or if btrfs devices are not discovered, a warning is emmited. + + - **ZFS**: + - type: boolean. +- - description: uses the `zfs` program to mount ZFS partitions. If the program is not installed on your system, the boot process **fail** even if the enable process finish successfully. ++ - description: uses the `zfs` program to mount ZFS partitions. If the program is not installed in the system, or if zfs devices are not discovered, a warning is emmited. + + - **ZFS_IMPORT**: + - type: string. + - valid value: scan or zpoolcache. + - description: select the import method to use to detect the ZFS devices. This variable works in conjunction with the `ZFS` variable. In case the `ZFS` variable is set to no or commented, the `ZFS_IMPORT` variable has no effect. + ++*LVM, DMRAID, MDRAID, BTRFS and ZFS rely on the `blkid` program from `util-linux` for device descovery.* ++ ++ + - **SETUPCONSOLE**: + - type: boolean. + - description: set it to no if you don't want to configure the console. In this case the `KEYMAP,FONT`, `FONT_MAP`, `FONT_UNIMAP` variable has no effect. +@@ -156,6 +163,8 @@ Two different kinds of variables are used: + - type: boolean. + - description: use the file `/etc/crypttab` to decrypt an encrypted device. The file `/etc/crypttab` ***must*** exist on your system. + ++*CRYPTTAB relies on the `blkid` program from `util-linux` for device descovery.* ++ + - **FIREWALL**: + - type: string. + - valid value: iptables,ip6tables,nftables,ebtables,arptables. +@@ -212,3 +221,8 @@ Two different kinds of variables are used: + - **POPULATE_TMP**: + - type: boolean + - description: create the `/tmp/.X11-unix` and `/tmp/.ICE-unix` directories. ++ ++- **CHECK_CONFIGURATION**: ++ - type: boolean ++ - description: run configuration checks when enabling the boot@ service ++ +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0009-configure-configure-add-support-for-mdraid-add-some-.patch b/srcpkgs/boot-66serv/patches/0009-configure-configure-add-support-for-mdraid-add-some-.patch new file mode 100644 index 000000000000..d8909b459d74 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0009-configure-configure-add-support-for-mdraid-add-some-.patch @@ -0,0 +1,95 @@ +From 5ab2369393778db76a5d5e8aab439dc86af9f095 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Thu, 29 Sep 2022 19:49:14 +0300 +Subject: [PATCH 09/23] configure/configure: add support for mdraid, add some + comments. + +--- + module/boot@/configure/configure | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index eca4903..bdbccf9 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -16,28 +16,35 @@ DMRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER TMPFILE MODULE_KERNEL \ + MODULE_SYSTEM RANDOMSEED MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP CGROUPS \ + MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP" + ## sv_container_list contained keys for options that are disabled in a container +-sv_container_list="HARDWARECLOCK SETUPCONSOLE CRYPTTAB SWAP LVM DMRAID BTRFS \ ++sv_container_list="HARDWARECLOCK SETUPCONSOLE CRYPTTAB SWAP LVM DMRAID MDRAID BTRFS \ + ZFS UDEV UDEV_ADM SYSCTL FORCECHCK CGROUPS MODULE_SYSTEM RANDOMSEED MNT_NETFS" + ## sv_container_list is used by the check funtions and has the same contents as the + ## sv_container_list, minus UDEV_ADM +-sv_container_list_check="HARDWARECLOCK SETUPCONSOLE CRYPTTAB SWAP LVM DMRAID BTRFS \ ++sv_container_list_check="HARDWARECLOCK SETUPCONSOLE CRYPTTAB SWAP LVM DMRAID MDRAID BTRFS \ + ZFS UDEV SYSCTL FORCECHCK CGROUPS MODULE_SYSTEM RANDOMSEED MNT_NETFS" + ## sv_extra_list_check is used by the check functions and contains keys that need + ## to be present but are not in the previous lists + sv_extra_list_check="HOSTNAME TZ TTY KEYMAP FONT" + ++## Message functions. They use 66-yeller to provide three different levels of ++## messages for the script. ++ + die(){ ++ # Prints a fatal error message, in red color and exits the script. + fatal_error_message="$( printf '%s' "${@}" )" + 66-yeller -f "%r $fatal_error_message %n" + exit 111 + } + + warn() { ++ # Print a warning message, non-fatal, always visible in yellow color. + warn_message="$( printf '%s' "${@}" )" + 66-yeller -W "%y $warn_message %n" + } + + emit_trace() { ++ # Prints a tracing message in red, visible only when the 66-enable is ++ # invoced with a verbosity (-v) level of 3 or above. + trace_message="$( printf '%s' "${@}" )" + 66-yeller -t "%b $trace_message %n" + } +@@ -67,6 +74,7 @@ detect_fs btrfs + detect_fs zfs_member + detect_fs crypto_LUKS + detect_fs LVM2_member ++detect_fs linux_raid_member + # dmraid supports multiple TYPEs of *-raid-member devices. + # find them first and add the sum of the *_detected values to + # dmraid_detected. +@@ -98,6 +106,7 @@ detect_util luks_util cryptsetup + detect_util lvm_util lvchange + detect_util dmraid_util dmraid + detect_util swap_util swapon ++detect_util mdraid_util mdadm + + ## Check functions. + check_empty_var(){ +@@ -239,6 +248,7 @@ retrieve_sv_name(){ + SWAP) SV_REAL="mount-swap" ;; + LVM) SV_REAL="devices-lvm" ;; + DMRAID) SV_REAL="devices-dmraid" ;; ++ MDRAID) SV_REAL="devices-mdraid" ;; + BTRFS) SV_REAL="devices-btrfs" ;; + ZFS) SV_REAL="devices-zfs" ;; + UDEV) SV_REAL="udevd" ;; +@@ -344,6 +354,7 @@ if [ "${CHECK_CONFIGURATION}" = "yes" ]; then + check_volume_sanity LVM "$LVM2_member_detected" "$lvm_util_exists" lvchange + check_volume_sanity DMRAID "$dmraid_detected" "$dmraid_util_exists" dmraid + check_volume_sanity SWAP "$swap_detected" "$swap_util_exists" swapon ++ check_volume_sanity MDRAID "$mdraid_detected" "$mdraid_util_exists" mdadm + fi + + 66-yeller %benable%n service: "tty-earlier@tty12" +@@ -400,6 +411,7 @@ if [ "${LVM}" = "no" ] && \ + [ "${DMRAID}" = "no" ] && \ + [ "${BTRFS}" = "no" ] && \ + [ "${ZFS}" = "no" ] && \ ++[ "${MDRAID}" = "no" ] && \ + [ "${CRYPTTAB}" = "no" ]; then + sv_comment_real "system-Devices" + fi +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0010-service-boot-add-MDRAID-and-CHECK_CONFIGURATION-as-c.patch b/srcpkgs/boot-66serv/patches/0010-service-boot-add-MDRAID-and-CHECK_CONFIGURATION-as-c.patch new file mode 100644 index 000000000000..f562f7d15f9b --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0010-service-boot-add-MDRAID-and-CHECK_CONFIGURATION-as-c.patch @@ -0,0 +1,39 @@ +From 4e50b48615b49cdd26fc3e6d35635e0a65f6ae49 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Thu, 29 Sep 2022 19:50:01 +0300 +Subject: [PATCH 10/23] service/boot@ : add MDRAID and CHECK_CONFIGURATION as + configuration keys in the [environment] + +--- + service/boot@ | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/service/boot@ b/service/boot@ +index f08eac1..e4e2c7d 100644 +--- a/service/boot@ ++++ b/service/boot@ +@@ -102,6 +102,10 @@ + + @ZFS_IMPORT@ + ++## Activate mdraid arrays ++ ++@MDRAID@ ++ + #======================================================================= + #=================== Advanced user configuration ======================= + # +@@ -235,3 +239,10 @@ + ## Create /tmp/{.X11-unix,.ICE-unix} files + + @POPULATE_TMP@ ++ ++#========================== Configuration checks ========================== ++ ++## Check the configuration for errors ++ ++@CHECK_CONFIGURATION@ ++ +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0011-configure-more-fixes.patch b/srcpkgs/boot-66serv/patches/0011-configure-more-fixes.patch new file mode 100644 index 000000000000..e3bc6e64a958 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0011-configure-more-fixes.patch @@ -0,0 +1,79 @@ +From 814c7a07c564af50ccb52f0410d5d13d63b25206 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sat, 1 Oct 2022 12:27:55 +0300 +Subject: [PATCH 11/23] configure : more fixes... + +--- + module/boot@/configure/configure | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index bdbccf9..2116070 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -27,7 +27,8 @@ ZFS UDEV SYSCTL FORCECHCK CGROUPS MODULE_SYSTEM RANDOMSEED MNT_NETFS" + sv_extra_list_check="HOSTNAME TZ TTY KEYMAP FONT" + + ## Message functions. They use 66-yeller to provide three different levels of +-## messages for the script. ++## messages for the script. Colors are available if 66-enabled is invoked with ++## the -z option. + + die(){ + # Prints a fatal error message, in red color and exits the script. +@@ -43,7 +44,7 @@ warn() { + } + + emit_trace() { +- # Prints a tracing message in red, visible only when the 66-enable is ++ # Prints a tracing message in blue color, visible only when the 66-enable is + # invoced with a verbosity (-v) level of 3 or above. + trace_message="$( printf '%s' "${@}" )" + 66-yeller -t "%b $trace_message %n" +@@ -131,7 +132,7 @@ check_var_existance() { + + check_boolean_var_values() { + # ${1} is a list of key names +- # ${2} and ${2} are valid values for these keys ++ # ${2} and ${3} are valid values for these keys + for key in ${1} + do + eval key_value="\$${key}" +@@ -158,13 +159,14 @@ check_volume_sanity() { + eval key_value="\$${1}" + key_value="$key_value" + [ "$key_value" = "yes" ] && [ "${2}" -gt 0 ] && [ "${3}" -eq 1 ] && \ +- emit_trace "${1} is enabled and configured correctly" +- [ "${1}" = "yes" ] && [ "${2}" -eq 0 ] && warn "${1} is set to ++ emit_trace "${1} is enabled and configured correctly." ++ [ "$key_value" = "yes" ] && [ "${2}" -eq 0 ] && warn "${1} is set to + [ $key_value ] but there are no relevant volumes present. This is\ +- a non-fatal warning, you may want to check your configuration" ++ a non-fatal warning, you may want to check your configuration!" + [ "$key_value" = "yes" ] && [ "${2}" -gt 0 ] && [ "${3}" -eq 0 ] && \ +- die "${1} is set to [$key_value], relevant volumes exist but [${4}] does not exist. \ +-The process cannot continue, please check your configuration and try again" ++ die "${1} is set to [$key_value], relevant volumes exist but the [${4}] program is not ++ present in the system. \ ++The process cannot continue, please check your configuration and try again." + [ "$key_value" = "no" ] && [ "${2}" -gt 0 ] && \ + warn "${1} is set to [$key_value], but relevant volumes exist. \ + This is a non-fatal warning but you should check your configuration!" +@@ -349,12 +351,12 @@ if [ "${CHECK_CONFIGURATION}" = "yes" ]; then + check_keymap + check_consolefont + check_volume_sanity BTRFS "$btrfs_detected" "$btrfs_util_exists" btrfs +- check_volume_sanity ZFS "$zfs_detected" "$zfs_util_exists" zfs ++ check_volume_sanity ZFS "$zfs_member_detected" "$zfs_util_exists" zfs + check_volume_sanity CRYPTTAB "$crypto_LUKS_detected" "$luks_util_exists" cryptsetup + check_volume_sanity LVM "$LVM2_member_detected" "$lvm_util_exists" lvchange + check_volume_sanity DMRAID "$dmraid_detected" "$dmraid_util_exists" dmraid + check_volume_sanity SWAP "$swap_detected" "$swap_util_exists" swapon +- check_volume_sanity MDRAID "$mdraid_detected" "$mdraid_util_exists" mdadm ++ check_volume_sanity MDRAID "$linux_raid_member_detected" "$mdraid_util_exists" mdadm + fi + + 66-yeller %benable%n service: "tty-earlier@tty12" +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0012-configure-more-changes.patch b/srcpkgs/boot-66serv/patches/0012-configure-more-changes.patch new file mode 100644 index 000000000000..2a953f122c5a --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0012-configure-more-changes.patch @@ -0,0 +1,60 @@ +From 6490c41a82ce3ddab0ec88a71a2556bbc17691e7 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sat, 1 Oct 2022 14:36:31 +0300 +Subject: [PATCH 12/23] configure: more changes... + +- remove check_empty_var() and replace with check_var_existance() for +FIREWALL +- add a check for the ZFS_IMPORT values +--- + module/boot@/configure/configure | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index 2116070..ca55e78 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -110,12 +110,6 @@ detect_util swap_util swapon + detect_util mdraid_util mdadm + + ## Check functions. +-check_empty_var(){ +- name="${1}" var_value="${2}" +- if [ -z "${var_value}" ]; then +- die invalid value for variable: "${name}" +- fi +-} + + check_var_existance() { + # ${1} is a list with key names +@@ -357,6 +351,9 @@ if [ "${CHECK_CONFIGURATION}" = "yes" ]; then + check_volume_sanity DMRAID "$dmraid_detected" "$dmraid_util_exists" dmraid + check_volume_sanity SWAP "$swap_detected" "$swap_util_exists" swapon + check_volume_sanity MDRAID "$linux_raid_member_detected" "$mdraid_util_exists" mdadm ++ if [ "${ZFS}" = "yes" ]; then ++ check_boolean_var_values "ZFS_IMPORT" zpoolcache devices-zfs-import-scan ++ fi + fi + + 66-yeller %benable%n service: "tty-earlier@tty12" +@@ -399,6 +396,8 @@ if [ "${CONTAINER}" = "yes" ]; then + fi + + if [ "${ZFS}" = "yes" ]; then ++ ++ check_boolean_var_values "ZFS_IMPORT" zpoolcache devices-zfs-import-scan + if [ "${ZFS_IMPORT}" = "zpoolcache" ]; then + sv_comment_real "devices-zfs-import-scan" + else +@@ -428,7 +427,7 @@ fi + + if execl-toc -X -V FIREWALL; then + +- check_empty_var "FIREWALL" "${FIREWALL}" ++ check_var_existance "FIREWALL" + + for sv in "iptables" "ip6tables" "nftables" "ebtables" "arptables"; do + if [ "${FIREWALL}" = "${sv}" ]; then +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0013-configure-do-the-ZFS_IMPORT-check-only-with-CHECK_CO.patch b/srcpkgs/boot-66serv/patches/0013-configure-do-the-ZFS_IMPORT-check-only-with-CHECK_CO.patch new file mode 100644 index 000000000000..ef28cbf32086 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0013-configure-do-the-ZFS_IMPORT-check-only-with-CHECK_CO.patch @@ -0,0 +1,25 @@ +From 70b509e490ac28560cab383408cd9696c853ccc3 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sat, 1 Oct 2022 17:31:43 +0300 +Subject: [PATCH 13/23] configure: do the ZFS_IMPORT check only with + CHECK_CONFIGURATION=yes. + +--- + module/boot@/configure/configure | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index ca55e78..942751a 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -397,7 +397,6 @@ fi + + if [ "${ZFS}" = "yes" ]; then + +- check_boolean_var_values "ZFS_IMPORT" zpoolcache devices-zfs-import-scan + if [ "${ZFS_IMPORT}" = "zpoolcache" ]; then + sv_comment_real "devices-zfs-import-scan" + else +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0014-doc-boot-.md-and-service-boot-try-to-have-consistent.patch b/srcpkgs/boot-66serv/patches/0014-doc-boot-.md-and-service-boot-try-to-have-consistent.patch new file mode 100644 index 000000000000..5ce87b234585 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0014-doc-boot-.md-and-service-boot-try-to-have-consistent.patch @@ -0,0 +1,58 @@ +From c81a6ff10bd598399c0d0fb1ef8aa31116f0c7dc Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sat, 1 Oct 2022 17:48:14 +0300 +Subject: [PATCH 14/23] doc/boot@.md and service/boot@ : try to have consistent + naming + +- use disks/devices/filesystems/volume groups consistently +- naming is based on the output of the relevant commands and/or the +manpages +--- + service/boot@ | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/service/boot@ b/service/boot@ +index e4e2c7d..856ef38 100644 +--- a/service/boot@ ++++ b/service/boot@ +@@ -77,23 +77,23 @@ + + @FSTAB@ + +-## Active swap [yes|no]. ++## Activate swap [yes|no]. + + @SWAP@ + +-## Active lvm devices [yes|no]. ++## Activate lvm volume groups [yes|no]. + + @LVM@ + +-## Active dmraid devices [yes|no]. ++## Activate dmraid disks [yes|no]. + + @DMRAID@ + +-## Active btrfs devices [yes|no]. ++## Activate btrfs devices [yes|no]. + + @BTRFS@ + +-## Mount zfs devices [yes|no]. ++## Mount zfs filesystems [yes|no]. + + @ZFS@ + +@@ -171,7 +171,7 @@ + + #========================== Security =================================== + +-## Active encrypted devices [yes|no]. ++## Activate encrypted devices [yes|no]. + + @CRYPTTAB@ + +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0015-Makefile-configure-add-code-for-MDRAID-and-CHECK_CON.patch b/srcpkgs/boot-66serv/patches/0015-Makefile-configure-add-code-for-MDRAID-and-CHECK_CON.patch new file mode 100644 index 000000000000..ccf5763eafd9 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0015-Makefile-configure-add-code-for-MDRAID-and-CHECK_CON.patch @@ -0,0 +1,117 @@ +From a622bbb11a5c2e8893cba71d037444997970ab69 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 2 Oct 2022 10:56:29 +0300 +Subject: [PATCH 15/23] Makefile, configure: add code for MDRAID and + CHECK_CONFIGURATION. + +--- + Makefile | 4 +++- + configure | 12 ++++++++++-- + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index f137878..8303652 100644 +--- a/Makefile ++++ b/Makefile +@@ -81,6 +81,7 @@ $(DESTDIR)$(service_directory)/%: service/% + -e "s,@SWAP@,$(SWAP)," \ + -e "s,@LVM@,$(LVM)," \ + -e "s,@DMRAID@,$(DMRAID)," \ ++ -e "s,@MDRAID@,$(MDRAID)," \ + -e "s,@BTRFS@,$(BTRFS)," \ + -e "s,@ZFS@,$(ZFS)," \ + -e "s,@ZFS_IMPORT@,$(ZFS_IMPORT)," \ +@@ -98,7 +99,8 @@ $(DESTDIR)$(service_directory)/%: service/% + -e "s,@POPULATE_SYS@,$(POPULATE_SYS)," \ + -e "s,@POPULATE_DEV@,$(POPULATE_DEV)," \ + -e "s,@POPULATE_RUN@,$(POPULATE_RUN)," \ +- -e "s,@POPULATE_TMP@,$(POPULATE_TMP)," $@ ++ -e "s,@POPULATE_TMP@,$(POPULATE_TMP)," \ ++ -e "s,@CHECK_CONFIGURATION@,$(CHECK_CONFIGURATION)," $@ + + $(DESTDIR)$(datarootdir)/doc/$(package)/%.html: doc/html/%.html + $(INSTALL) -D -m 644 $< $@ && \ +diff --git a/configure b/configure +index 9622be3..75494db 100755 +--- a/configure ++++ b/configure +@@ -50,6 +50,7 @@ Fine tunning of boot configuration: + --SWAP=BOOLEAN mount swap [!no] + --LVM=BOOLEAN mount lvm devices [!no] + --DMRAID=BOOLEAN mount dmraid devices [!no] ++ --MDRAID=BOOLEAN mount mdraid devices [!no] + --BTRFS=BOOLEAN mount btrfs devices [!no] + --ZFS=BOOLEAN mount zfs devices [!no] + --ZFS_IMPORT=VALUE use scan or zpoolcache method for zfs pools importation [!zpoolcache] +@@ -68,6 +69,7 @@ Fine tunning of boot configuration: + --POPULATE_DEV=BOOLEAN populate dev directory [!yes] + --POPULATE_RUN=BOOLEAN populate run directory [!yes] + --POPULATE_TMP=BOOLEAN populate tmp directory [!yes] ++ --CHECK_CONFIGURATION=BOOLEAN enable checks on 66-enable [!yes] + + + Use yes or no with lowercase character to set BOOLEAN values. +@@ -167,6 +169,7 @@ FSTAB='!yes' + SWAP='!no' + LVM='!no' + DMRAID='!no' ++MDRAID='!no' + BTRFS='!no' + ZFS='!no' + ZFS_IMPORT='!zpoolcache' +@@ -185,6 +188,7 @@ POPULATE_SYS='!yes' + POPULATE_DEV='!yes' + POPULATE_RUN='!yes' + POPULATE_TMP='!yes' ++CHECK_CONFIGURATION='!yes' + + + for arg ; do +@@ -226,6 +230,7 @@ for arg ; do + --SWAP=*) SWAP=${arg#*=} ;; + --LVM=*) LVM=${arg#*=} ;; + --DMRAID=*) DMRAID=${arg#*=} ;; ++ --MDRAID=*) MDRAID=${arg#*=} ;; + --BTRFS=*) BTRFS=${arg#*=} ;; + --ZFS=*) ZFS=${arg#*=} ;; + --ZFS_IMPORT=*) ZFS_IMPORT=${arg#*=} ;; +@@ -244,6 +249,7 @@ for arg ; do + --POPULATE_DEV=*) POPULATE_DEV=${arg#*=} ;; + --POPULATE_RUN=*) POPULATE_RUN=${arg#*=} ;; + --POPULATE_TMP=*) POPULATE_TMP=${arg#*=} ;; ++ --CHECK_CONFIGURATION=*) CHECK_CONFIGURATION=${arg#*=} ;; + -* ) echo "$0: unknown option $arg" ;; + *=*) ;; + *) target=$arg ;; +@@ -298,10 +304,10 @@ done + for i in HOSTNAME HARDWARECLOCK TZ SETUPCONSOLE TTY \ + KEYMAP FONT FONT_MAP FONT_UNIMAP UDEV SYSCTL FORCECHCK LOCAL CONTAINER \ + TMPFILE MODULE_KERNEL MODULE_SYSTEM RANDOMSEED \ +- FSTAB SWAP LVM DMRAID BTRFS ZFS ZFS_IMPORT \ ++ FSTAB SWAP LVM DMRAID MDRAID BTRFS ZFS ZFS_IMPORT \ + CRYPTTAB FIREWALL \ + CGROUPS MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP \ +- MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP ; do ++ MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP CHECK_CONFIGURATION ; do + eval tmp=\${$i} + if testval $tmp; then + eval $i='${i}=\"\\#${i}=\"' +@@ -372,6 +378,7 @@ $FSTAB + $SWAP + $LVM + $DMRAID ++$MDRAID + $BTRFS + $ZFS + $ZFS_IMPORT +@@ -390,6 +397,7 @@ $POPULATE_SYS + $POPULATE_DEV + $POPULATE_RUN + $POPULATE_TMP ++$CHECK_CONFIGURATION + EOF + + exec 1>&3 3>&- +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0016-service-mount-mount-swap-partially-revert-previous-c.patch b/srcpkgs/boot-66serv/patches/0016-service-mount-mount-swap-partially-revert-previous-c.patch new file mode 100644 index 000000000000..da48771ae0eb --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0016-service-mount-mount-swap-partially-revert-previous-c.patch @@ -0,0 +1,28 @@ +From 6f45c4d8008227a269db000be9751affb2980268 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 2 Oct 2022 18:05:56 +0300 +Subject: [PATCH 16/23] service/mount/mount-swap: partially revert previous + change + +swapon does not fail when there is no swap partition/file, so it makes +sense to have a stricter test. +--- + module/boot@/service/mount/mount-swap | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/module/boot@/service/mount/mount-swap b/module/boot@/service/mount/mount-swap +index 3e8339a..e1d0663 100644 +--- a/module/boot@/service/mount/mount-swap ++++ b/module/boot@/service/mount/mount-swap +@@ -16,7 +16,7 @@ + swapon -a + + } +- 66-yeller -Wcdp mount-swap -1 /dev/console unable to activate the swap! ++ 66-yeller -fcdp mount-swap -1 /dev/console unable to activate the swap! + + ) + +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0017-configure-configure-properly-disable-devices-mdraid-.patch b/srcpkgs/boot-66serv/patches/0017-configure-configure-properly-disable-devices-mdraid-.patch new file mode 100644 index 000000000000..400cb5cad8ab --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0017-configure-configure-properly-disable-devices-mdraid-.patch @@ -0,0 +1,62 @@ +From ab8029ba09e645fcf5f7e5434cbb7fa92752c937 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 2 Oct 2022 20:03:36 +0300 +Subject: [PATCH 17/23] configure/configure: properly disable devices-mdraid + when MDRAID=!no. + +Also fix language on system-Devices and devices-mdraid. +--- + module/boot@/configure/configure | 4 ++-- + module/boot@/service/system/devices/devices-mdraid | 2 +- + module/boot@/service/system/system-Devices | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index 942751a..7ec11bf 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -12,7 +12,7 @@ SV_REAL= + + ## sv_boolean_list contain keys that take yes or no as values + sv_boolean_list="CRYPTTAB SETUPCONSOLE FSTAB SWAP LVM \ +-DMRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER TMPFILE MODULE_KERNEL \ ++DMRAID MDRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER TMPFILE MODULE_KERNEL \ + MODULE_SYSTEM RANDOMSEED MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP CGROUPS \ + MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP" + ## sv_container_list contained keys for options that are disabled in a container +@@ -374,7 +374,7 @@ done + + comment_udev() { + for sv in "udevd" "udevadm" "system-fontnkey" "devices-crypttab" \ +- "devices-dmraid" "devices-btrfs" "devices-lvm" ; do ++ "devices-dmraid" "devices-mdraid" "devices-btrfs" "devices-lvm" ; do + sv_comment_real ${sv} + done + } +diff --git a/module/boot@/service/system/devices/devices-mdraid b/module/boot@/service/system/devices/devices-mdraid +index d331c52..09eeaba 100644 +--- a/module/boot@/service/system/devices/devices-mdraid ++++ b/module/boot@/service/system/devices/devices-mdraid +@@ -18,5 +18,5 @@ + } + 66-yeller -fcdp devices-mdraid -1 /dev/console crashed! } + +- 66-yeller -cdp device-mdraid -1 /dev/console no mdraid volumes available! ++ 66-yeller -cdp device-mdraid -1 /dev/console no mdraid arrays available! + ) +diff --git a/module/boot@/service/system/system-Devices b/module/boot@/service/system/system-Devices +index de10e56..5fd25ee 100644 +--- a/module/boot@/service/system/system-Devices ++++ b/module/boot@/service/system/system-Devices +@@ -1,7 +1,7 @@ + [main] + @type = bundle + @version = @vers@ +-@description = "Active specific devices" ++@description = "Activate specific devices" + @user = ( root ) + @contents = + ( +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0018-configure-configure-add-a-message-and-a-small-sleep-.patch b/srcpkgs/boot-66serv/patches/0018-configure-configure-add-a-message-and-a-small-sleep-.patch new file mode 100644 index 000000000000..1803ee8ed0b8 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0018-configure-configure-add-a-message-and-a-small-sleep-.patch @@ -0,0 +1,50 @@ +From 089b28b9aa2af51a8bebdb642ceb43d23c416491 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Mon, 3 Oct 2022 20:59:16 +0300 +Subject: [PATCH 18/23] configure/configure: add a message and a small sleep to + give the user the opportunity to actually see the warnings. + +--- + module/boot@/configure/configure | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index 7ec11bf..ffa965b 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -40,7 +40,7 @@ die(){ + warn() { + # Print a warning message, non-fatal, always visible in yellow color. + warn_message="$( printf '%s' "${@}" )" +- 66-yeller -W "%y $warn_message %n" ++ 66-yeller -W "%y $warn_message %n" && warning_counter=$((warning_counter+1)) + } + + emit_trace() { +@@ -336,6 +336,7 @@ sv_comment_real() { + # Check the configuration if CHECK_CONFIGURATION is set to "yes" in the + # environment section/file + if [ "${CHECK_CONFIGURATION}" = "yes" ]; then ++ warning_counter=0 + check_var_existance "$sv_boolean_list" + check_var_existance "$sv_container_list_check" + check_var_existance "$sv_extra_list_check" +@@ -354,6 +355,15 @@ if [ "${CHECK_CONFIGURATION}" = "yes" ]; then + if [ "${ZFS}" = "yes" ]; then + check_boolean_var_values "ZFS_IMPORT" zpoolcache devices-zfs-import-scan + fi ++ # If there are warnings, display a message and wait for a time relative ++ # to the number of warnings. ++ if [ $warning_counter -gt 0 ]; then ++ 66-yeller %g ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %n ++ 66-yeller %g Please see above for warnings. The proccess will continue shortly... %n ++ 66-yeller %g ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %n ++ wait_timer=$((warning_counter*3)) ++ sleep "$wait_timer" ++ fi + fi + + 66-yeller %benable%n service: "tty-earlier@tty12" +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0019-doc-boot-.md-Add-information-abouts-keys-that-do-not.patch b/srcpkgs/boot-66serv/patches/0019-doc-boot-.md-Add-information-abouts-keys-that-do-not.patch new file mode 100644 index 000000000000..b77da1e59385 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0019-doc-boot-.md-Add-information-abouts-keys-that-do-not.patch @@ -0,0 +1,102 @@ +From 4a0710da34186c74e149938be32caf821766030e Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Mon, 3 Oct 2022 21:01:40 +0300 +Subject: [PATCH 19/23] doc/boot@.md: Add information abouts keys that do not + need to be present in the environment/configuration file. Also change the + devices naming. + +--- + doc/boot@.md | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/doc/boot@.md b/doc/boot@.md +index 02117bb..c26015d 100644 +--- a/doc/boot@.md ++++ b/doc/boot@.md +@@ -46,6 +46,8 @@ Two different kinds of variables are used: + + - string: depends on the variable and is defined in the following documentation. + ++Variables need to be present in the environment section/file, unless otherwise noted below. ++ + --- + + - **HOSTNAME**: +@@ -62,6 +64,7 @@ Two different kinds of variables are used: + - type: string. + - valid value: any valid name found at `/usr/share/kbd/keymaps` directory. + - description: uses the `loadkeys` program to set the keymap for the console to use. Usually a simple string like fr, us,... ++ - KEYMAP does not need to be present in the environment. + + - **FONT**: + - type: string. +@@ -72,11 +75,13 @@ Two different kinds of variables are used: + - type: string. + - valid value: any valid name found at `/usr/share/kbd/consoletrans`. + - description: uses the `setfont` program to indicate the mapping to use. Usually a simple string like 8859-1, 8859-2,... ++ - FONT_MAP does not need to be present in the environment. + + - **FONT_UNIMAP**: + - type: string. + - valid value: any valid name found at `/usr/share/kbd/unimaps`. + - description: uses the `setfont` program to indicate the unicode mapping table to use. Usually no mapping table is needed, and a Unicode mapping table is already contained in the font. ++ - FONT_UNIMAP does not need to be present in the environment. + + - **FSTAB**: + - type: boolean. +@@ -88,23 +93,23 @@ Two different kinds of variables are used: + + - **LVM**: + - type: boolean. +- - description: uses the `vgchange` program to activate LVM partitions and `cryptsetup` to open luks volumes in them. If the programs are not installed in the system, or if lvm devices are not discovered, an warning is emmited. ++ - description: uses the `vgchange` program to activate LVM volume groups and `cryptsetup` to open luks volumes in them. If the programs are not installed in the system, or if lvm devices are not discovered, a warning is emmited. + + - **DMRAID**: + - type: boolean. +- - description: uses the `dmraid` program to activate RAID devices. If the program is not installed in the system, or if dmraid devices are not discovered, a warning is emmited. ++ - description: uses the `dmraid` program to activate dmraid disks. If the program is not installed in the system, or if dmraid devices are not discovered, a warning is emmited. + + - **MDRAID**: + - type: boolean. +- - description: uses the `mdadm` program to activate software raid (mdraid) devices. If the program is not installed in the system, or if mdraid devices are not discovered, a warning is emmited. ++ - description: uses the `mdadm` program to activate software raid (mdraid) arrays. If the program is not installed in the system, or if mdraid devices are not discovered, a warning is emmited. + + - **BTRFS**: + - type: boolean. +- - description: uses the `btrfs` program to activate BTRFS partitions. If the program is not installed in the system, or if btrfs devices are not discovered, a warning is emmited. ++ - description: uses the `btrfs` program to activate BTRFS devices. If the program is not installed in the system, or if btrfs devices are not discovered, a warning is emmited. + + - **ZFS**: + - type: boolean. +- - description: uses the `zfs` program to mount ZFS partitions. If the program is not installed in the system, or if zfs devices are not discovered, a warning is emmited. ++ - description: uses the `zfs` program to mount ZFS filesystems. If the program is not installed in the system, or if zfs devices are not discovered, a warning is emmited. + + - **ZFS_IMPORT**: + - type: string. +@@ -161,7 +166,7 @@ Two different kinds of variables are used: + + - **CRYPTTAB**: + - type: boolean. +- - description: use the file `/etc/crypttab` to decrypt an encrypted device. The file `/etc/crypttab` ***must*** exist on your system. ++ - description: use the file `/etc/crypttab` to decrypt encrypted devices. The file `/etc/crypttab` ***must*** exist on your system. + + *CRYPTTAB relies on the `blkid` program from `util-linux` for device descovery.* + +@@ -169,6 +174,7 @@ Two different kinds of variables are used: + - type: string. + - valid value: iptables,ip6tables,nftables,ebtables,arptables. + - description: use the given program to set a firewall applying the corresponding configuration files. In case of iptables and ip6tables the `/etc//.rules` file ***must*** exist on your system. In other cases the `/etc/.conf` ***must*** exist on your system. ++ - FIREWALL does not need to be present in the environment. + + - **CGROUPS**: + - type: boolean. +@@ -225,4 +231,4 @@ Two different kinds of variables are used: + - **CHECK_CONFIGURATION**: + - type: boolean + - description: run configuration checks when enabling the boot@ service +- ++ - CHECK_CONFIGURATION does not need to present in the environment. If it is not, checks are disabled. +\ No newline at end of file +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0020-system-modules-modules-system-use-the-void-runit-mod.patch b/srcpkgs/boot-66serv/patches/0020-system-modules-modules-system-use-the-void-runit-mod.patch new file mode 100644 index 000000000000..21adb560c415 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0020-system-modules-modules-system-use-the-void-runit-mod.patch @@ -0,0 +1,31 @@ +From a208ed0ce8d4a879adffcb7b1c8704e1586e2499 Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 2 Oct 2022 12:17:54 +0300 +Subject: [PATCH 20/23] system/modules/modules-system: use the void-runit + modules-load script. + +--- + module/boot@/service/system/modules/modules-system | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/module/boot@/service/system/modules/modules-system b/module/boot@/service/system/modules/modules-system +index f90abea..e69f788 100644 +--- a/module/boot@/service/system/modules/modules-system ++++ b/module/boot@/service/system/modules/modules-system +@@ -12,11 +12,8 @@ + if { 66-yeller -cdp modules-system -1 /dev/console starts... } + if -nt { + +- ${SCRIPT_FILE} ++ modules-load -v + + } +- 66-yeller -fcdp modules-system -1 /dev/console crashed! ++ 66-yeller -Wcdp modules-system -1 /dev/console crashed! + ) +- +-[environment] +-SCRIPT_FILE=!@modules@/modules.sh +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0021-system-system-sysctl-use-code-from-runit-void-for-sy.patch b/srcpkgs/boot-66serv/patches/0021-system-system-sysctl-use-code-from-runit-void-for-sy.patch new file mode 100644 index 000000000000..9460e81a018b --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0021-system-system-sysctl-use-code-from-runit-void-for-sy.patch @@ -0,0 +1,29 @@ +From 7e56c1e889665ea164cd5f6c31843ff75d1b9abb Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 2 Oct 2022 12:22:12 +0300 +Subject: [PATCH 21/23] system/system-sysctl: use code from runit-void for + sysctl. + +--- + module/boot@/service/system/system-sysctl | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/module/boot@/service/system/system-sysctl b/module/boot@/service/system/system-sysctl +index cd4b48e..96de1f0 100644 +--- a/module/boot@/service/system/system-sysctl ++++ b/module/boot@/service/system/system-sysctl +@@ -12,9 +12,8 @@ + if { 66-yeller -cdp system-sysctl -1 /dev/console starts... } + if -nt { + +- if { 66-which -q sysctl } +- sysctl --system ++ /usr/share/66/script/sysctl.sh + + } +- 66-yeller -fcdp system-sysctl -1 /dev/console crashed! ++ 66-yeller -Wcdp system-sysctl -1 /dev/console crashed! + ) +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0022-populate-sys-mount-efivarfs-rw-to-follow-voidlinux-p.patch b/srcpkgs/boot-66serv/patches/0022-populate-sys-mount-efivarfs-rw-to-follow-voidlinux-p.patch new file mode 100644 index 000000000000..a1b126ef3ef6 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0022-populate-sys-mount-efivarfs-rw-to-follow-voidlinux-p.patch @@ -0,0 +1,26 @@ +From e1614cc94815e8ae24c43f0811218766b6bcbdda Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Sun, 2 Oct 2022 20:07:21 +0300 +Subject: [PATCH 22/23] populate-sys: mount efivarfs rw to follow voidlinux + policy. + +--- + module/boot@/service/mount/populate/populate-sys | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/module/boot@/service/mount/populate/populate-sys b/module/boot@/service/mount/populate/populate-sys +index c1a5ee8..2583644 100644 +--- a/module/boot@/service/mount/populate/populate-sys ++++ b/module/boot@/service/mount/populate/populate-sys +@@ -14,7 +14,7 @@ + + foreground { + if -t { grep -Fq efivarfs /proc/filesystems } +- execl-toc -tX -m /sys/firmware/efi/efivars -o noatime,nodev,noexec,nosuid,ro -t efivarfs -d efivars ++ execl-toc -tX -m /sys/firmware/efi/efivars -o noatime,nodev,noexec,nosuid,rw -t efivarfs -d efivars + } + + foreground { +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/patches/0023-Remove-tmpfiles-support.patch b/srcpkgs/boot-66serv/patches/0023-Remove-tmpfiles-support.patch new file mode 100644 index 000000000000..75ebd8e747f7 --- /dev/null +++ b/srcpkgs/boot-66serv/patches/0023-Remove-tmpfiles-support.patch @@ -0,0 +1,210 @@ +From 1bd9c340ff45b447b0fe2b150859fc9e322b430c Mon Sep 17 00:00:00 2001 +From: mobinmob +Date: Wed, 5 Oct 2022 17:57:12 +0300 +Subject: [PATCH 23/23] Remove tmpfiles support. + +--- + Makefile | 2 -- + configure | 7 +------ + doc/boot@.md | 3 --- + module/boot@/configure/configure | 3 +-- + module/boot@/service/all-Local | 1 - + module/boot@/service/local/local-dmesg | 1 - + module/boot@/service/local/local-rc | 3 +-- + module/boot@/service/local/local-tmpfiles | 23 ----------------------- + service/boot@ | 3 --- + 9 files changed, 3 insertions(+), 43 deletions(-) + delete mode 100644 module/boot@/service/local/local-tmpfiles + +diff --git a/Makefile b/Makefile +index 8303652..df010f8 100644 +--- a/Makefile ++++ b/Makefile +@@ -56,7 +56,6 @@ $(DESTDIR)$(service_directory)/%: service/% + -e "s,@script_directory@,$(script_directory)," \ + -e "s,@skel_directory@,$(skel_directory)," \ + -e "s,@livedir@,$(livedir)," \ +- -e "s,@tmpfiles_path@,$(tmpfiles)," \ + -e "s,@modules_path@,$(modules)," \ + -e "s,@VERSION@,$(version)," \ + -e "s,@HOSTNAME@,$(HOSTNAME)," \ +@@ -73,7 +72,6 @@ $(DESTDIR)$(service_directory)/%: service/% + -e "s,@FORCECHCK@,$(FORCECHCK)," \ + -e "s,@LOCAL@,$(LOCAL)," \ + -e "s,@CONTAINER@,$(CONTAINER)," \ +- -e "s,@TMPFILE@,$(TMPFILE)," \ + -e "s,@MODULE_KERNEL@,$(MODULE_KERNEL)," \ + -e "s,@MODULE_SYSTEM@,$(MODULE_SYSTEM)," \ + -e "s,@RANDOMSEED@,$(RANDOMSEED)," \ +diff --git a/configure b/configure +index 75494db..bc0145e 100755 +--- a/configure ++++ b/configure +@@ -24,7 +24,6 @@ Fine tuning of the installation directories: + --with-system-script=DIR 66 script installation directory of scripts [DATAROOTDIR/$package_macro_dir/script] + --with-sysadmin-service-conf=DIR 66 sysadmin service configuration file directory [SYSDIR/$package_macro_dir/conf] + --with-skeleton=DIR 66 skeleton files directory installation [SYSDIR/$package_macro_dir] +- --opentmpfiles-script=DIR absolute path of the opentmpfiles script [BINDIR] + --modules-script=DIR absolute path of the modules script [BINDIR] + + Fine tunning of boot configuration: +@@ -42,7 +41,6 @@ Fine tunning of boot configuration: + --FORCECHCK=BOOLEAN force a check of the filesystem [!no] + --LOCAL=BOOLEAN use rc.local scripts [!no] + --CONTAINER=BOOLEAN boot inside a container [!no] +- --TMPFILE=BOOLEAN use tmpfiles.d files [!yes] + --MODULE_KERNEL=BOOLEAN load modules kernel [!yes] + --MODULE_SYSTEM=BOOLEAN load modules from modules.d files [!yes] + --RANDOMSEED=BOOLEAN set random seed [!yes] +@@ -161,7 +159,6 @@ SYSCTL='!yes' + FORCECHCK='!no' + LOCAL='!no' + CONTAINER='!no' +-TMPFILE='!yes' + MODULE_KERNEL='!yes' + MODULE_SYSTEM='!yes' + RANDOMSEED='!yes' +@@ -222,7 +219,6 @@ for arg ; do + --FORCECHCK=*) FORCECHCK=${arg#*=} ;; + --LOCAL=*) LOCAL=${arg#*=} ;; + --CONTAINER=*) CONTAINER=${arg#*=} ;; +- --TMPFILE=*) TMPFILE=${arg#*=} ;; + --MODULE_KERNEL=*) MODULE_KERNEL=${arg#*=} ;; + --MODULE_SYSTEM=*) MODULE_SYSTEM=${arg#*=} ;; + --RANDOMSEED=*) RANDOMSEED=${arg#*=} ;; +@@ -303,7 +299,7 @@ done + + for i in HOSTNAME HARDWARECLOCK TZ SETUPCONSOLE TTY \ + KEYMAP FONT FONT_MAP FONT_UNIMAP UDEV SYSCTL FORCECHCK LOCAL CONTAINER \ +- TMPFILE MODULE_KERNEL MODULE_SYSTEM RANDOMSEED \ ++ MODULE_KERNEL MODULE_SYSTEM RANDOMSEED \ + FSTAB SWAP LVM DMRAID MDRAID BTRFS ZFS ZFS_IMPORT \ + CRYPTTAB FIREWALL \ + CGROUPS MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP \ +@@ -370,7 +366,6 @@ $SYSCTL + $FORCECHCK + $LOCAL + $CONTAINER +-$TMPFILE + $MODULE_KERNEL + $MODULE_SYSTEM + $RANDOMSEED +diff --git a/doc/boot@.md b/doc/boot@.md +index c26015d..917096f 100644 +--- a/doc/boot@.md ++++ b/doc/boot@.md +@@ -148,9 +148,6 @@ Variables need to be present in the environment section/file, unless otherwise n + - type: boolean. + - description: convenient variable used to boot inside a container. Some services will not work or be unnecessary when you boot inside a container. This variable provides you a safe default for this purpose. If set to yes the `HARDWARECLOCK`, `SETUPCONSOLE`, `KEYMAP`, `FONT`, `FONT_MAP`, `FONT_UNIMAP`, `CRYPTTAB`, `SWAP`, `LVM`, `DMRAID`, `BTRFS`, `ZFS`, `UDEV`, `SYSCTL`, `FORCECHCK`, `CGROUPS`, `MODULE_SYSTEM`, `RANDOMSEED`, `MNT_NETFS` variables have no effect. + +-- **TMPFILES**: +- - type: boolean. +- - description: read, parse and apply a systemd-style tmpfiles.d files usually found at `/usr/lib/tmpfiles.d` directory to handle volatile and temporary files. + + - **MODULE_KERNEL**: + - type: boolean. +diff --git a/module/boot@/configure/configure b/module/boot@/configure/configure +index ffa965b..3293794 100755 +--- a/module/boot@/configure/configure ++++ b/module/boot@/configure/configure +@@ -12,7 +12,7 @@ SV_REAL= + + ## sv_boolean_list contain keys that take yes or no as values + sv_boolean_list="CRYPTTAB SETUPCONSOLE FSTAB SWAP LVM \ +-DMRAID MDRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER TMPFILE MODULE_KERNEL \ ++DMRAID MDRAID BTRFS ZFS UDEV SYSCTL LOCAL CONTAINER MODULE_KERNEL \ + MODULE_SYSTEM RANDOMSEED MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP CGROUPS \ + MNT_PTS MNT_SHM MNT_NETFS POPULATE_SYS POPULATE_DEV POPULATE_RUN POPULATE_TMP" + ## sv_container_list contained keys for options that are disabled in a container +@@ -251,7 +251,6 @@ retrieve_sv_name(){ + SYSCTL) SV_REAL="system-sysctl" ;; + FORCECHCK) SV_REAL="system-fsck" ;; + LOCAL) SV_REAL="local-rc" ;; +- TMPFILE) SV_REAL="local-tmpfiles" ;; + MODULE_KERNEL) SV_REAL="modules-kernel" ;; + MODULE_SYSTEM) SV_REAL="modules-system" ;; + RANDOMSEED) SV_REAL="system-random" ;; +diff --git a/module/boot@/service/all-Local b/module/boot@/service/all-Local +index 95a2a1b..2e08187 100644 +--- a/module/boot@/service/all-Local ++++ b/module/boot@/service/all-Local +@@ -17,7 +17,6 @@ local-loop + local-sethostname + local-time + local-authfiles +-local-tmpfiles + local-rc + local-dmesg + ) +diff --git a/module/boot@/service/local/local-dmesg b/module/boot@/service/local/local-dmesg +index fe38ef4..ed87f7e 100644 +--- a/module/boot@/service/local/local-dmesg ++++ b/module/boot@/service/local/local-dmesg +@@ -13,7 +13,6 @@ local-arptables + local-loop + local-sethostname + local-time +-local-tmpfiles + local-authfiles + local-rc ) + @user = ( root ) +diff --git a/module/boot@/service/local/local-rc b/module/boot@/service/local/local-rc +index 7890b73..254b0c1 100644 +--- a/module/boot@/service/local/local-rc ++++ b/module/boot@/service/local/local-rc +@@ -13,8 +13,7 @@ + local-arptables + local-loop + local-time +- local-authfiles +- local-tmpfiles ) ++ local-authfiles ) + + [start] + @execute = +diff --git a/module/boot@/service/local/local-tmpfiles b/module/boot@/service/local/local-tmpfiles +deleted file mode 100644 +index 344e02d..0000000 +--- a/module/boot@/service/local/local-tmpfiles ++++ /dev/null +@@ -1,23 +0,0 @@ +-[main] +-@type = oneshot +-@version = @vers@ +-@description = "Create temporary files" +-@depends = ( mount-rw ) +-@user = ( root ) +-@options = ( !log ) +- +-[start] +-@execute = +-( +- if { 66-yeller -cdp local-tmpfiles -1 /dev/console starts... } +- if -nt { +- +- execl-cmdline -s { ${SCRIPT_FILE} ${SCRIPT_ARGS} } +- +- } +- 66-yeller -Fcdp local-tmpfiles -1 /dev/console something went wrong! +-) +- +-[environment] +-SCRIPT_FILE=!@tmpfiles@/opentmpfiles.sh +-SCRIPT_ARGS=!--create --verbose --boot +diff --git a/service/boot@ b/service/boot@ +index 856ef38..8222abb 100644 +--- a/service/boot@ ++++ b/service/boot@ +@@ -153,9 +153,6 @@ + + @CONTAINER@ + +-## Apply tmpfiles.d configuration file [yes|no]. +- +-@TMPFILE@ + + ## Load kernel modules [yes|no]. + +-- +2.38.0 + diff --git a/srcpkgs/boot-66serv/template b/srcpkgs/boot-66serv/template new file mode 100755 index 000000000000..be9b2833f11a --- /dev/null +++ b/srcpkgs/boot-66serv/template @@ -0,0 +1,61 @@ +# Template file for 'boot-66serv' +pkgname=boot-66serv +version=2.4.1 +revision=1 +#_upstr_version=2.4.1 +#wrksrc=${pkgname}-v${_upstr_version} +wrksrc=${pkgname}-v${version} +build_style=gnu-configure +configure_args="--HOSTNAME=!voidlinux --TTY=!4 + --KEYMAP=!us --TZ=!Europe/Madrid" +make_install_target="install install-man install-html" +hostmakedepends="lowdown" +makedepends="file" +depends="s6-linux-utils s6-portable-utils 66 66-tools virtual?awk" +short_desc="Stage 1 boot for 66" +maintainer="mobinmob " +# Upstream project is licensed under 0BSD from v2.4.1 onwards. +# The 66boot-* utilities are under BSD-2-Clause. +license="0BSD, BSD-2-Clause" +homepage="https://git.obarun.org/obmods/boot-66serv" +conf_files="/etc/66/rc.local" +#distfiles="https://git.obarun.org/obmods/boot-66serv/-/archive/v${_upstr_version}/boot-66serv-v${_upstr_version}.tar.bz2" +distfiles="https://git.obarun.org/obmods/boot-66serv/-/archive/v${version}/boot-66serv-v${version}.tar.bz2" +checksum=3f6b7437451a1ca20820fa75d42e0165d88e2ec722fcfad1276f276a97c46a7c +patch_args=" -Np1" +make_dirs="/etc/runit/runsvdir/66 0750 root root" + +post_install() { + + # Install the switch-initutils core service for runit. + vinstall "${FILESDIR}"/switch-initutils 644 etc/runit/core-services 99-switch-initutils.sh + # Install the 66 wrapper for 66-boot + vbin "${FILESDIR}"/66 + # Install the 66boot-initial-setup utility + vbin "${FILESDIR}"/66boot-initial-setup + # Install the 66boot-rcdotconf utility + vbin "${FILESDIR}"/66boot-rcdotconf + # Install the 66boot-storage-autoconf utility + vbin "${FILESDIR}"/66boot-storage-autoconf + # Create symlink for the boot@system service configuration file + ln -s ../etc/66/conf/boot@system/version/boot@system "${DESTDIR}/etc/66rc.conf" + + # Install runit, runit-wrapsv@ and switch-initutils services for 66 + # @version should be incremented only when there is a change in the specific + # frontend service file. + vinstall "${FILESDIR}"/runit 644 usr/share/66/service/ + vsed -i "s/@VERSION@/0.0.1/" "${DESTDIR}/usr/share/66/service/runit" + vinstall "${FILESDIR}"/switch-initutils-66 644 usr/share/66/service/ switch-initutils + vsed -i "s/@VERSION@/0.0.3/" "${DESTDIR}/usr/share/66/service/switch-initutils" + vinstall "${FILESDIR}"/runit-wrapsv@ 644 usr/share/66/service/ + vsed -i "s/@VERSION@/0.0.1/" "${DESTDIR}/usr/share/66/service/runit-wrapsv@" + + # Install sysctl.sh in /usr/share/66/script/ + vinstall "${FILESDIR}"/sysctl.sh 755 usr/share/66/script/ + + # Install backwards compatibility symlink for modules.sh + ln -s /usr/bin/modules-load ${DESTDIR}/usr/share/66/script/modules.sh + + # Install license file + vlicense LICENSE +} From 4853387aa46ecbb0530db2d8ca2c988b58be17d6 Mon Sep 17 00:00:00 2001 From: mobinmob Date: Sun, 16 Oct 2022 16:17:25 +0300 Subject: [PATCH 2/5] New package: void-66-services-0.0.2 --- srcpkgs/void-66-services/template | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 srcpkgs/void-66-services/template diff --git a/srcpkgs/void-66-services/template b/srcpkgs/void-66-services/template new file mode 100644 index 000000000000..343809e845e4 --- /dev/null +++ b/srcpkgs/void-66-services/template @@ -0,0 +1,19 @@ +# Template file for 'void-66-services' +pkgname=void-66-services +version=0.0.2 +revision=1 +depends="66" +short_desc="66 service frontend files for voidlinux" +maintainer="mobinmob " +license="BSD-2-Clause" +homepage="https://github.com/mobinmob/void-66-services/" +distfiles="https://github.com/mobinmob/void-66-services/archive/v${version}.tar.gz" +checksum=020b3a2cc5c1bafa7328a5d2db7be8baf08ecef8d4a9c8440c78c3db7f342678 + +do_install() { + vmkdir usr + vcopy usr / + chmod +x "${DESTDIR}/usr/share/66/service/dbus/data/check" + vlicense LICENSE + vlicense AUTHORS +} From 307a76f0c099881e73969f7f50335c080d250026 Mon Sep 17 00:00:00 2001 From: mobinmob Date: Sun, 16 Oct 2022 16:17:36 +0300 Subject: [PATCH 3/5] New package: scandir-66serv-0.3.1 --- srcpkgs/scandir-66serv/template | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 srcpkgs/scandir-66serv/template diff --git a/srcpkgs/scandir-66serv/template b/srcpkgs/scandir-66serv/template new file mode 100644 index 000000000000..a064a1c9b962 --- /dev/null +++ b/srcpkgs/scandir-66serv/template @@ -0,0 +1,17 @@ +# Template file for 'scandir-66serv' +pkgname=scandir-66serv +version=0.3.1 +revision=1 +wrksrc="${pkgname}-v${version}" +build_style=configure +depends="66 66-tools" +short_desc="66 module that enables user services" +maintainer="mobinmob " +license="ISC" +homepage="https://framagit.org/pkg/obmods/scandir-66serv" +distfiles="https://framagit.org/pkg/obmods/scandir-66serv/-/archive/v${version}/scandir-66serv-v${version}.tar.bz2" +checksum=2a5bb9ff80f7bf8e6caaccd243eb1f077a4e7ef12314aeca539673fbc92b9756 + +post_install() { + vlicense LICENSE +} From 484c6fba54e2e9bc27b071d84581460dde6305f7 Mon Sep 17 00:00:00 2001 From: mobinmob Date: Sun, 16 Oct 2022 16:17:48 +0300 Subject: [PATCH 4/5] New package: 66-void-20220424 --- srcpkgs/66-void/files/hostname | 1 + srcpkgs/66-void/files/locale.conf | 2 + srcpkgs/66-void/files/os-release | 4 + .../0001-Makefile-adapt-for-66-void.patch | 73 +++++++++++++++++++ srcpkgs/66-void/template | 44 +++++++++++ 5 files changed, 124 insertions(+) create mode 100644 srcpkgs/66-void/files/hostname create mode 100644 srcpkgs/66-void/files/locale.conf create mode 100644 srcpkgs/66-void/files/os-release create mode 100644 srcpkgs/66-void/patches/0001-Makefile-adapt-for-66-void.patch create mode 100644 srcpkgs/66-void/template diff --git a/srcpkgs/66-void/files/hostname b/srcpkgs/66-void/files/hostname new file mode 100644 index 000000000000..916d471cd4c9 --- /dev/null +++ b/srcpkgs/66-void/files/hostname @@ -0,0 +1 @@ +void-live diff --git a/srcpkgs/66-void/files/locale.conf b/srcpkgs/66-void/files/locale.conf new file mode 100644 index 000000000000..abfaa52b3b93 --- /dev/null +++ b/srcpkgs/66-void/files/locale.conf @@ -0,0 +1,2 @@ +LANG=en_US.UTF-8 +LC_COLLATE=C diff --git a/srcpkgs/66-void/files/os-release b/srcpkgs/66-void/files/os-release new file mode 100644 index 000000000000..12dcabd1f3e6 --- /dev/null +++ b/srcpkgs/66-void/files/os-release @@ -0,0 +1,4 @@ +NAME="void" +ID="void" +DISTRIB_ID="void" +PRETTY_NAME="void" diff --git a/srcpkgs/66-void/patches/0001-Makefile-adapt-for-66-void.patch b/srcpkgs/66-void/patches/0001-Makefile-adapt-for-66-void.patch new file mode 100644 index 000000000000..58de3adb8d2f --- /dev/null +++ b/srcpkgs/66-void/patches/0001-Makefile-adapt-for-66-void.patch @@ -0,0 +1,73 @@ +From b2d94d4a2505ab2b6f07b96e9373331f64489a0c Mon Sep 17 00:00:00 2001 +From: mobinmob +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 + diff --git a/srcpkgs/66-void/template b/srcpkgs/66-void/template new file mode 100644 index 000000000000..ceb9c44191cb --- /dev/null +++ b/srcpkgs/66-void/template @@ -0,0 +1,44 @@ +# 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=20220424 +revision=1 +# This the the last commit hash at this time. +_void_runit_version=28f849335eed5db4787d3b7dc342dd4066b7183f +wrksrc="void-runit-${_void_runit_version}" +build_style=gnu-makefile +short_desc="Void Linux base package, adapted for 66" +maintainer="mobinmob " +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=43654b6c9428cd1d2ab1fc71f5af986be3f09b947b37548115ab2376a9b574e1 +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}/os-release + 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 +} From 2569142f2e0392327cbc62a1b1dc0ad71d0f5b17 Mon Sep 17 00:00:00 2001 From: mobinmob Date: Sun, 16 Oct 2022 16:18:00 +0300 Subject: [PATCH 5/5] New package: base-system-66-0.114 --- srcpkgs/base-system-66/template | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 srcpkgs/base-system-66/template diff --git a/srcpkgs/base-system-66/template b/srcpkgs/base-system-66/template new file mode 100644 index 000000000000..313a528edee4 --- /dev/null +++ b/srcpkgs/base-system-66/template @@ -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 " +# A minor modification of the base-system template +# maintained by Enno Boland +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