All rights reserved.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
./usr/share/doc/boot-66serv/boot@.html 000644 000000 000000 00000034176 14367774543 016125 0 ustar 00 000000 000000
The 66 Suite: boot@-66serv
boot@ service
The boot@ instantiated service is a portable set of services to boot a machine in conjunction with the 66 API.
How to enable
Like any other instantiated service to enable it you need to specify the target of the service. The target can be a random name.
This is a specific service that handles the boot sequence of a machine, it is usually enabled on a tree build especially for it and contains only this service.
For example:
# 66-tree -n boot
# 66-enable -t boot boot@system
The name of the tree need to match the name set at your TREE=
key=value pair defined in the /etc/66/init.conf
file.
Do not mark this tree enabled with the 66-tree -E
option. The 66-init will take care of this special tree and start it automatically.
Refer to the 66-tree and 66-enable for further information on these tools.
This service is declared as a module
service and comes with its own configuration file.
The configuration file can be seen and edited easily using the 66-env tool:
# 66-env boot@system
When you are done editing this file, you need to reenable the service to have changes applied by using the -F option:
# 66-enable -t boot -F boot@system
Configuration file key=value pair explanation
Two different kinds of variables are used:
boolean: accepts yes
or no
as the only valid values, and nothing else.
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:
- type: string.
- valid value: anything you want.
- description: informs the kernel of the hostname to use and sets the /etc/hostname file with the value declared.
TZ (TimeZone):
- type: string.
- valid value: any valid name found at /usr/share/zoneinfo.
- description: creates a symlink at
/etc/localtime
pointing to the /usr/share/zoneinfo
directory definition. Usually the value contains a slash like Pacific/Noumea, America/New_york,…
KEYMAP:
- 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.
- valid value: any valid name found at
/usr/share/kbd/consolefonts
.
- description: uses the
setfont
program to set the font for the console to use. Usually a simple string like lat9w-16, alt-8x14,…
FONT_MAP:
- 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.
- description: uses the
mount -a
command to mount each filesystem set at /etc/fstab
.
SWAP:
- type: boolean.
- description: uses the
swapon -a
command to activate your swap partitions/files.
LVM:
- type: boolean.
- 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 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) 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 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 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.
- 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.
HARDWARECLOCK:
- type: string.
- valid value: UTC or locatime.
- description: Restore the system clock to the given timezone set at
TZ
variable and set the hardware clock with timescale given (A.K.A. UTC or localtime).
UDEV:
- type: boolean.
- description: use the udev program to detect the devices e.g. network card, external hard drive, …. If it’s set to no the
SETUPCONSOLE
, KEYMAP
, FONT
, FONT_MAP
, FONT_UNIMAP
, CRYPTTAB
, DMRAID
, BTRFS
, LVM
variable has no effect.
SYSCTL:
- type: boolean.
- description: use the sysctl program to change the kernel parameters at runtime. The
/etc/sysctl.conf
must exist on your system and be correctly written.
FORCECHCK:
- type: boolean.
- description: force the check of all mounted file systems.
LOCAL:
- type: boolean.
- description: use the
/etc/66/rc.local
script. This script is launched at the end of the boot procedure. The file must exist on your system and be set as executable, with correct definition of the shebang at the start of the script.
CONTAINER:
- 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.
MODULE_KERNEL:
- type: boolean.
- description: load the kernel modules returned by the
kmod static-nodes
command.
MODULE_SYSTEM:
- type: boolean.
- description: read, parse and load the modules found at
/etc/modules-load.d
, /run/modules-load.d
, /usr/lib/modules-load.d
.
RANDOMSEED:
- type: boolean.
- description: generates random numbers and saves them in
/var/lib/random-seed
if it doesn’t already exist.
CRYPTTAB:
- type: boolean.
- 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.
FIREWALL:
- 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/<program>/<program>.rules
file must exist on your system. In other cases the /etc/<program>.conf
must exist on your system.
- FIREWALL does not need to be present in the environment.
CGROUPS:
- type: boolean.
- description: read and parse the
/proc/cgroups
file and mount the corresponding /sys/fs/cgroup/<groups>
directory. The /sys/fs/cgroup/unified
is also mounted.
MNT_PROC:
- type: boolean.
- description: check and mount the
/proc
directory if it is not mounted yet.
MNT_SYS:
- type: boolean.
- description: check and mount the
/sys
directory if it is not mounted yet.
MNT_DEV:
- type: boolean.
- description: check and mount the
/dev
directory if it is not mounted yet.
MNT_RUN:
- type: boolean.
- description: check and mount the
/run
directory if it is not mounted yet.
MNT_TMP:
- type: boolean.
- description: check and mount the
/tmp
directory if it is not mounted yet.
MNT_PTS:
- type: boolean.
- description: check and mount the
/dev/pts
directory if it is not mounted yet.
MNT_SHM:
- type: boolean.
- description: check and mount the
/dev/shm
directory if it is not mounted yet.
MNT_NETFS:
- type: boolean.
- description: mount all file systems with the command
mount -a -t nosysfs,nonfs,nonfs4,nosmbfs,nocifs -O no_netdev
.
POPULATE_SYS:
- type: boolean
- decription: mount the
/sys/firmware/efi/efivars
, /sys/fs/fuse/connections
, /sys/kernel/config
, /sys/kernel/debug
and /sys/kernel/security
directories.
POPULATE_DEV:
- type: boolean
- description: mount the
/dev/hugepages
and /dev/mqueue
directories.
POPULATE_RUN:
- type: boolean
- description: mount the
/run/lvm
, /run/user
and /run/lock
directories.
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
- CHECK_CONFIGURATION does not need to present in the environment. If it is not, checks are disabled.
./usr/share/66/service/switch-initutils 000644 000000 000000 00000001740 14367774543 016463 0 ustar 00 000000 000000
# 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 = 0.0.3
@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
)
./usr/share/66/service/runit-wrapsv@ 000644 000000 000000 00000000331 14367774543 015714 0 ustar 00 000000 000000 # The service takes the runit service name as @I - e.g. runit-wrapsv@cupsd
[main]
@type = classic
@version = 0.0.1
@description = "wrapper for @I runit service"
@user = ( root )
[start]
@execute = ( /etc/sv/@I/run )
./usr/share/66/service/runit 000644 000000 000000 00000001141 14367774543 014274 0 ustar 00 000000 000000 [main]
@type = classic
@version = 0.0.1
@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 ./usr/share/66/service/boot@ 000644 000000 000000 00000012125 14367774543 014202 0 ustar 00 000000 000000 [main]
@type = module
@version = 2.4.1
@description = "Set of services to boot a machine"
@user = (root)
[regex]
@infiles = (
::@bootconf@=/etc/66/conf/boot@@I/version
::@scripts@=/usr/share/66/script
::@initconf@=/etc/66/init.conf
::@skeldir@=/etc/66
::@live_dir@=/run/66
::@tmpfiles@=@tmpfiles_path@
::@modules@=/usr/bin
::@vers@=2.4.1
)
[environment]
# Copyright (c) 2015-2021 Eric Vidal
# All rights reserved.
#
# This file is part of Obarun. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution.
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
#
# System configuration file for a boot process running s6/s6-rc
# supervision suite and handled by 66 suite program.
#
# Do not use quotes or double-quotes on this file
#
# The '!' is used to not export the variable on the environment.
# If you want to keep it, remove the exclamation mark '!'.
#
#========================== WARNING ====================================
#
# Do not forget to enable again the boot@ module after editing
# this file to apply your changes at the next reboot e.g:
# 66-enable -F -t boot boot@system
#
#======================= Global Settings ===============================
## Set your HOSTNAME.
HOSTNAME=!voidlinux
## Set your timezone, available timezones can be found at /usr/share/zoneinfo.
TZ=!Europe/Madrid
## Set the number of tty(s) to start.
## 0 means no tty. Maximum is 11.
TTY=!4
## Console keymap to load, see loadkeys(8).
KEYMAP=!us
## Console font to load, see setfont(8).
FONT=!lat9w-16
## Console map to load, see setfont(8).
#FONT_MAP=
## Console unimap to load, see setfont(8).
#FONT_UNIMAP=
#========================== Devices ====================================
## Mount devices from FSTAB file [yes|no].
FSTAB=!yes
## Activate swap [yes|no].
SWAP=!no
## Activate lvm volume groups [yes|no].
LVM=!no
## Activate dmraid disks [yes|no].
DMRAID=!no
## Activate btrfs devices [yes|no].
BTRFS=!no
## Mount zfs filesystems [yes|no].
ZFS=!no
## Zpool Import method [scan|zpoolcache]
## It has no effects if ZFS is set to no or commented.
ZFS_IMPORT=!zpoolcache
## Activate mdraid arrays
MDRAID=!no
#=======================================================================
#=================== Advanced user configuration =======================
#
# If you don't know what the following variables do, you
# don't need to change them. The machine will still boot
# with the default values
#
#=======================================================================
#====================== System configuration ===========================
## Setup the console
## If set to no, KEYMAP,FONT,FONT_MAP,FONT_UNIMAP has no effects
SETUPCONSOLE=!yes
## Set RTC [UTC|localtime].
HARDWARECLOCK=UTC
## Use udev [yes|no]
## If set to no the following variables has no effects or set to no:
## SETUPCONSOLE, KEYMAP, FONT, FONT_MAP, FONT_UNIMAP, CRYPTTAB, DMRAID,
## BTRFS, LVM
UDEV=!yes
## Kernel configuration with sysctl [yes|no].
SYSCTL=!yes
## Force a check of filesystem partition [yes|no].
FORCECHCK=!no
## Use rc.local script [yes|no].
LOCAL=!no
## Boot inside a container [yes|no].
## If set to yes the following variables have no effect or are set to no:
## HARDWARECLOCK, SETUPCONSOLE, KEYMAP, FONT, FONT_MAP, FONT_UNIMAP, CRYPTTAB
## SWAP, LVM, DMRAID, BTRFS, ZFS, UDEV, SYSCTL, FORCECHCK, CGROUPS
## MODULE_SYSTEM, RANDOMSEED, MNT_NETFS
CONTAINER=!no
## Load kernel modules [yes|no].
MODULE_KERNEL=!yes
## Load modules from modules.d files
MODULE_SYSTEM=!yes
## Populate ramdom seed
RANDOMSEED=!yes
#========================== Security ===================================
## Activate encrypted devices [yes|no].
CRYPTTAB=!no
## Firewall program to use [iptables|ip6tables|nftables|ebtables|arptables]
## Comment to not use any firewall at all.
#FIREWALL=
#========================== Pseudo filesystem ==========================
## Mount cgroups [yes|no].
CGROUPS=!yes
## Mount /proc directory [yes|no].
MNT_PROC=!yes
## Mount /sys directory [yes|no].
MNT_SYS=!yes
## Mount /dev directory [yes|no].
MNT_DEV=!yes
## Mount /run directory [yes|no].
MNT_RUN=!yes
## Mount /tmp directory [yes|no].
MNT_TMP=!yes
## Mount /dev/pts directory [yes|no].
## Only valuable if MNT_DEV is set to yes.
MNT_PTS=!yes
## Mount /dev/shm directory [yes|no].
## Only valuable if MNT_DEV is set to yes.
MNT_SHM=!yes
## Mount no-network filesystem [yes|no].
## Fstype mounted is: nosysfs,nonfs,nonfs4,nosmbfs,nocifs
MNT_NETFS=!yes
## Create and mount /sys/firmware/efi/efivars, /sys/fs/fuse/connections,
## /sys/kernel/{config,debug,security} and /sys/kernel/debug/tracing
## if exist at /proc/filesystems
POPULATE_SYS=!yes
## Create and mount /dev/{hugepages,mqueue}
## if exist at /proc/filesystems
POPULATE_DEV=!yes
## Create /run/{lvm,user,lock,utmp} directories
POPULATE_RUN=!yes
## Create /tmp/{.X11-unix,.ICE-unix} files
POPULATE_TMP=!yes
#========================== Configuration checks ==========================
## Check the configuration for errors
CHECK_CONFIGURATION=!yes
./usr/share/66/script/sysctl.sh 000755 000000 000000 00000001470 14367774543 014741 0 ustar 00 000000 000000 #!/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
./usr/share/66/script/modules.sh 000777 000000 000000 00000000000 14367774543 021030 2/usr/bin/modules-load ustar 00 000000 000000 ./usr/share/66/script/crypt.awk 000755 000000 000000 00000007675 14367774543 014746 0 ustar 00 000000 000000 /^#/ || /^$/ { next }
# This file come from Void distribution (https://github.com/void-linux/void-runit/blob/master/crypt.awk)
# All credits goes to this team.
# Many thanks at them to provide this good awk program.
NF>4 { print "a valid crypttab has max 4 cols not " NF >"/dev/stderr"; next }
{
# decode the src variants
split($2, o_src, "=")
if (o_src[1] == "UUID") ("blkid -l -o device -t " $2) | getline src;
else src=o_src[1];
# no password or none is given, ask fo it
if ( NF == 2 ) {
ccmd="cryptsetup luksOpen " src " " $1;
system(ccmd);
ccmd="";
}
else if (NF == 3 ) {
dest=$1
key=$3
split($3, po, "=");
if ( po[1] == "none") ccmd="cryptsetup luksOpen " src " " dest;
else ccmd="cryptsetup luksOpen -d " key " " src" " dest;
system(ccmd);
ccmd="";
}
else {
# the option field is not empty parse the options
dest=$1
key=$3
split($4, opts, ",");
commonopts="";
swapopts="";
luksopts="";
for(i in opts) {
split(opts[i], para, "=");
par=para[1];
val=para[2];
if ( par == "readonly" || par == "read-only") commonopts=commonopts "-r ";
else if ( par == "discard" ) commonopts=commonopts "--allow-discards ";
else if ( par == "tries" ) commonopts=commonopts "-T " val " ";
else if ( par == "swap" ) makeswap="y";
else if ( par == "cipher" ) swapopts=swapopts "-c " val " ";
else if ( par == "size" ) swapopts=swapopts "-s " val " ";
else if ( par == "hash" ) swapopts=swapopts "-h " val " ";
else if ( par == "offset" ) swapopts=swapopts "-o " val " ";
else if ( par == "skip" ) swapopts=swapopts "-p " val " ";
else if ( par == "verify" ) swapopts=swapopts "-y ";
#else if ( par == "noauto" )
#else if ( par == "nofail" )
#else if ( par == "plain" )
#else if ( par == "timeout" )
#else if ( par == "tmp" )
else if ( par == "luks" ) use_luks="y";
else if ( par == "keyscript" ) {use_keyscript="y"; keyscript=val;}
else if ( par == "keyslot" || par == "key-slot" ) luksopts=luksopts "-S " val " ";
else if ( par == "keyfile-size" ) luksopts=luksopts "-l " val " ";
else if ( par == "keyfile-offset" ) luksopts=luksopts "-keyfile-offset=" val " ";
else if ( par == "header" ) luksopts=luksopts "--header=" val " ";
else {
print "option: " par " not supported " >"/dev/stderr";
makeswap="";
use_luks="";
use_keyscript="";
next;
}
}
if ( makeswap == "y" && use_luks != "y" ) {
ccmd="cryptsetup " swapopts commonopts "-d " key " create " dest " " src;
ccmd_2="mkswap /dev/mapper/" dest;
makeswap="";
use_luks="";
use_keyscript="";
system(ccmd);
system(ccmd_2);
ccmd="";
ccmd_2="";
next;
}
if ( use_luks == "y" && makeswap != "y" ){
if ( use_keyscript == "y") {
ccmd=keyscript " | cryptsetup " luksopts commonopts "luksOpen -d - " src " " dest;
use_keyscript="";
}
else {
if ( key == "none" ){
ccmd="cryptsetup " luksopts commonopts "luksOpen " src " " dest;
}
else {
ccmd="cryptsetup " luksopts commonopts "luksOpen -d " key " " src " " dest;
}
}
}
else {
print "use swap OR luks as option" >"/dev/stderr";
ccmd="";
}
makeswap="";
use_luks="";
use_keyscript="";
if ( ccmd != ""){
system(ccmd);
ccmd=""
}
}
}
./usr/share/66/module/boot@/service@/tty-rc@ 000644 000000 000000 00000000341 14367774543 017106 0 ustar 00 000000 000000 [main]
@type = longrun
@version = @vers@
@description = "Launch @I"
@user = ( root )
@options = ( !log )
@depends = ( All )
[start]
@execute = ( execl-cmdline -s { agetty ${cmd_args} @I } )
[environment]
cmd_args=!-J 38400
./usr/share/66/module/boot@/service@/tty-earlier@ 000644 000000 000000 00000000344 14367774543 020130 0 ustar 00 000000 000000 [main]
@type = classic
@version = @vers@
@description = "Launch earlier @I"
@user = ( root )
@options = ( !log )
[start]
@build = auto
@execute = ( execl-cmdline -s { agetty ${cmd_args} @I } )
[environment]
cmd_args=!-J 38400
./usr/share/66/module/boot@/service/system/udev/udevd 000644 000000 000000 00000000726 14367774543 021071 0 ustar 00 000000 000000 [main]
@type = longrun
@version = @vers@
@description = "Launch udevd daemon"
@user = ( root )
@notify = 3
@depends=( 00 modules-kernel )
[start]
@execute =
(
if { 66-yeller -cdp udevd -1 /dev/console starts... }
background -d
{
fdmove 1 3
loopwhilex -x 0
if { sleep 1 }
if { udevadm control --start-exec-queue }
66-echo
}
unexport !
fdclose 3
udevd -D
)
[logger]
@destination = @live_dir@/log/udevd
./usr/share/66/module/boot@/service/system/udev/udevadm 000644 000000 000000 00000000730 14367774543 021402 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Launch udevadm"
@user = ( root )
@depends=( udevd )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp udevadm -1 /dev/console starts... }
if -nt {
if { udevadm info --cleanup-db }
if { udevadm trigger --action=add --type=subsystems }
if { udevadm trigger --action=add --type=devices }
udevadm settle
}
66-yeller -fcdp udevadm -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/system/system-sysctl 000644 000000 000000 00000000541 14367774543 021655 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Apply sysctl configuration file"
@user = ( root )
@depends = ( 00 )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp system-sysctl -1 /dev/console starts... }
if -nt {
/usr/share/66/script/sysctl.sh
}
66-yeller -Wcdp system-sysctl -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/system/system-random 000644 000000 000000 00000001470 14367774543 021616 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Create random seed"
@user = ( root )
@depends = ( 00 )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp system-random -1 /dev/console starts... }
if -nt {
if -t { execl-toc -X -r /var/lib/random-seed }
redirfd -w 1 /dev/urandom
cat /var/lib/random-seed
}
66-yeller -fcdp system-random -1 /dev/console crashed!
)
[stop]
@execute=
(
if { 66-yeller -cdp system-random -1 /dev/console stops... }
if -nt {
umask 0077
backtick -nD "512" -- bytes {
cat /proc/sys/kernel/random/poolsize
}
importas -iu bytes bytes
dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=${bytes} status=none
}
66-yeller -fcdp system-random -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/system/system-hwclock 000644 000000 000000 00000001665 14367774543 021776 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Configure the hardware clock"
@user = ( root )
@options = ( !log )
@depends = ( 00 )
[start]
@execute =
(
if { 66-yeller -cdp system-hwclock -1 /dev/console starts... }
if -nt {
execl-envfile ${conf_file}
pipeline -d { echo ${HARDWARECLOCK} }
pipeline { tr A-Z a-z }
forstdin -- clock
importas -iu clock clock
hwclock --systz --${clock} --noadjfile
}
66-yeller -fcdp system-hwclock -1 /dev/console crashed!
)
[stop]
@execute=
(
if { 66-yeller -cdp system-hwclock -1 /dev/console stops... }
if -nt {
execl-envfile ${conf_file}
pipeline -d { echo ${HARDWARECLOCK} }
pipeline { tr A-Z a-z }
forstdin -- clock
importas -iu clock clock
hwclock --systohc --${clock}
}
66-yeller -fcdp system-hwclock -1 /dev/console crashed!
)
[environment]
conf_file=!@bootconf@
./usr/share/66/module/boot@/service/system/system-hostname 000644 000000 000000 00000000602 14367774543 022150 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Set hostname"
@user = ( root )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp system-hostname -1 /dev/console starts... }
if -nt {
execl-envfile ${conf_file}
s6-hostname ${HOSTNAME}
}
66-yeller -fcdp system-hostname -1 /dev/console crashed!
)
[environment]
conf_file=!@bootconf@
./usr/share/66/module/boot@/service/system/system-fsck 000644 000000 000000 00000001650 14367774543 021264 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Check filesystem partition"
@user = ( root )
@options = ( !log )
@depends = ( all-Mount system-Devices system-fontnkey )
[start]
@execute =
(
if { 66-yeller -cdp system-fsck -1 /dev/console starts... }
execl-envfile ${conf_file}
ifelse -X { s6-test ${FORCECHCK} = yes }
{
if { 66-yeller -cdp system-fsck -1 /dev/console FORCECHCK was asked... }
execl-cmdline -s {
pipeline { fsck -f ${cmd_args} } 66-yeller -Scdp system-fsck -1 /dev/console
}
}
foreground {
pipeline { execl-cmdline -s { fsck ${cmd_args} } } 66-yeller -Scdp system-fsck -1 /dev/console
}
importas ? ?
ifelse { test $? -gt 1 }
{
66-yeller -Wcdp system-fsck -1 /dev/console fsck reports errors -- at least system should be rebooted
}
true
)
[environment]
cmd_args=!-A -T -a noopts=_netdev
conf_file=!@bootconf@
./usr/share/66/module/boot@/service/system/system-fontnkey 000644 000000 000000 00000001224 14367774543 022170 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Set font and keymap for tty"
@user = ( root )
@options = ( !log )
@depends = ( udevadm )
[start]
@execute =
(
if { 66-yeller -cdp system-fontnkey -1 /dev/console starts... }
if -nt {
execl-envfile ${conf_file}
background
{
forbacktickx index { seq 12 }
importas -u -D "" index index
sh -c "setfont ${FONT_MAP:+-m $FONT_MAP} ${FONT_UNIMAP:+-u $FONT_UNIMAP} $FONT -C /dev/tty${index}"
}
loadkeys -q -u ${KEYMAP}
}
66-yeller -fcdp system-fontnkey -1 /dev/console crashed!
)
[environment]
conf_file=!@bootconf@
./usr/share/66/module/boot@/service/system/system-Devices 000644 000000 000000 00000000311 14367774543 021711 0 ustar 00 000000 000000 [main]
@type = bundle
@version = @vers@
@description = "Activate specific devices"
@user = ( root )
@contents =
(
devices-dmraid
devices-btrfs
devices-crypttab
devices-lvm
devices-zfs
devices-mdraid
)
./usr/share/66/module/boot@/service/system/modules/modules-system 000644 000000 000000 00000000537 14367774543 023461 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Load modules from modules-load directories"
@user = ( root )
@options = ( !log )
@depends = ( 00 )
[start]
@execute =
(
if { 66-yeller -cdp modules-system -1 /dev/console starts... }
if -nt {
modules-load -v
}
66-yeller -Wcdp modules-system -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/system/modules/modules-kernel 000644 000000 000000 00000000754 14367774543 023416 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Load kernel modules"
@user = ( root )
@depends = ( 00 )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp modules-kernel -1 /dev/console starts... }
if -nt {
pipeline -d { kmod static-nodes --format=devname }
pipeline { s6-cut -d" " -f1 }
forstdin -pd "\n" -- mod
importas -iu -D "" mod mod
modprobe $mod
}
66-yeller -fcdp modules-kernel -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/system/devices/devices-zfs-import-scan 000644 000000 000000 00000000646 14367774543 025116 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Import ZFS pools by device scanning"
@options = ( !log )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp devices-zfs-import-scan -1 /dev/console starts... }
if -nt {
execl-cmdline -s { zpool import ${cmd_args} }
}
66-yeller -fcdp devices-zfs-import-scan -1 /dev/console crashed!
)
[environment]
cmd_args=!-aN -o cachefile=none
./usr/share/66/module/boot@/service/system/devices/devices-zfs-import-cache 000644 000000 000000 00000000727 14367774543 025235 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Import ZFS pools by cache file"
@options = ( !log )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp devices-zfs-import-cache -1 /dev/console starts... }
if -nt {
execl-cmdline -s { zpool import -c ${conf_dir}/${conf_file} ${cmd_args} }
}
66-yeller -fcdp devices-zfs-import-cache -1 /dev/console crashed!
)
[environment]
conf_dir=!/etc/zfs
conf_file=!zpool.cache
cmd_args=!-aN
./usr/share/66/module/boot@/service/system/devices/devices-zfs 000644 000000 000000 00000001502 14367774543 022654 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount ZFS datasets"
@optsdepends = ( devices-zfs-import-scan devices-zfs-import-cache )
@options = ( !log )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp devices-zfs -1 /dev/console starts... }
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 {
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!!
)
[environment]
mount_args=!-a -l
share_args=!-a
./usr/share/66/module/boot@/service/system/devices/devices-mdraid 000644 000000 000000 00000001251 14367774543 023313 0 ustar 00 000000 000000 [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 arrays available!
)
./usr/share/66/module/boot@/service/system/devices/devices-lvm 000644 000000 000000 00000001272 14367774543 022654 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Activate lvm devices"
@user = ( root )
@depends = ( udevadm devices-dmraid devices-mdraid )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp devices-lvm -1 /dev/console starts... }
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 {
vgchange --sysinit -a ay
}
66-yeller -fcdp devices-lvm -1 /dev/console crashed! }
66-yeller -cdp device-lvm -1 /dev/console no lvm volumes available!
)
./usr/share/66/module/boot@/service/system/devices/devices-dmraid 000644 000000 000000 00000000764 14367774543 023323 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Active dmraid devices"
@user = ( root )
@depends = ( udevadm )
@options = ( !log )
[start]
@execute =
(
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!
)
./usr/share/66/module/boot@/service/system/devices/devices-crypttab 000644 000000 000000 00000002421 14367774543 023703 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Activate encrypted devices"
@user = ( root )
@options = ( !log )
@depends = ( udevadm devices-dmraid devices-lvm devices-mdraid )
[start]
@execute =
(
if { 66-yeller -cdp devices-crypttab -1 /dev/console starts... }
ifelse { blkid -c /dev/null --match-token=TYPE="crypto_LUKS" }
{
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 {
vgchange --sysinit -a ay
}
66-yeller -cdp devices-crypttab -1 /dev/console unable to activate LVM devices
}
}
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]
script_file=!@scripts@/crypt.awk
script_conf=!/etc/crypttab
./usr/share/66/module/boot@/service/system/devices/devices-btrfs 000644 000000 000000 00000001232 14367774543 023172 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Activate btrfs devices"
@user = ( root )
@depends = ( udevadm )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp devices-btrfs -1 /dev/console starts... }
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 {
btrfs device scan
}
66-yeller -fcdp devices-btrfs -1 /dev/console crashed! }
66-yeller -cdp device-btrfs -1 /dev/console no btrfs volumes available!
)
./usr/share/66/module/boot@/service/mount/populate/populate-tmp 000644 000000 000000 00000000622 14367774543 023110 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Populate /tmp directory"
@user = ( root )
@depends = ( mount-tmp )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp populate-tmp -1 /dev/console starts... }
if -nt {
execl-toc -d /tmp/.X11-unix -m 1777
execl-toc -X -d /tmp/.ICE-unix -m 1777
}
66-yeller -fcdp populate-tmp -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/mount/populate/populate-sys 000644 000000 000000 00000003444 14367774543 023133 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Populate /sys directory"
@user = ( root )
@depends = ( mount-proc mount-sys )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp populate-sys -1 /dev/console starts... }
if -nt {
foreground {
if -t { grep -Fq efivarfs /proc/filesystems }
execl-toc -tX -m /sys/firmware/efi/efivars -o noatime,nodev,noexec,nosuid,rw -t efivarfs -d efivars
}
foreground {
if -t { grep -Fq fusectl /proc/filesystems }
execl-toc -tX -m /sys/fs/fuse/connections -o noatime,nodev,noexec,nosuid -t fusectl -d fusectl
}
foreground {
if -t { grep -Fq configfs /proc/filesystems }
execl-toc -tX -m /sys/kernel/config -o noatime,nodev,noexec,nosuid -t configfs -d configfs
}
foreground {
if -t { grep -Fq debugfs /proc/filesystems }
execl-toc -tX -m /sys/kernel/debug -o noatime,nodev,noexec,nosuid -t debugfs -d debugfs
}
foreground {
if -t { grep -Fq securityfs /proc/filesystems }
execl-toc -tX -m /sys/kernel/security -o noatime,nodev,noexec,nosuid -t securityfs -d securityfs
}
}
66-yeller -fcdp populate-sys -1 /dev/console crashed!
)
[stop]
@execute =
(
if { 66-yeller -cdp populate-sys -1 /dev/console stops... }
if -nt {
foreground {
forx -p dir {
/sys/firmware/efi/efivars /sys/fs/fuse/connections /sys/kernel/config
/sys/kernel/debug /sys/kernel/tracing /sys/kernel/security
}
importas -ui dir dir
foreground {
execl-toc -Dt -m ${dir} umount -l ${dir}
}
}
}
66-yeller -fcdp populate-sys -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/mount/populate/populate-run 000644 000000 000000 00000001002 14367774543 023105 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Populate /run directory"
@user = ( root )
@depends = ( mount-run )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp populate-run -1 /dev/console starts... }
if -nt {
if {
forx -o 0 -p dir { lvm user lock }
importas -ui dir dir
execl-toc -X -d /run/${dir}
}
install -m0664 -o root -g utmp /dev/null /run/utmp
}
66-yeller -fcdp populate-run -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/mount/populate/populate-dev 000644 000000 000000 00000002010 14367774543 023057 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Populate /dev directory"
@user = ( root )
@depends = ( mount-dev )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp populate-dev -1 /dev/console starts... }
if -nt {
foreground {
if -t { grep -Fq hugetlbfs /proc/filesystems }
execl-toc -tX -m /dev/hugepages -o noatime,nodev,noexec,nosuid -t hugetlbfs -d hugepages
}
foreground {
if -t { grep -Fq mqueue /proc/filesystems }
execl-toc -tX -m /dev/mqueue -o noatime,nodev,noexec,nosuid -t mqueue -d mqueue
}
}
66-yeller -fcdp populate-dev -1 /dev/console crashed!
)
[stop]
@execute=
(
if { 66-yeller -cdp populate-dev -1 /dev/console stops... }
if -nt {
forx -p dir {
/dev/hugepages /dev/mqueue
}
importas -ui dir dir
foreground {
execl-toc -tD -m ${dir} umount -l ${dir}
}
}
66-yeller -fcdp populate-dev -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/mount/mount-tmp 000644 000000 000000 00000001142 14367774543 020566 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount /tmp directory"
@options = ( !log )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp mount-tmp -1 /dev/console starts... }
if -nt {
execl-cmdline -s { execl-toc -X -m /tmp ${cmd_args} }
}
66-yeller -fcdp mount-tmp -1 /dev/console crashed!
)
[stop]
@execute=
(
if { 66-yeller -cdp mount-tmp -1 /dev/console stops... }
if -nt {
execl-toc -tD -m /tmp umount -lR /tmp
}
66-yeller -fcdp mount-tmp -1 /dev/console crashed!
)
[environment]
cmd_args=!-o noatime,nodev,nosuid -t tmpfs -d tmp
./usr/share/66/module/boot@/service/mount/mount-sys 000644 000000 000000 00000000656 14367774543 020615 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount /sys directory"
@options = ( !log )
@user = ( root )
@depends = ( mount-proc )
[start]
@execute =
(
if { 66-yeller -cdp mount-sys -1 /dev/console starts... }
if -nt {
execl-cmdline -s { execl-toc -X -m /sys ${cmd_args} }
}
66-yeller -fcdp mount-sys -1 /dev/console crashed!
)
[environment]
cmd_args=!-o nosuid,noexec,nodev -t sysfs -d sys
./usr/share/66/module/boot@/service/mount/mount-swap 000644 000000 000000 00000001032 14367774543 020736 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount swap partition"
@user = ( root )
@depends=( mount-rw )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp mount-swap -1 /dev/console starts... }
if -nt {
swapon -a
}
66-yeller -fcdp mount-swap -1 /dev/console unable to activate the swap!
)
[stop]
@execute =
(
if { 66-yeller -cdp mount-swap -1 /dev/console stops... }
if -nt {
swapoff -a
}
66-yeller -Wcdp mount-swap -1 /dev/console failed!
)
./usr/share/66/module/boot@/service/mount/mount-shm 000644 000000 000000 00000001214 14367774543 020555 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount /dev/shm directory"
@options = ( !log )
@user = ( root )
@depends =( mount-dev )
[start]
@execute =
(
if { 66-yeller -cdp mount-shm -1 /dev/console starts... }
if -nt {
execl-cmdline -s { execl-toc -X -m /dev/shm ${cmd_args} }
}
66-yeller -fcdp mount-shm -1 /dev/console crashed!
)
[stop]
@execute=
(
if { 66-yeller -cdp mount-shm -1 /dev/console stops... }
if -nt {
execl-toc -tD -m /dev/shm umount -lR /dev/shm
}
66-yeller -fcdp mount-shm -1 /dev/console crashed!
)
[environment]
cmd_args=!-o mode=1777,nosuid,nodev -t tmpfs -d shm
./usr/share/66/module/boot@/service/mount/mount-rw 000644 000000 000000 00000000617 14367774543 020424 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "remount rw '/' directory"
@options = ( !log )
@user = ( root )
@depends = ( all-System )
[start]
@execute =
(
if { 66-yeller -cdp mount-rw -1 /dev/console starts... }
if -nt {
execl-cmdline -s { s6-mount ${cmd_args} }
}
66-yeller -fcdp mount-rw -1 /dev/console crashed!
)
[environment]
cmd_args=!-o remount,rw / /
./usr/share/66/module/boot@/service/mount/mount-run 000644 000000 000000 00000000627 14367774543 020601 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount /run directory"
@options = ( !log )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp mount-run -1 /dev/console starts... }
if -nt {
execl-cmdline -s { execl-toc -X -m /run ${cmd_args} }
}
66-yeller -fcdp mount-run -1 /dev/console crashed!
)
[environment]
cmd_args=!-o mode=0755,nosuid,nodev -t tmpfs -d run
./usr/share/66/module/boot@/service/mount/mount-pts 000644 000000 000000 00000001227 14367774543 020600 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount /dev/pts directory"
@options = ( !log )
@user = ( root )
@depends =( mount-dev )
[start]
@execute =
(
if { 66-yeller -cdp mount-pts -1 /dev/console starts... }
if -nt {
execl-cmdline -s { execl-toc -X -m /dev/pts ${cmd_args} }
}
66-yeller -fcdp mount-pts -1 /dev/console crashed!
)
[stop]
@execute=
(
if { 66-yeller -cdp mount-pts -1 /dev/console stops... }
if -nt {
execl-toc -tD -m /dev/pts umount -lR /dev/pts
}
66-yeller -fcdp mount-pts -1 /dev/console crashed!
)
[environment]
cmd_args=!-o mode=0620,gid=5,nosuid,noexec -t devpts -d devpts
./usr/share/66/module/boot@/service/mount/mount-proc 000644 000000 000000 00000000630 14367774543 020732 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount /proc directory"
@options = ( !log )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp mount-proc -1 /dev/console starts... }
if -nt {
execl-cmdline -s { execl-toc -X -m /proc ${cmd_args} }
}
66-yeller -fcdp mount-proc -1 /dev/console crashed!
)
[environment]
cmd_args=!-o nosuid,noexec,nodev -t proc -d proc
./usr/share/66/module/boot@/service/mount/mount-netfs 000644 000000 000000 00000000576 14367774543 021117 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount no-network filesystem"
@user = ( root )
@depends=( mount-rw )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp mount-netfs -1 /dev/console starts... }
if -nt {
mount -a -t "nosysfs,nonfs,nonfs4,nosmbfs,nocifs" -O no_netdev
}
66-yeller -fcdp mount-netfs -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/mount/mount-fstab 000644 000000 000000 00000000525 14367774543 021071 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount partition from /etc/fstab file"
@user = ( root )
@depends =( system-fsck )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp mount-fstab -1 /dev/console starts... }
if -nt {
mount -a
}
66-yeller -fcdp mount-fstab -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/mount/mount-dev 000644 000000 000000 00000000655 14367774543 020554 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Mount /dev directory"
@options = ( !log )
@user = ( root )
@depends = ( mount-sys )
[start]
@execute =
(
if { 66-yeller -cdp mount-dev -1 /dev/console starts... }
if -nt {
execl-cmdline -s { execl-toc -X -m /dev ${cmd_args} }
}
66-yeller -fcdp mount-dev -1 /dev/console crashed!
)
[environment]
cmd_args=!-o mode=0755,nosuid -t devtmpfs -d dev
./usr/share/66/module/boot@/service/mount/mount-cgroups 000644 000000 000000 00000001674 14367774543 021462 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "mount cgroups hierarchy"
@user = ( root )
@depends = ( mount-dev )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp mount-cgroups -1 /dev/console starts... }
if -nt {
execl-toc -m /sys/fs/cgroup -t tmpfs -d cgroup
execl-toc -m /sys/fs/cgroup/unified -t cgroup2 -o rw,nosuid,nodev,noexec,relatime,nsdelegate -d cgroup2
redirfd -r 0 /proc/cgroups
pipeline { s6-tail -n +2 }
pipeline { s6-cut -d"\t" -f1 }
forstdin -d"\n" -- i
importas -iu i i
execl-toc -X -m /sys/fs/cgroup/${i} -t cgroup -o rw,nosuid,nodev,noexec,relatime,${i} -d cgroup
}
66-yeller -fcdp mount-cgroups -1 /dev/console crashed!
)
[stop]
@execute=
(
if { 66-yeller -cdp mount-cgroups -1 /dev/console stops... }
if -nt {
if { umount -lR /sys/fs/cgroup }
}
66-yeller -fcdp mount-cgroups -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/mount/00 000644 000000 000000 00000000431 14367774543 017045 0 ustar 00 000000 000000 [main]
@type = bundle
@version = @vers@
@description = "Set the hostname and mount filesystem"
@user = ( root )
@contents = (
system-hostname
mount-run
populate-run
mount-tmp
populate-tmp
mount-proc
mount-sys
populate-sys
mount-dev
mount-pts
mount-shm
populate-dev
mount-cgroups
)
./usr/share/66/module/boot@/service/local/local-time 000644 000000 000000 00000000656 14367774543 020615 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Set localtime"
@options = ( !log )
@depends = ( mount-rw )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-time -1 /dev/console starts... }
if -nt {
execl-envfile ${conf_file}
s6-ln -nsf /usr/share/zoneinfo/${TZ} /etc/localtime
}
66-yeller -fcdp local-time -1 /dev/console crashed!
)
[environment]
conf_file=!@bootconf@
./usr/share/66/module/boot@/service/local/local-sethostname 000644 000000 000000 00000001055 14367774543 022203 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Set hostname on /etc/hostname file"
@options = ( !log )
@depends = ( mount-rw )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-sethostname -1 /dev/console starts... }
if -nt {
execl-envfile ${conf_file}
execl-cmdline -s {
redirfd -w 1 ${conf_file_hostname}
66-echo -- ${HOSTNAME}
}
}
66-yeller -fcdp local-sethostname -1 /dev/console crashed!
)
[environment]
conf_file=!@bootconf@
conf_file_hostname=!/etc/hostname
./usr/share/66/module/boot@/service/local/local-rc 000644 000000 000000 00000001010 14367774543 020244 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Run rc.local script"
@options = ( !log )
@user = ( root )
@depends = (
mount-rw
local-iptables
local-ip6tables
local-nftables
local-ebtables
local-arptables
local-loop
local-time
local-authfiles )
[start]
@execute =
(
if { 66-yeller -cdp local-rc -1 /dev/console starts... }
if -nt {
${script_file}
}
66-yeller -fcdp local-rc -1 /dev/console crashed!
)
[environment]
script_file=!@skeldir@/rc.local
./usr/share/66/module/boot@/service/local/local-loop 000644 000000 000000 00000000634 14367774543 020624 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Active loop devices"
@depends = (
mount-rw
local-iptables
local-ip6tables
local-nftables
local-ebtables
local-arptables )
@user = ( root )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp local-loop -1 /dev/console starts... }
if -nt {
ip link set up dev lo
}
66-yeller -fcdp local-loop -1 /dev/console crashed!
)
./usr/share/66/module/boot@/service/local/local-dmesg 000644 000000 000000 00000001135 14367774543 020747 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Save logs of dmesg"
@options = ( !log )
@depends = (
mount-rw
local-iptables
local-ip6tables
local-nftables
local-ebtables
local-arptables
local-loop
local-sethostname
local-time
local-authfiles
local-rc )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-dmesg -1 /dev/console starts... }
if -nt {
execl-cmdline -s {
redirfd -w 1 ${cmd_log}
dmesg ${cmd_args}
}
}
66-yeller -fcdp local-dmesg -1 /dev/console crashed!
)
[environment]
cmd_args=!-T
cmd_log=!/var/log/dmesg.log
./usr/share/66/module/boot@/service/local/local-authfiles 000644 000000 000000 00000001431 14367774543 021633 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Create tempory authentification files"
@depends = ( mount-rw )
@user = ( root )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp local-authfiles -1 /dev/console starts... }
if -nt {
if -t {
execl-toc -nt -e ${script_file_wtmp}
foreground {
install -m0664 -o root -g utmp /dev/null ${script_file_wtmp}
}
}
if -t {
execl-toc -nt -e ${script_file_btmp}
foreground {
install -m0600 -o root -g utmp /dev/null ${script_file_btmp}
}
}
}
66-yeller -fcdp local-authfiles -1 /dev/console crashed!
)
[environment]
script_file_wtmp=!/var/log/wtmp
script_file_btmp=!/var/log/btmp
./usr/share/66/module/boot@/service/local/firewall/local-nftables 000644 000000 000000 00000001134 14367774543 023252 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Restore nftables rules"
@depends = ( mount-rw )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-nftables -1 /dev/console starts... }
if -nt {
execl-toc -e ${script_conf}
nft -f ${script_conf}
}
66-yeller -fcdp local-nftables -1 /dev/console crashed!
)
[stop]
@execute =
(
if { 66-yeller -cdp local-nftables -1 /dev/console stops... }
if -nt {
nft flush ruleset
}
66-yeller -fcdp local-nftables -1 /dev/console crashed!
)
[environment]
script_conf=!/etc/nftables.conf
./usr/share/66/module/boot@/service/local/firewall/local-iptables 000644 000000 000000 00000001651 14367774543 023263 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Restore iptables rules"
@depends = ( mount-rw )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-iptables -1 /dev/console starts... }
if -nt {
execl-toc -e ${script_conf}
iptables-restore ${script_conf}
}
66-yeller -fcdp local-iptables -1 /dev/console crashed!
)
[stop]
@build = custom
@shebang = "/usr/bin/bash -c"
@execute =
(
exec 2>&1
66-yeller -cdp local-iptables -1 /dev/console stops...
if ! type -p iptables &>/dev/null; then
66-yeller -fcdp local-iptables -1 /dev/console unable to find iptables program
exit 111
fi
while read -r table; do
tables+=("/usr/share/iptables/empty-$table.rules")
done <"/proc/net/ip_tables_names"
if (( ${#tables[*]} )); then
cat "${tables[@]}" | iptables-restore
fi
)
[environment]
script_conf=!/etc/iptables/iptables.rules
./usr/share/66/module/boot@/service/local/firewall/local-ip6tables 000644 000000 000000 00000001316 14367774543 023347 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Restore ip6tables rules"
@depends = ( mount-rw )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-ip6tables -1 /dev/console starts... }
if -nt {
execl-toc -e ${script_conf}
ip6tables-restore ${script_conf}
}
66-yeller -fcdp local-ip6tables -1 /dev/console crashed!
)
[stop]
@execute =
(
if { 66-yeller -cdp local-ip6tables -1 /dev/console stops... }
if -nt {
execl-toc -x ${script_file}
${script_file}
}
66-yeller -fcdp local-ip6tables -1 /dev/console crashed!
)
[environment]
script_conf=!/etc/iptables/ip6tables.rules
script_file=!/usr/lib/iptables/scripts/ip6tables-flush
./usr/share/66/module/boot@/service/local/firewall/local-ebtables 000644 000000 000000 00000001145 14367774543 023237 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Restore ebtables rules"
@depends = ( mount-rw )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-ebtables -1 /dev/console starts... }
if -nt {
execl-toc -e ${script_conf}
ebtables-restore ${script_conf}
}
66-yeller -fcdp local-ebtables -1 /dev/console crashed!
)
[stop]
@execute =
(
if { 66-yeller -cdp local-ebtables -1 /dev/console stops... }
if -nt {
ebtables-restore
}
66-yeller -fcdp local-ebtables -1 /dev/console crashed!
)
[environment]
script_conf=!/etc/ebtables.conf
./usr/share/66/module/boot@/service/local/firewall/local-arptables 000644 000000 000000 00000001155 14367774543 023434 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Restore arptables rules"
@depends = ( mount-rw )
@user = ( root )
[start]
@execute =
(
if { 66-yeller -cdp local-arptables -1 /dev/console starts... }
if -nt {
execl-toc -e ${script_conf}
arptables-restore ${script_conf}
}
66-yeller -fcdp local-arptables -1 /dev/console crashed!
)
[stop]
@execute =
(
if { 66-yeller -cdp local-arptables -1 /dev/console stops... }
if -nt {
arptables-restore
}
66-yeller -fcdp local-arptables -1 /dev/console crashed!
)
[environment]
script_conf=!/etc/arptables.conf
./usr/share/66/module/boot@/service/all-System 000644 000000 000000 00000000375 14367774543 017525 0 ustar 00 000000 000000 [main]
@type = bundle
@version = @vers@
@description = "System configuration"
@user = ( root )
@contents =
(
system-hwclock
modules-kernel
system-random
modules-system
system-sysctl
udevd
udevadm
system-fontnkey
system-Devices
system-fsck
mount-fstab
)
./usr/share/66/module/boot@/service/all-Runtime 000644 000000 000000 00000002070 14367774543 017656 0 ustar 00 000000 000000 [main]
@type = oneshot
@version = @vers@
@description = "Launch all tree enabled of root user"
@user = ( root )
@depends = ( all-Mount all-System all-Local )
@options = ( !log )
[start]
@execute =
(
if { 66-yeller -cdp all-Runtime -1 /dev/console starts... }
if -nt {
execl-envfile ${conf_file}
66-all -v${VERBOSITY} -l ${LIVE} up
}
execl-envfile ${conf_file}
66-yeller -Fcdp all-Runtime -1 /dev/console crashed! -- Your machine is operational but some runtime service failed to start correctly. Please see the complete boot log at ${LIVE}/log/0/current for further information.
)
[stop]
@execute =
(
if { 66-yeller -cdp all-Runtime -1 /dev/console stops... }
if -nt {
execl-envfile ${conf_file}
66-all -v${VERBOSITY} -T ${timeout} -l ${LIVE} down
}
## use -F here, we don't want to crash to avoid to
## not bring down properly the rest of the service
66-yeller -Fcdp all-Runtime -1 /dev/console crashed!
)
[environment]
conf_file=!@initconf@
## Time to wait to bring down services
timeout=!3000
./usr/share/66/module/boot@/service/all-Mount 000644 000000 000000 00000000167 14367774543 017342 0 ustar 00 000000 000000 [main]
@type = bundle
@version = @vers@
@description = "Mount devices directories"
@user = ( root )
@contents = ( 00 )
./usr/share/66/module/boot@/service/all-Local 000644 000000 000000 00000000461 14367774543 017267 0 ustar 00 000000 000000 [main]
@type = bundle
@version = @vers@
@description = "Runtime system configuration"
@user = ( root )
@contents =
(
mount-rw
mount-swap
mount-netfs
local-iptables
local-ip6tables
local-nftables
local-ebtables
local-arptables
local-loop
local-sethostname
local-time
local-authfiles
local-rc
local-dmesg
)
./usr/share/66/module/boot@/service/All 000644 000000 000000 00000000251 14367774543 016174 0 ustar 00 000000 000000 [main]
@type = bundle
@version = @vers@
@description = "Starting point of the boot sequence"
@user = ( root )
@contents =
(
all-Mount
all-System
all-Local
all-Runtime
)
./usr/share/66/module/boot@/configure/configure 000755 000000 000000 00000037371 14367774543 020006 0 ustar 00 000000 000000 #!/usr/bin/sh
## 66-yeller variable
export PROG="${MOD_NAME}"
export VERBOSITY="${MOD_VERBOSITY}"
export CLOCK_ENABLED=0
export COLOR_ENABLED="${MOD_COLOR}"
## script variable
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 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
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 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. 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.
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" && warning_counter=$((warning_counter+1))
}
emit_trace() {
# 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"
}
## 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_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.
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
detect_util mdraid_util mdadm
## Check functions.
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 ${3} 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."
[ "$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!"
[ "$key_value" = "yes" ] && [ "${2}" -gt 0 ] && [ "${3}" -eq 0 ] && \
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!"
}
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" ;;
CRYPTTAB) SV_REAL="devices-crypttab" ;;
SETUPCONSOLE) SV_REAL="system-fontnkey" ;;
FSTAB) SV_REAL="mount-fstab" ;;
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" ;;
SYSCTL) SV_REAL="system-sysctl" ;;
FORCECHCK) SV_REAL="system-fsck" ;;
LOCAL) SV_REAL="local-rc" ;;
MODULE_KERNEL) SV_REAL="modules-kernel" ;;
MODULE_SYSTEM) SV_REAL="modules-system" ;;
RANDOMSEED) SV_REAL="system-random" ;;
MNT_PROC) SV_REAL="mount-proc" ;;
MNT_SYS) SV_REAL="mount-sys" ;;
MNT_DEV) SV_REAL="mount-dev" ;;
MNT_RUN) SV_REAL="mount-run" ;;
MNT_TMP) SV_REAL="mount-tmp" ;;
CGROUPS) SV_REAL="mount-cgroups" ;;
MNT_PTS) SV_REAL="mount-pts" ;;
MNT_SHM) SV_REAL="mount-shm" ;;
MNT_NETFS) SV_REAL="mount-netfs" ;;
POPULATE_SYS) SV_REAL="populate-sys" ;;
POPULATE_DEV) SV_REAL="populate-dev" ;;
POPULATE_RUN) SV_REAL="populate-run" ;;
POPULATE_TMP) SV_REAL="populate-tmp" ;;
TTY) SV_REAL="tty-rc@" ;;
## extra service not set by the environment section
UDEV_ADM) SV_REAL="udevadm" ;;
esac
unset sv
}
sv_uncomment_list() {
name=${1} list="$(find "${service_dir}" -mindepth 1 -type f)"
retrieve_sv_name "${name}"
66-yeller %benable%n service: "${SV_REAL}"
for sv in ${list}; do
sed -i "s:#*${SV_REAL}:${SV_REAL}:g" "${sv}" || die "unable to sed ${sv}"
done
unset list
}
sv_comment_list() {
name=${1} list="$(find "${service_dir}" -mindepth 1 -type f)"
file=
retrieve_sv_name "${name}"
66-yeller %rdisable%n service: "${SV_REAL}"
for sv in ${list}; do
sv_name=${sv##*/}
if [ "${SV_REAL}" = "${sv_name}" ];then
file="${sv}"
fi
sed -i "s:${SV_REAL}:#${SV_REAL}:g" "${sv}" || die "unable to sed ${sv}"
done
if [ -n "${file}" ];then
rm -f "${file}" || die "unable to remove ${file}"
fi
unset list
}
sv_uncomment_real() {
name=${1} list="$(find "${service_dir}" -mindepth 1 -type f)"
66-yeller %benable%n service: "${name}"
for sv in ${list}; do
sed -i "s:#*${name}:${name}:g" "${sv}" || die "unable to sed ${sv}"
done
unset list
}
sv_comment_real() {
name=${1} list="$(find "${service_dir}" -mindepth 1 -type f)"
66-yeller %rdisable%n service: "${name}"
file=
for sv in ${list}; do
sv_name=${sv##*/}
if [ "${name}" = "${sv_name}" ];then
file="${sv}"
fi
sed -i "s:${name}:#${name}:g" "${sv}" || die "unable to sed ${sv}"
done
if [ -n "${file}" ];then
rm -f "${file}" || die "unable to remove ${file}"
fi
}
# 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"
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_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 "$linux_raid_member_detected" "$mdraid_util_exists" mdadm
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"
touch "${service_dir}/tty-earlier@tty12" || die "unable to create ${service_dir}/tty-earlier@tty12"
for sv in ${sv_boolean_list}; do
if [ "${sv}" = "CONTAINER" ]; then
continue
fi
eval val="\$${sv}"
val="${val}"
if [ "${val}" = "yes" ]; then
sv_uncomment_list "${sv}"
else
sv_comment_list "${sv}"
fi
done
comment_udev() {
for sv in "udevd" "udevadm" "system-fontnkey" "devices-crypttab" \
"devices-dmraid" "devices-mdraid" "devices-btrfs" "devices-lvm" ; do
sv_comment_real ${sv}
done
}
comment_zfs() {
for sv in "devices-zfs-import-cache" "devices-zfs-import-scan"; do
sv_comment_real "${sv}"
done
}
if [ "${UDEV}" = "no" ]; then
comment_udev
fi
if [ "${CONTAINER}" = "yes" ]; then
for sv in ${sv_container_list}; do
sv_comment_list "${sv}"
done
fi
if [ "${ZFS}" = "yes" ]; then
if [ "${ZFS_IMPORT}" = "zpoolcache" ]; then
sv_comment_real "devices-zfs-import-scan"
else
# set default to scan
sv_comment_real "devices-zfs-import-cache"
fi
else
comment_zfs
fi
if [ "${LVM}" = "no" ] && \
[ "${DMRAID}" = "no" ] && \
[ "${BTRFS}" = "no" ] && \
[ "${ZFS}" = "no" ] && \
[ "${MDRAID}" = "no" ] && \
[ "${CRYPTTAB}" = "no" ]; then
sv_comment_real "system-Devices"
fi
if [ "${TTY}" -gt 0 ]; then
for i in $(seq "${TTY}"); do
[ "${i}" -lt 12 ] || break
66-yeller %benable%n service: "tty-rc@tty${i}"
touch "${service_dir}/tty-rc@tty${i}" || die "unable to create ${service_dir}/tty-rc@tty${i}"
done
fi
if execl-toc -X -V FIREWALL; then
check_var_existance "FIREWALL"
for sv in "iptables" "ip6tables" "nftables" "ebtables" "arptables"; do
if [ "${FIREWALL}" = "${sv}" ]; then
sv_uncomment_real "local-${sv}"
else
sv_comment_real "local-${sv}"
fi
done
else
for sv in "local-iptables" "local-ip6tables" "local-nftables" "local-ebtables" "local-arptables"; do
sv_comment_real "${sv}"
done
fi
66-yeller "%bsuccessfully%n configured" ./usr/bin/66boot-storage-autoconf 000755 000000 000000 00000014505 14367774543 015316 0 ustar 00 000000 000000 #!/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" ] && 66-yeller -F %r You need to run this script as root! %n && exit 1
# blkid(8) from util-linux should be available for the script to function.
[ "$(blkid -v | grep util-linux -c)" != "1" ] && \
66-yeller -F %r You need blkid from util-linux to run this program! %n && exit 1
detect_fs() {
# Uses blkid to detect partition TYPEs. The result is the number
# of detected partitions. TYPEs are available with `blkid -k`.
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
}
# devices_to_detect is a list of some device TYPEs we want to detect
devices_to_detect="btrfs zfs_member crypto_LUKS linux_raid_member LVM2_member swap"
# Use detect fs for all members of devices_to_detect we want
for key in $devices_to_detect; do detect_fs "$key" ; done
# dmraid supports multiple TYPEs of *-raid-member devices.
# find them first and add the sum of the *_detected values to
# dmraid_detected.
# dmraid_TYPEs holds the device TYPEs dmraid handles
dmraid_TYPEs="ddf_raid_member isw_raid_member lsi_mega_raid_member \
via_raid_member silicon_medley_raid_member nvidia_raid_member \
promise_fasttrack_raid_member hpt45x_raid_member hpt37x_raid_member \
adaptec_raid_member jmicron_raid_member"
for TYPE in $dmraid_TYPEs; do detect_fs "$TYPE" ; done
# 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_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
detect_util mdraid_util mdadm
# 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_member_detected" "$zfs_util_exists" ZFS ZFS zfs "[zfs]"
# shellcheck disable=SC2154
check_and_apply_conf_zpool "$zfs_member_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]"
# shellcheck disable=SC2154
check_and_apply_conf "$linux_raid_member_detected" "$mdraid_util_exists" MDRAID MDRAID mdadm "[mdadm]"
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
./usr/bin/66boot-rcdotconf 000755 000000 000000 00000005752 14367774543 014023 0 ustar 00 000000 000000 #!/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" ] && 66-yeller -F %r You need to run this script as root! %n && exit 1
HOSTNAME=
HOSTNAME1=
HARDWARECLOCK=
TIMEZONE=
KEYMAP=
FONT=
FONT_MAP=
FONT_UNIMAP=
TTYS=
apply_conf_from_to(){
# Set configuration value ${3} from ${1} to ${2}
# ${1} is the conf option from /etc/rc.conf
# ${2} is the conf option from the boot@ conf file
# ${3} is the value from the /etc/rc.conf option/var
if [ -n "${3}" ]
then
66-env -t boot -r "${2}"=!"${3}" boot@system
66-yeller %g "${2} set to [${3}]." %n
fi
}
set_hostname() {
# ${1} HOSTNAME value
[ -r /etc/hostname ] && HOSTNAME1="$( cat /etc/hostname )" && export HOSTNAME1
if [ -n "${1}" ]
then
66-env -t boot -r HOSTNAME=!"${1}" boot@system
66-yeller %g "HOSTNAME set to [${1}]." %n
elif [ -n "$HOSTNAME1" ]
then
66-env -t boot -r HOSTNAME=!"$HOSTNAME1" boot@system
66-yeller %g "HOSTNAME set to [$HOSTNAME1]." %n
elif [ -z "${1}" ] && [ -z "$HOSTNAME1" ]
then
66-env -t boot -r HOSTNAME=!void-live boot@system
66-yeller -W %b "No HOSTNAME set, reverting
to the default [void-live]." %n
fi
}
set_ttys() {
# Same positional args as apply_conf_from_to
if [ -n "${3}" ]
then
if [ "${3}" -lt 11 ] && [ "${3}" -gt 0 ]
then
apply_conf_from_to "${1}" "${2}" "${3}"
else
66-env -t boot -r TTY=!4 boot@system
66-yeller -W %b "${3} TTYS is not valid as a tty number,
reverting to the default [4]." %n
exit 1
fi
else
66-env -t boot -r TTY=!4 boot@system
66-yeller -W %b "TTY number not set, reverting
to the default [4]." %n
fi
}
check_tz() {
# On installation timezone can be set by symlink and not by the
# TIMEZONE key in rc.conf. In that case follow the symlink.
if [ "$(realpath /etc/localtime | cut -d / -f 1,2,3,4)" = "/usr/share/zoneinfo" ]; then
TIMEZONE="$(realpath /etc/localtime | cut -d / -f 5,6)"
export TIMEZONE
fi
}
# shellcheck disable=SC1091
. /etc/rc.conf
check_tz
set_hostname "$HOSTNAME"
apply_conf_from_to TIMEZONE TZ "$TIMEZONE"
apply_conf_from_to HARDWARECLOCK HARDWARECLOCK "$HARDWARECLOCK"
apply_conf_from_to KEYMAP KEYMAP "$KEYMAP"
apply_conf_from_to FONT_MAP FONT_MAP "$FONT_MAP"
apply_conf_from_to FONT FONT "$FONT"
apply_conf_from_to FONT_UNIMAP FONT_UNIMAP "$FONT_UNIMAP"
set_ttys TTYS TTY "$TTYS"
66-yeller %g "Please re-enable the boot@system service
for the changes to take effect by running (as root):
'66-enable -F -t boot boot@system' " %n ./usr/bin/66boot-initial-setup 000755 000000 000000 00000004732 14367774543 014626 0 ustar 00 000000 000000 #!/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" ] && 66-yeller -F %r You need to run this script as root! %n && exit 1
# Information for the user, in case of failure. 66 output is informative, this
# is just a pointer to the docs.
msg_trees() {
# ${1} is the name of the tree
66-yeller -W %b "An action for the [${1}] tree failed.
Check the output before this message for a possibe cause and consult
the 66-tree documentation." %n
}
msg_services() {
# ${1} is the name of a service
66-yeller -F %r "Enabling the [${1}] service failed.
Check the output before this message for a possibe cause and consult
the 66-enable documentation." %n
exit 1
}
# Create the mandatory boot tree.
66-tree -nz boot || msg_trees boot
# Enable the boot@system service in the boot tree.
66-enable -z -F -t boot boot@system || msg_services boot@system
# Copy the default boot@conf so that it will survive updates and be accesible
# though /etc/66rc.conf. Also, remove the warning in the first lines of the file.
new_conf="/etc/66/conf/boot@system/version/boot@system"
[ ! -f "$new_conf" ] && cp /etc/66/conf/boot@system/version/.boot@system "$new_conf" && \
warn=$( sed -n -e "/##\ \[STARTWARN\]/p" /etc/66rc.conf | tr -d '[:space:]') && \
[ "$warn" = "##[STARTWARN]" ] && sed -i '1,5d' "$new_conf"
# Create default tree, enable it and make it current.
66-tree -z -nEc default || msg_trees default
# Enable switch-initutils oneshot service in the default tree.
66-enable -z switch-initutils || msg_services switch-initutils
# Create and enable runit tree.
66-tree -z -nE runit || msg_trees runit
# Enable the runit service in the runit tree.
66-enable -z -t runit runit || msg_services runit
# Start runit tree after the default tree.
66-tree -z -S default runit || msg_trees runit
# Print on succesfull completion
# shellcheck disable=SC2181
if [ "$?" = 0 ]; then 66-yeller %g "Basic trees created and services enabled succesfully!"; fi
./usr/bin/66 000755 000000 000000 00000000073 14367774543 011147 0 ustar 00 000000 000000 #!/usr/bin/execlineb -P
66-boot -b "Booting Void Linux" -m
./etc/runit/core-services/99-switch-initutils.sh 000644 000000 000000 00000001031 14367774543 020203 0 ustar 00 000000 000000 # 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
./etc/66rc.conf 000777 000000 000000 00000000000 14367774543 022202 2../etc/66/conf/boot@system/version/boot@system ustar 00 000000 000000 ./etc/66/rc.local 000755 000000 000000 00000001147 14367774543 012041 0 ustar 00 000000 000000 # Copyright (c) 2015-2021 Eric Vidal
# All rights reserved.
#
# This file is part of Obarun. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution.
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
#
# Default rc.local for Obarun; add your custom commands here.
#
# This is run at the end of the boot sequence.
# This file is declared as oneshot service on 66, do not try to launch
# any daemon with this file.
# WARNING: Do not forget to set the shebang.