Browse Source

pass to module type

2.3.1
obarun 2 years ago
parent
commit
ae9cccf18f
  1. 2
      .gitignore
  2. 2
      AUTHORS
  3. 26
      INSTALL
  4. 2
      LICENSE
  5. 69
      Makefile
  6. 281
      configure
  7. 191
      module/boot@/.configure/configure
  8. 0
      module/boot@/.configure/crypt.awk
  9. 82
      module/boot@/.configure/modules.sh
  10. 10
      module/boot@/.configure/rc.local
  11. 2
      module/boot@/.configure/tmpfiles.sh
  12. 1
      module/boot@/All
  13. 3
      module/boot@/all-Local
  14. 9
      module/boot@/all-Mount
  15. 3
      module/boot@/all-Runtime
  16. 1
      module/boot@/all-System
  17. 1
      module/boot@/earlier-service/tty12
  18. 1
      module/boot@/local/local-authfiles
  19. 1
      module/boot@/local/local-dmesg
  20. 32
      module/boot@/local/local-ip6tables
  21. 33
      module/boot@/local/local-iptables
  22. 1
      module/boot@/local/local-loop
  23. 28
      module/boot@/local/local-rc
  24. 3
      module/boot@/local/local-sethostname
  25. 3
      module/boot@/local/local-time
  26. 5
      module/boot@/local/local-tmpfiles
  27. 2
      module/boot@/mount/00
  28. 15
      module/boot@/mount/mount-cgroups
  29. 1
      module/boot@/mount/mount-dev
  30. 3
      module/boot@/mount/mount-fstab
  31. 15
      module/boot@/mount/mount-netfs
  32. 1
      module/boot@/mount/mount-proc
  33. 1
      module/boot@/mount/mount-pts
  34. 1
      module/boot@/mount/mount-run
  35. 1
      module/boot@/mount/mount-rw
  36. 1
      module/boot@/mount/mount-shm
  37. 24
      module/boot@/mount/mount-swap
  38. 1
      module/boot@/mount/mount-sys
  39. 1
      module/boot@/mount/mount-tmp
  40. 1
      module/boot@/mount/populate/populate-dev
  41. 1
      module/boot@/mount/populate/populate-run
  42. 1
      module/boot@/mount/populate/populate-sys
  43. 1
      module/boot@/mount/populate/populate-tmp
  44. 15
      module/boot@/system/devices/devices-btrfs
  45. 16
      module/boot@/system/devices/devices-crypttab
  46. 15
      module/boot@/system/devices/devices-dmraid
  47. 25
      module/boot@/system/devices/devices-lvm
  48. 25
      module/boot@/system/devices/devices-zfs
  49. 1
      module/boot@/system/modules/modules-kernel
  50. 3
      module/boot@/system/modules/modules-system
  51. 2
      module/boot@/system/system-Devices
  52. 3
      module/boot@/system/system-fontnkey
  53. 5
      module/boot@/system/system-fsck
  54. 3
      module/boot@/system/system-hostname
  55. 3
      module/boot@/system/system-hwclock
  56. 1
      module/boot@/system/system-random
  57. 18
      module/boot@/system/system-sysctl
  58. 1
      module/boot@/system/udev/udevadm
  59. 1
      module/boot@/system/udev/udevd
  60. 2
      package/info
  61. 6
      package/modes
  62. 16
      package/targets.mak
  63. 71
      scripts/modules.sh
  64. 42
      service/boot/local/local-ip6tables
  65. 43
      service/boot/local/local-iptables
  66. 33
      service/boot/local/local-rc
  67. 32
      service/boot/mount/mount-swap
  68. 42
      service/boot/mount/mount-zfs
  69. 23
      service/boot/system/devices/devices-btrfs
  70. 23
      service/boot/system/devices/devices-dmraid
  71. 33
      service/boot/system/devices/devices-lvm
  72. 26
      service/boot/system/system-sysctl
  73. 202
      service/boot@

2
.gitignore vendored

@ -1,4 +1,2 @@
boot-66serv/
config.mak
boot.conf

2
AUTHORS

@ -1,6 +1,4 @@
Main author:
Eric Vidal <eric@obarun.org>
Contributors:
Danilo Spinella <danyspin97@protonmail.com>

26
INSTALL

@ -6,7 +6,14 @@ Build Instructions
- A POSIX-compliant C development environment
- GNU make version 3.81 or later
- skalibs version 2.9.1.0 or later: http://skarnet.org/software/skalibs/
- execline version 2.5.3.0 or later: http://skarnet.org/software/execline/
- s6 version 2.9.0.1 or later: http://skarnet.org/software/s6/
- s6-rc version 0.5.1.1 or later: http://skarnet.org/software/s6-rc/
- oblibs version 0.0.6.0 or later: https://framagit.org/Obarun/oblibs/
- 66 version 0.2.6.0 or later https://framagit.org/Obarun/66/
- 66-tools version v0.0.3.1 or later https://framagit.org/Obarun/66-tools/
This software will run on any operating system that implements
POSIX.1-2008, available at:
http://pubs.opengroup.org/onlinepubs/9699919799/
@ -28,14 +35,14 @@ POSIX.1-2008, available at:
* Runtime dependencies
--------------------
- execline version 2.5.1.0 or later: http://skarnet.org/software/execline/
- s6 version 2.8.0.1 or later: http://skarnet.org/software/s6/
- s6-rc version 0.5.0.0 or later: http://skarnet.org/software/s6-rc/
- oblibs version 0.0.2.0 or later: https://framagit.org/Obarun/oblibs/
- 66 version 0.2.1.0 or later: https://framagit.org/Obarun/66/
- 66-tools version 0.0.1.0 or later: https://framagit.org/Obarun/66-tools/
- s6-linux-utils version 1.0.2.1 or later: http://skarnet.org/software/s6-linux-utils/
- s6-portable-utils version 2.2.1.3 or later: http://skarnet.org/software/s6-portable-utils/
- execline version 2.5.3.0 or later: http://skarnet.org/software/execline/
- s6 version 2.9.0.1 or later: http://skarnet.org/software/s6/
- s6-rc version 0.5.1.1 or later: http://skarnet.org/software/s6-rc/
- oblibs version 0.0.6.0 or later: https://framagit.org/Obarun/oblibs/
- 66 version 0.2.6.0 or later: https://framagit.org/Obarun/66/
- 66-tools version 0.0.3.1 or later: https://framagit.org/Obarun/66-tools/
- s6-linux-utils version 2.5.1.1 or later: http://skarnet.org/software/s6-linux-utils/
- s6-portable-utils version 2.2.2.1 or later: http://skarnet.org/software/s6-portable-utils/
- bash
- iproute2
- kmod
@ -44,3 +51,4 @@ POSIX.1-2008, available at:
- dmraid
- lvm2
- btrfs-progs
- zfs

2
LICENSE

@ -1,4 +1,4 @@
Copyright (c) 2015-2019 Eric Vidal <eric@obarun.org>
Copyright (c) 2015-2020 Eric Vidal <eric@obarun.org>
All rights reserved.
Permission to use, copy, modify, and/or distribute this software for any

69
Makefile

@ -15,27 +15,68 @@ include package/targets.mak
INSTALL := ./tools/install.sh
install: install-conf install-lib-scripts install-sysadm-scripts install-service
install-conf: $(CONF_TARGETS:boot.conf=$(DESTDIR)$(boot_conf))
install-lib-scripts: $(SCRIPTS_LIB_TARGETS:scripts/%=$(DESTDIR)$(scripts)/%)
install-sysadm-scripts: $(SCRIPTS_SYSADM_TARGETS:scripts/%=$(DESTDIR)$(sysconfdir)/$(package_macro_dir)/%)
install-service: $(SERVICES_TARGETS:service/%=$(DESTDIR)$(service_directory)/%)
install: install-script install-service install-module install-configure install-rc-local
install-script: $(SCRIPT_TARGET:module/boot@/.configure/%=$(DESTDIR)$(script_directory)/%)
install-service: $(SERVICE_TARGET:service/%=$(DESTDIR)$(service_directory)/%)
install-module: $(MODULE_TARGET:module/%=$(DESTDIR)$(module_directory)/%)
install-configure: $(MODULE_CONFIGURE_TARGET:module/boot@/.configure/configure=$(DESTDIR)$(module_directory)/boot@/.configure/configure)
install-rc-local: $(SKEL_SCRIPT_TARGET:module/boot@/.configure/rc.local=$(DESTDIR)$(skel_directory)/rc.local)
$(DESTDIR)$(boot_conf): boot.conf
exec $(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(sysconfdir)/$(package_macro_dir)/%: scripts/rc.local
exec $(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(script_directory)/%: module/boot@/.configure/%
exec $(INSTALL) -D -m 755 $< $@
sed -i -e 's,@BINDIR@,$(bindir),' $@
$(DESTDIR)$(scripts)/%: scripts/%
$(DESTDIR)$(module_directory)/boot@/.configure/configure: module/boot@/.configure/configure
exec $(INSTALL) -D -m 755 $< $@
sed -i -e 's,@BINDIR@,$(bindir),' $@
$(DESTDIR)$(skel_directory)/rc.local: module/boot@/.configure/rc.local
exec $(INSTALL) -D -m 755 $< $@
$(DESTDIR)$(module_directory)/%: module/%
exec $(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(service_directory)/%: service/%
exec $(INSTALL) -D -m 644 $< $@
sed -i -e 's,@BOOTCONF@,$(boot_conf),' -e 's,@SCRIPTS@,$(scripts),' \
-e 's,@INITCONF@,$(init_conf),' \
-e 's,@SYSCONFDIR@,$(sysconfdir),' $@
sed -i -e 's,@adm_conf@,$(adm_conf),' \
-e 's,@script_directory@,$(script_directory),' \
-e 's,@skel_directory@,$(skel_directory),' \
-e 's,@version@,$(version),' \
-e 's,@HOSTNAME@,$(HOSTNAME),' \
-e 's,@HARDWARECLOCK@,$(HARDWARECLOCK),' \
-e 's,@TZ@,$(TZ),' \
-e 's,@SETUPCONSOLE@,$(SETUPCONSOLE),' \
-e 's,@KEYMAP@,$(KEYMAP),' \
-e 's,@FONT@,$(FONT),' \
-e 's,@FONT_MAP@,$(FONT_MAP),' \
-e 's,@FONT_UNIMAP@,$(FONT_UNIMAP),' \
-e 's,@UDEV@,$(UDEV),' \
-e 's,@SYSCTL@,$(SYSCTL),' \
-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),' \
-e 's,@FSTAB@,$(FSTAB),' \
-e 's,@SWAP@,$(SWAP),' \
-e 's,@LVM@,$(LVM),' \
-e 's,@DMRAID@,$(DMRAID),' \
-e 's,@BTRFS@,$(BTRFS),' \
-e 's,@ZFS@,$(ZFS),' \
-e 's,@CRYPTTAB@,$(CRYPTTAB),' \
-e 's,@IPTABLES@,$(IPTABLES),' \
-e 's,@IP6TABLES@,$(IP6TABLES),' \
-e 's,@CGROUPS@,$(CGROUPS),' \
-e 's,@MNT_PROC@,$(MNT_PROC),' \
-e 's,@MNT_SYS@,$(MNT_SYS),' \
-e 's,@MNT_DEV@,$(MNT_DEV),' \
-e 's,@MNT_RUN@,$(MNT_RUN),' \
-e 's,@MNT_TMP@,$(MNT_TMP),' \
-e 's,@MNT_PTS@,$(MNT_PTS),' \
-e 's,@MNT_SHM@,$(MNT_SHM),' \
-e 's,@MNT_NETFS@,$(MNT_NETFS),' $@
version:
@echo $(version)

281
configure vendored

@ -18,36 +18,53 @@ Fine tuning of the installation directories:
--sysconfdir=SYSDIR global configuration files [/etc]
--datarootdir=DATAROOTDIR read-only architecture-independent data root [PREFIX/share]
--shebangdir=DIR absolute path for execline #\! invocations [BINDIR]
--with-system-service=DIR service intallation directory [DATAROOTDIR/$package_macro_dir/service]
--with-boot-conf=DIR installation directory of boot.conf [SYSDIR/$package_macro_dir]
--with-init-conf=DIR init.conf skeleton file of 66-boot [SYSDIR/$package_macro_dir]
--with-scripts=DIR installation directory of scripts [LIBDIR/scripts]
--with-system-service=DIR 66 service intallation directory [DATAROOTDIR/$package_macro_dir/service]
--with-system-module=DIR 66 module intallation directory [DATAROOTDIR/$package_macro_dir/module]
--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]
Fine tunning of boot configuration:
--HOSTNAME=VALUE hostname of the system [obliveS6]
--HOSTNAME=VALUE hostname of the system [obarunS6]
--HARDWARECLOCK=VALUE set the hardware clock [UTC]
--TZ=VALUE set timezone [GMT]
--SETUPCONSOLE=BOOLEAN configure the console [!yes]
--KEYMAP=VALUE set the console keymap [!us]
--FONT=VALUE set the console font [!lat9w-16]
--FONT_MAP=VALUE set the console map []
--FONT_UNIMAP=VALUE set the console unimap []
--CRYPTTAB=BOOLEAN use crypttab by default [!no]
--IPTABLES=BOOLEAN use iptables by default [!no]
--IP6TABLES=BOOLEAN use ip6tables by default [!no]
--UDEV=BOOLEAN use udev [!yes]
--SYSCTL=BOOLEAN configure kernel runtime with sysctl [!yes]
--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]
--FSTAB=BOOLEAN mount devices from fstab [!yes]
--CGROUPS=BOOLEAN mount cgroups [!yes]
--SWAP=BOOLEAN mount swap [!no]
--LVM=BOOLEAN mount lvm devices [!no]
--DMRAID=BOOLEAN mount dmraid devices [!no]
--BTRFS=BOOLEAN mount btrfs devices [!no]
--ZFS=BOOLEAN mount zfs devices [!no]
--SYSCTL=BOOLEAN configure kernel runtime with sysctl [!yes]
--FORCECHCK=BOOLEAN force a check of the filesystem [!no]
--LOCAL=BOOLEAN use rc.local scripts [!no]
--CRYPTTAB=BOOLEAN use crypttab by default [!no]
--IPTABLES=BOOLEAN use iptables by default [!no]
--IP6TABLES=BOOLEAN use ip6tables by default [!no]
--CGROUPS=BOOLEAN mount cgroups [!yes]
--MNT_PROC=BOOLEAN mount /proc [!yes]
--MNT_SYS=BOOLEAN mount /sys [!yes]
--MNT_DEV=BOOLEAN mount /dev [!yes]
--MNT_RUN=BOOLEAN mount /run [!yes]
--MNT_TMP=BOOLEAN mount /tmp [!yes]
--MNT_PTS=BOOLEAN mount /dev/pts [!yes]
--MNT_SHM=BOOLEAN mount /dev/shm [!yes]
--MNT_NETFS=BOOLEAN mount no-network filesystems [!yes]
Use yes or no with lowercase character to set BOOLEAN values.
Empty value is a commented one in boot.conf file and not used at all.
Empty value is a commented one and not used at all.
An exclamation mark '!' at the begin of the value unexport the variable
for the environment after the use. This is avoid to poluate the environment
@ -113,29 +130,46 @@ sysconfdir='/etc'
datarootdir='$prefix/share'
shebangdir='$bindir'
service_directory='$datarootdir/$package_macro_dir/service'
boot_conf='$sysconfdir/$package_macro_dir/boot.conf'
init_conf='$sysconfdir/$package_macro_dir/init.conf'
scripts='$libdir/scripts'
HOSTNAME='obliveS6'
module_directory='$datarootdir/$package_macro_dir/module'
script_directory='$datarootdir/$package_macro_dir/script'
skel_directory='$sysconfdir/$package_macro_dir'
adm_conf='$sysconfdir/$package_macro_dir/conf'
HOSTNAME='obarunS6'
HARDWARECLOCK='UTC'
TZ='GMT'
SETUPCONSOLE='!yes'
KEYMAP='!us'
FONT='!lat9w-16'
FONT_MAP=
FONT_UNIMAP=
CRYPTTAB='!no'
IPTABLES='!no'
IP6TABLES='!no'
UDEV='!yes'
SYSCTL='!yes'
FORCECHCK='!no'
LOCAL='!no'
CONTAINER='!no'
TMPFILE='!yes'
MODULE_KERNEL='!yes'
MODULE_SYSTEM='!yes'
RANDOMSEED='!yes'
FSTAB='!yes'
CGROUPS='!yes'
SWAP='!no'
LVM='!no'
DMRAID='!no'
BTRFS='!no'
ZFS='!no'
SYSCTL='!yes'
FORCECHCK='!no'
LOCAL='!no'
CRYPTTAB='!no'
IPTABLES='!no'
IP6TABLES='!no'
CGROUPS='!yes'
MNT_PROC='!yes'
MNT_SYS='!yes'
MNT_DEV='!yes'
MNT_RUN='!yes'
MNT_TMP='!yes'
MNT_PTS='!yes'
MNT_SHM='!yes'
MNT_NETFS='!yes'
for arg ; do
case "$arg" in
@ -148,29 +182,44 @@ for arg ; do
--datarootdir=*) datarootdir=${arg#*=} ;;
--shebangdir=*) shebangdir=${arg#*=} ;;
--with-system-service=*) service_directory=${arg#*=} ;;
--with-boot-conf=*) boot_conf=${arg#*=} ;;
--with-init-conf=*) init_conf=${arg#*=} ;;
--with-scripts=*) scripts=${arg#*=} ;;
--with-system-module=*) module_directory=${arg#*=} ;;
--with-system-script=*) script_directory=${arg#*=} ;;
--with-sysadmin-service-conf=*) adm_conf=${arg#*=} ;;
--with-skeleton=*) skel_directory=${arg#*=} ;;
--HOSTNAME=*) HOSTNAME=${arg#*=} ;;
--HARDWARECLOCK=*) HARDWARECLOCK=${arg#*=} ;;
--TZ=*) TZ=${arg#*=} ;;
--SETUPCONSOLE=*) SETUPCONSOLE=${arg#*=} ;;
--KEYMAP=*) KEYMAP=${arg#*=} ;;
--FONT=*) FONT=${arg#*=} ;;
--FONT_MAP=*) FONT_MAP=${arg#*=} ;;
--FONT_UNIMAP=*) FONT_UNIMAP=${arg#*=} ;;
--CRYPTTAB=*) CRYPTTAB=${arg#*=} ;;
--IPTABLES=*) IPTABLES=${arg#*=} ;;
--IP6TABLES=*) IP6TABLES=${arg#*=} ;;
--SYSCTL=*) SYSCTL=${arg#*=} ;;
--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#*=} ;;
--FSTAB=*) FSTAB=${arg#*=} ;;
--CGROUPS=*) CGROUPS=${arg#*=} ;;
--SWAP=*) SWAP=${arg#*=} ;;
--LVM=*) LVM=${arg#*=} ;;
--DMRAID=*) DMRAID=${arg#*=} ;;
--BTRFS=*) BTRFS=${arg#*=} ;;
--ZFS=*) ZFS=${arg#*=} ;;
--SYSCTL=*) SYSCTL=${arg#*=} ;;
--FORCECHCK=*) FORCECHCK=${arg#*=} ;;
--LOCAL=*) LOCAL=${arg#*=} ;;
--CRYPTTAB=*) CRYPTTAB=${arg#*=} ;;
--IPTABLES=*) IPTABLES=${arg#*=} ;;
--IP6TABLES=*) IP6TABLES=${arg#*=} ;;
--CGROUPS=*) CGROUPS=${arg#*=} ;;
--MNT_PROC=*) MNT_PROC=${arg#*=} ;;
--MNT_SYS=*) MNT_SYS=${arg#*=} ;;
--MNT_DEV=*) MNT_DEV=${arg#*=} ;;
--MNT_RUN=*) MNT_RUN=${arg#*=} ;;
--MNT_TMP=*) MNT_TMP=${arg#*=} ;;
--MNT_PTS=*) MNT_PTS=${arg#*=} ;;
--MNT_SHM=*) MNT_SHM=${arg#*=} ;;
--MNT_NETFS=*) MNT_NETFS=${arg#*=} ;;
-* ) echo "$0: unknown option $arg" ;;
*=*) ;;
*) target=$arg ;;
@ -191,40 +240,44 @@ if test -z "$sysconfdir" ; then
if test "$sysconfdir" = '$sysconfdir' ; then
sysconfdir = '/etc'
fi
if test "$boot_conf" = '$sysconfdir/$package_macro_dir/boot.conf' ; then
boot_conf = '$sysconfdir/$package_macro_dir/boot.conf'
if test "$adm_conf" = '$sysconfdir/$package_macro_dir/conf' ; then
adm_conf = '$sysconfdir/$package_macro_dir/conf'
fi
if test "$init_conf" = '$sysconfdir/$package_macro_dir/init.conf' ; then
init_conf = '$sysconfdir/$package_macro_dir/init.conf'
if test "$skel_directory" = '$sysconfdir/$package_macro_dir' ; then
skel_directory = '$sysconfdir/$package_macro_dir'
fi
fi
# Expand installation directories
stripdir prefix
for i in exec_prefix bindir libdir shebangdir ; do
for i in exec_prefix bindir libdir sysconfdir datarootdir shebangdir\
service_directory module_directory script_directory skel_directory adm_conf ; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir sysconfdir
for i in service_directory scripts boot_conf init_conf; do
for i in adm_conf skel_directory; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir datarootdir
for i in service_directory; do
for i in service_directory module_directory script_directory; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
for i in HOSTNAME HARDWARECLOCK TZ KEYMAP FONT FONT_MAP \
FONT_UNIMAP CRYPTTAB IPTABLES IP6TABLES FSTAB \
CGROUPS SWAP LVM DMRAID BTRFS ZFS \
SYSCTL FORCECHCK LOCAL ; do
for i in HOSTNAME HARDWARECLOCK TZ SETUPCONSOLE \
KEYMAP FONT FONT_MAP FONT_UNIMAP UDEV SYSCTL FORCECHCK LOCAL CONTAINER \
TMPFILE MODULE_KERNEL MODULE_SYSTEM RANDOMSEED \
FSTAB SWAP LVM DMRAID BTRFS ZFS \
CRYPTTAB IPTABLES IP6TABLES \
CGROUPS MNT_PROC MNT_SYS MNT_DEV MNT_RUN MNT_TMP \
MNT_PTS MNT_SHM MNT_NETFS ; do
eval tmp=\${$i}
if testval $tmp; then
eval $i='#${i}='
@ -265,131 +318,47 @@ sysconfdir := $sysconfdir
datarootdir := $datarootdir
shebangdir := $shebangdir
service_directory := $service_directory
boot_conf := $boot_conf
init_conf := $init_conf
scripts := $scripts
module_directory := $module_directory
script_directory := $script_directory
adm_conf := $adm_conf
skel_directory := $skel_directory
package_macro_dir := $package_macro_dir
EOF
exec 1>&3 3>&-
echo " ... done."
echo "creating boot.conf..."
exec 3>&1 1> boot.conf
cat <<EOF
# Copyright (c) 2015-2019 Eric Vidal <eric@obarun.org>
# 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.
#
# $boot_conf - system configuration for Obarun 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 unexport the variable from the environment.
# If you want to keep it, remove the exclamation mark '!'.
######################
## MAIN ##
######################
## Set the HOSTNAME.
$HOSTNAME
## Set RTC [UTC|localtime].
$HARDWARECLOCK
## Set timezone, availables timezones at /usr/share/zoneinfo.
$TZ
## keymap to load, see loadkeys(8).
$SETUPCONSOLE
$KEYMAP
## Console font to load, see setfont(8).
$FONT
## Console map to load, see setfont(8).
$FONT_MAP
## Console unimap to load, see setfont(8).
$FONT_UNIMAP
######################
## SECURITY ##
######################
## Active encrypted devices [yes|no].
$CRYPTTAB
## Use iptables [yes|no].
$IPTABLES
## Use ip6tables [yes|no].
$IP6TABLES
######################
## DEVICES ##
######################
## Mount devices from FSTAB file [yes|no].
$UDEV
$SYSCTL
$FORCECHCK
$LOCAL
$CONTAINER
$TMPFILE
$MODULE_KERNEL
$MODULE_SYSTEM
$RANDOMSEED
$FSTAB
## Mount cgroups [yes|no].
$CGROUPS
## Active swap [yes|no].
$SWAP
## Active lvm devices [yes|no].
$LVM
## Active dmraid devices [yes|no].
$DMRAID
## Active btrfs devices [yes|no].
$BTRFS
## Mount zfs devices [yes|no].
$ZFS
######################
## SYSTEM ##
######################
## Kernel configuration with sysctl [yes|no].
$SYSCTL
## Force a check of filesystem partition [yes|no].
$FORCECHCK
## Use rc.local script [yes|no].
$LOCAL
$CRYPTTAB
$IPTABLES
$IP6TABLES
$CGROUPS
$MNT_PROC
$MNT_SYS
$MNT_DEV
$MNT_RUN
$MNT_TMP
$MNT_PTS
$MNT_SHM
$MNT_NETFS
EOF
exec 1>&3 3>&-
echo " ... done."

191
module/boot@/.configure/configure vendored

@ -0,0 +1,191 @@
#!@BINDIR@/sh
SV_REAL=
sv_boolean_list=(
'CRYPTTAB
SETUPCONSOLE
IPTABLES
IP6TABLES
FSTAB
SWAP
LVM
DMRAID
BTRFS
ZFS
UDEV
SYSCTL
FORCECHCK
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')
sv_container_list=(
'HARDWARECLOCK
SETUPCONSOLE
CRYPTTAB
SWAP
LVM
DMRAID
BTRFS
ZFS
UDEV
UDEV_ADM
SYSCTL
FORCECHCK
CGROUPS
MODULE_SYSTEM
RANDOMSEED
MNT_NETFS')
die(){
printf "%s\n" "$*"
exit 1
}
retrieve_sv_name(){
local sv=${1}
case ${sv} in
HARDWARECLOCK) SV_REAL="system-hwclock" ;;
CRYPTTAB) SV_REAL="devices-crypttab" ;;
SETUPCONSOLE) SV_REAL="system-fontnkey" ;;
IPTABLES) SV_REAL="local-iptables" ;;
IP6TABLES) SV_REAL="local-ip6tables" ;;
FSTAB) SV_REAL="mount-fstab" ;;
SWAP) SV_REAL="mount-swap" ;;
LVM) SV_REAL="devices-lvm" ;;
DMRAID) SV_REAL="devices-dmraid" ;;
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" ;;
CONTAINER) SV_REAL="system-fontnkey" ;;
TMPFILE) SV_REAL="local-tmpfiles" ;;
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" ;;
## extra service not set by the environment section
UDEV_ADM) SV_REAL="udevadm" ;;
POPULATE_SYS) SV_REAL="populate-sys" ;;
POPULATE_DEV) SV_REAL="populate-dev" ;;
POPULATE_RUN) SV_REAL="populate-run" ;;
POPULATE_TMP) SV_REAL="populate-tmp" ;;
esac
unset sv
}
sv_uncomment_list() {
local name=${1} list=( "$(find ../ -mindepth 1 -type f)" )
retrieve_sv_name ${name}
for sv in ${list}; do
dir=${sv%/*}
dir=${dir#*/}
if [ "$dir" != ".configure" ]; then
sed -i "s:#*${SV_REAL}:${SV_REAL}:g" ${sv} || die "fatal: unable to sed ${sv}"
fi
done
unset list
}
sv_comment_list() {
local name=${1} list=( "$(find ../ -mindepth 1 -type f)" )
retrieve_sv_name ${name}
for sv in ${list}; do
dir=${sv%/*}
dir=${dir#*/}
if [ "$dir" != ".configure" ]; then
sed -i "s:${SV_REAL}:#${SV_REAL}:g" ${sv} || die "fatal: unable to sed ${sv}"
fi
done
file="$(find ../ -mindepth 1 -name ${SV_REAL})"
rm -f "${file}"
unset list
}
sv_comment_real() {
local name=${1} list=( "$(find ../ -mindepth 1 -type f)" )
for sv in ${list}; do
dir=${sv%/*}
dir=${dir#*/}
if [ "$dir" != ".configure" ]; then
sed -i "s:${name}:#${name}:g" ${sv} || die "fatal: unable to sed ${sv}"
fi
done
file=$(find ../ -mindepth 1 -name ${name})
rm -f ${file}
}
for sv in ${sv_boolean_list}; do
if [ ${!sv} == "yes" ]; then
sv_uncomment_list ${sv}
else
sv_comment_list ${sv}
fi
done
uncomment_udev() {
for sv in "udevd" "udevadm" "system-fontnkey" "devices-crypttab" \
"devices-dmraid" "devices-btrfs" "devices-lvm" ; do
sv_comment_real ${sv}
done
}
if [ ${UDEV} == "no" ]; then
uncomment_udev
fi
if [ ${CONTAINER} == "yes" ]; then
for sv in ${sv_container_list}; do
sv_comment_list ${sv}
done
fi
if [ ${MNT_SYS} == "no" ]; then
sv_comment_real "populate-sys"
fi
if [ ${MNT_DEV} == "no" ]; then
for sv in "mount-pts" "mount-shm" "populate-dev" "mount-cgroups"; do
sv_comment_real ${sv}
done
uncomment_udev
fi
if [ ${MNT_RUN} == "no" ]; then
sv_comment_real "populate-run"
fi
if [ ${MNT_TMP} == "no" ]; then
sv_comment_real "populate-tmp"
fi

0
scripts/crypt.awk → module/boot@/.configure/crypt.awk

82
module/boot@/.configure/modules.sh

@ -0,0 +1,82 @@
#!@BINDIR@/sh
#
# This scripts is a pure-POSIX sh version
#
# Copyright (c) 2015-2020 Eric Vidal <eric@obarun.org>
# 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.
# Configuration files are read from directories in
# /usr/lib/modules-load.d, /run/modules-load.d, and /etc/modules-load.d,
# in order of precedence
MODULES_PATH='/etc/modules-load.d /run/modules-load.d /usr/lib/modules-load.d'
MODULES_NAME=""
MODULES_RESULT=""
check_elements(){
for e in $2; do [ "$e" = "$1" ] && return 0; done; return 1;
}
build_array() {
printf "%s %s" "$1" "$2"
}
check_file(){
tidy_loop="" conf=""
for tidy_loop in $MODULES_PATH; do
if [ -d "${tidy_loop}" ]; then
for conf in "${tidy_loop}"/*.conf ; do
if [ -f "${conf}" ]; then
if ! check_elements "${conf##*/}" "${MODULES_NAME}"; then
MODULES_NAME=$(build_array "${MODULES_NAME}" "${conf##*/}")
fi
fi
done
fi
done
unset tidy_loop conf
}
check_path(){
path="" tidy_loop=""
for path in ${MODULES_PATH}; do
for tidy_loop in ${MODULES_NAME}; do
if [ -f "${path}/${tidy_loop}" ]; then
if ! check_elements "${tidy_loop}" "${MODULES_RESULT##*/}";then
MODULES_RESULT=$(build_array "${MODULES_RESULT}" "${path}/${tidy_loop}")
fi
fi
done
done
unset path tidy_loop
}
check_file
if [ -n "${MODULES_NAME}" ]; then
check_path
else
printf "$0: %s\n" "No modules found -- nothing to do"
exit 0
fi
for mod in ${MODULES_RESULT}; do
while read -r line; do
comment=$(printf "%s" "$line" | awk '{ string=substr($0, 0, 1); print string; }' )
if [ "${comment}" = "#" ] || [ -z "${line}" ];then
continue
fi
for check in ${line};do
modprobe -b "${check}" -v | sed 's:insmod [^ ]*/:Load modules :g; s:\.ko\(\.gz\)\? ::g'
done
done < "${mod}"
done
exit 0

10
scripts/rc.local → module/boot@/.configure/rc.local

@ -1,4 +1,4 @@
# Copyright (c) 2015-2019 Eric Vidal <eric@obarun.org>
# Copyright (c) 2015-2020 Eric Vidal <eric@obarun.org>
# All rights reserved.
#
# This file is part of Obarun. It is subject to the license terms in
@ -9,6 +9,8 @@
#
# Default rc.local for Obarun; add your custom commands here.
#
# This is run by s6 before the user services are executed.
# This file is declared as oneshot service on 66, do not try to launch any daemon with this file.
# Do not forget to set the shebang.
# 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.

2
scripts/tmpfiles.sh → module/boot@/.configure/tmpfiles.sh

@ -217,7 +217,7 @@ _C() {
if [ $gid != '-' ]; then
dryrun_or_real chgrp "$gid" "$path"
fi
if [ $mode != '-']; then
if [ $mode != '-' ]; then
dryrun_or_real chmod "$mode" "$path"
fi
fi

1
service/boot/All → module/boot@/All

@ -1,5 +1,6 @@
[main]
@type = bundle
@version = @vers@
@description = "First service called to start the system"
@user = ( root )
@contents =

3
service/boot/all-Local → module/boot@/all-Local

@ -1,10 +1,13 @@
[main]
@type = bundle
@version = @vers@
@description = "Local configuration"
@user = ( root )
@contents =
(
mount-rw
mount-swap
mount-netfs
local-iptables
local-ip6tables
local-loop

9
service/boot/all-Mount → module/boot@/all-Mount

@ -1,11 +1,6 @@
[main]
@type = bundle
@version = @vers@
@description = "Mount all devices"
@user = ( root )
@contents =
(
00
mount-cgroups
mount-swap
mount-zfs
)
@contents = ( 00 )

3
service/boot/all-Runtime → module/boot@/all-Runtime

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Launch all tree enabled of root user"
@user = ( root )
@depends = ( all-Mount all-System all-Local )
@ -20,4 +21,4 @@ execl-envfile ${conf_file}
)
[environment]
conf_file=!@INITCONF@
conf_file=!@initconf@

1
service/boot/all-System → module/boot@/all-System

@ -1,5 +1,6 @@
[main]
@type = bundle
@version = @vers@
@description = "System configuration"
@user = ( root )
@contents =

1
service/boot/earlier-service/tty12 → module/boot@/earlier-service/tty12

@ -1,5 +1,6 @@
[main]
@type = classic
@version = @vers@
@description = "Launch tty12"
@user = ( root )

1
service/boot/local/local-authfiles → module/boot@/local/local-authfiles

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Create tempory authentification files"
@depends = ( mount-rw )
@user = ( root )

1
service/boot/local/local-dmesg → module/boot@/local/local-dmesg

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Saves logs of dmesg"
@options = ( env )
@depends = ( local-rc )

32
module/boot@/local/local-ip6tables

@ -0,0 +1,32 @@
[main]
@type = oneshot
@version = @vers@
@description = "Restore ip6tables rules"
@depends = ( mount-rw )
@user = ( root )
@options = ( env )
[start]
@build = auto
@execute =
(
if { 66-echo -- [local-iptables] starts... }
if { s6-test -e ${script_conf} }
if { 66-which -q ip6tables-restore }
if { ip6tables-restore ${script_conf} }
66-echo -- [local-ip6tables] started successfully
)
[stop]
@build = auto
@execute =
(
if { 66-echo -- [local-ip6tables] stops... }
if { s6-test -x ${script_file} }
if { ${script_file} }
66-echo -- [local-ip6tables] stopped successfully
)
[environment]
script_conf=!/etc/iptables/ip6tables.rules
script_file=!/usr/lib/iptables/scripts/ip6tables-flush

33
module/boot@/local/local-iptables

@ -0,0 +1,33 @@
[main]
@type = oneshot
@version = @vers@
@description = "Restore iptables rules"
@depends = ( mount-rw )
@user = ( root )
@options = ( env )
[start]
@build = auto
@execute =
(
if { 66-echo -- [local-iptables] starts... }
if { s6-test -e ${script_conf} }
if { 66-which -q iptables-restore }
if { iptables-restore ${script_conf} }
66-echo -- [local-iptables] started successfully
)
[stop]
@build = auto
@execute =
(
if { 66-echo -- [system-iptables] stops... }
if { s6-test -x ${script_file} }
if { ${script_file} }
66-echo -- [local-iptables] stopped successfully
)
[environment]
script_conf=!/etc/iptables/iptables.rules
script_file=!/usr/lib/iptables/scripts/iptables-flush

1
service/boot/local/local-loop → module/boot@/local/local-loop

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Active loop devices"
@depends = ( mount-rw local-iptables local-ip6tables )
@user = ( root )

28
module/boot@/local/local-rc

@ -0,0 +1,28 @@
[main]
@type = oneshot
@version = @vers@
@description = "Run rc.local script"
@options = ( env )
@user = ( root )
@depends = (
mount-rw
local-iptables
local-ip6tables
local-loop
local-time
local-authfiles
local-tmpfiles )
[start]
@build = auto
@execute =
(
if { 66-echo -- [local-rc] starts... }
foreground { ${script_file} }
importas ? ?
if { test ${?} == 0 }
66-echo -- [local-rc] started successfully
)
[environment]
script_file=!@skeldir@/rc.local

3
service/boot/local/local-sethostname → module/boot@/local/local-sethostname

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Set hostname at /etc/hostname file"
@options = ( env )
@depends = ( mount-rw )
@ -19,5 +20,5 @@
)
[environment]
conf_file=!@BOOTCONF@
conf_file=!@bootconf@
conf_file_hostname=!/etc/hostname

3
service/boot/local/local-time → module/boot@/local/local-time

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Set localtime"
@options = ( env )
@depends = ( mount-rw )
@ -16,5 +17,5 @@
)
[environment]
conf_file=!@BOOTCONF@
conf_file=!@bootconf@

5
service/boot/local/local-tmpfiles → module/boot@/local/local-tmpfiles

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Create tempory files"
@depends = ( mount-rw )
@user = ( root )
@ -15,5 +16,5 @@
)
[environment]
script_file=!@SCRIPTS@/tmpfiles.sh
script_args=!--create --verbose
script_file=!@scripts@/tmpfiles.sh
script_args=!--create --verbose --boot

2
service/boot/mount/00 → module/boot@/mount/00

@ -1,5 +1,6 @@
[main]
@type = bundle
@version = @vers@
@description = "Set the hostname and mount filesystem"
@user = ( root )
@contents = (
@ -15,4 +16,5 @@ mount-dev
mount-pts
mount-shm
populate-dev
mount-cgroups
)

15
service/boot/mount/mount-cgroups → module/boot@/mount/mount-cgroups

@ -1,18 +1,15 @@
[main]
@type = oneshot
@version = @vers@
@description = "mount cgroups hierarchy"
@options = ( env )
@user = ( root )
@depends = ( mount-sys )
@depends = ( mount-dev )
[start]
@build = auto
@execute =
(
execl-envfile ${conf_file}
ifelse -X { s6-test ${CGROUPS} = yes }
{
foreground
if
{
if { 66-echo -- [mount-cgroups] starts... }
if { mkdir -p -m 0755 /sys/fs/cgroup }
@ -28,8 +25,7 @@
mount -t cgroup -o rw,nosuid,nodev,noexec,relatime,${i} cgroup /sys/fs/cgroup/${i}
}
66-echo -- [mount-cgroups] started successfully
}
66-echo -- [mount-cgroups] deactivated
)
[stop]
@ -40,6 +36,3 @@
if { umount -R /sys/fs/cgroup }
66-echo -- [mount-cgroups] stopped successfully
)
[environment]
conf_file=!@BOOTCONF@

1
service/boot/mount/mount-dev → module/boot@/mount/mount-dev

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount /dev directory"
@options = ( env )
@user = ( root )

3
service/boot/mount/mount-fstab → module/boot@/mount/mount-fstab

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount partition from /etc/fstab file"
@options = ( env )
@user = ( root )
@ -20,5 +21,5 @@
)
[environment]
conf_file=!@BOOTCONF@
conf_file=!@bootconf@

15
module/boot@/mount/mount-netfs

@ -0,0 +1,15 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount no-network filesystem"
@user = ( root )
@depends=( mount-rw )
[start]
@build = auto
@execute =
(
if { 66-echo -- [mount-netfs] starts... }
if { mount -a -t "nosysfs,nonfs,nonfs4,nosmbfs,nocifs" -O no_netdev }
66-echo -- [mount-netfs] started successfully
)

1
service/boot/mount/mount-proc → module/boot@/mount/mount-proc

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount /proc directory"
@options = ( env )
@user = ( root )

1
service/boot/mount/mount-pts → module/boot@/mount/mount-pts

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount /dev/pts directory"
@options = ( env )
@user = ( root )

1
service/boot/mount/mount-run → module/boot@/mount/mount-run

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount /run directory"
@options = ( env )
@user = ( root )

1
service/boot/mount/mount-rw → module/boot@/mount/mount-rw

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "remount rw '/' directory"
@options = ( env )
@user = ( root )

1
service/boot/mount/mount-shm → module/boot@/mount/mount-shm

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount /dev/shm directory"
@options = ( env )
@user = ( root )

24
module/boot@/mount/mount-swap

@ -0,0 +1,24 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount swap partition"
@user = ( root )
@depends=( mount-rw )
[start]
@build = auto
@execute =
(
if { 66-echo -- [mount-swap] starts... }
if { swapon -a }
66-echo -- [mount-swap] started successfully
)
[stop]
@build = auto
@execute =
(
if { 66-echo -- [mount-swap] stops... }
if { swapoff -a }
66-echo -- [mount-swap] stopped successfully
)

1
service/boot/mount/mount-sys → module/boot@/mount/mount-sys

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount /sys directory"
@options = ( env )
@user = ( root )

1
service/boot/mount/mount-tmp → module/boot@/mount/mount-tmp

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount /tmp directory"
@options = ( env )
@user = ( root )

1
service/boot/mount/populate/populate-dev → module/boot@/mount/populate/populate-dev

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Populate /dev directory"
@user = ( root )
@depends = ( mount-dev )

1
service/boot/mount/populate/populate-run → module/boot@/mount/populate/populate-run

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Populate /run directory"
@user = ( root )
@depends = ( mount-run )

1
service/boot/mount/populate/populate-sys → module/boot@/mount/populate/populate-sys

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Populate /sys directory"
@user = ( root )
@depends = ( mount-proc mount-sys )

1
service/boot/mount/populate/populate-tmp → module/boot@/mount/populate/populate-tmp

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Populate /tmp directory"
@user = ( root )
@depends = ( mount-tmp )

15
module/boot@/system/devices/devices-btrfs

@ -0,0 +1,15 @@
[main]
@type = oneshot
@version = @vers@
@description = "Active btrfs devices"
@user = ( root )
@depends = ( udevadm )
[start]
@build = auto
@execute = (
if { 66-echo -- [devices-btrfs] starts... }
if { 66-which -q btrfs }
if { btrfs device scan }
66-echo -- [devices-btrfs] started successfully
)

16
service/boot/system/devices/devices-crypttab → module/boot@/system/devices/devices-crypttab

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Active encrypted devices"
@user = ( root )
@options = ( env )
@ -8,21 +9,18 @@
[start]
@build = auto
@execute = (
execl-envfile ${conf_file}
ifelse -X { s6-test ${CRYPTTAB} = yes }
{
if { 66-echo -- [devices-crypttab] starts... }
if { s6-test -e ${script_conf} }
if { 66-echo -- [devices-crypttab] starts... }
if { s6-test -e ${script_conf} }
if { execl-cmdline -s { 66-olexec awk -f ${script_file} ${script_conf} } }
foreground {
if { 66-which -q vgchange }
if { awk -f ${script_file} ${script_conf} }
if { 66-echo -- [devices-crypttab] Lvm detected }
if { vgchange --sysinit -a y }
66-echo -- [devices-crypttab] Lvm actived successfully
}
66-echo -- [devices-crypttab] deactivated
66-echo -- [devices-crypttab] started successfully
)
[environment]
conf_file=!@BOOTCONF@
script_file=!@SCRIPTS@/crypt.awk
script_file=!@scripts@/crypt.awk
script_conf=!/etc/crypttab

15
module/boot@/system/devices/devices-dmraid

@ -0,0 +1,15 @@
[main]
@type = oneshot
@version = @vers@
@description = "Active dmraid devices"
@user = ( root )
@depends = ( udevadm )
[start]
@build = auto
@execute = (
if { 66-echo -- [devices-dmraid] starts... }
if { 66-which -q dmraid }
if { dmraid -i -ay }
66-echo -- [devices-dmraid] started successfully
)

25
module/boot@/system/devices/devices-lvm

@ -0,0 +1,25 @@
[main]
@type = oneshot
@version = @vers@
@description = "Active lvm devices"
@user = ( root )
@depends = ( udevadm )
[start]
@build = auto
@execute =
(
if { 66-echo -- [devices-lvm] starts... }
if { 66-which -q lvmetad }
foreground {
if -nt { s6-test -d /run/lvm }
s6-mkdir /run/lvm
}
if { lvmetad -p /run/lvm/lvmetad.pid }
if { 66-which -q vgchange }
foreground {
vgchange --sysinit -ay
}
foreground { pkill lvmetad }
66-echo -- [devices-lvm] started successfully
)

25
module/boot@/system/devices/devices-zfs

@ -0,0 +1,25 @@
[main]
@type = oneshot
@version = @vers@
@description = "Mount zfs devices"
@user = ( root )
@depends = ( mount-dev )
@options = ( env )
[start]
@build = auto
@execute =
(
execl-envfile ${conf_file}
ifelse -X { s6-test ${ZFS} = yes }
{
if { 66-echo -- [devices-zfs] starts... }
if { 66-which -q zfs }
if { zpool import -a }
66-echo -- [devices-zfs] started successfully
}
66-echo -- [devices-zfs] deactivated
)
[environment]
conf_file=!@bootconf@

1
service/boot/system/modules/modules-kernel → module/boot@/system/modules/modules-kernel

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Load kernel modules"
@user = ( root )
@depends = ( 00 )

3
service/boot/system/modules/modules-system → module/boot@/system/modules/modules-system

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Load modules from modules-load directories"
@user = ( root )
@options = ( env )
@ -17,4 +18,4 @@
)
[environment]
script_file=!@SCRIPTS@/modules.sh
script_file=!@scripts@/modules.sh

2
service/boot/system/system-Devices → module/boot@/system/system-Devices

@ -1,5 +1,6 @@
[main]
@type = bundle
@version = @vers@
@description = "Active specific devices"
@user = ( root )
@contents =
@ -8,4 +9,5 @@ devices-dmraid
devices-btrfs
devices-crypttab
devices-lvm
devices-zfs
)

3
service/boot/system/system-fontnkey → module/boot@/system/system-fontnkey

@ -1,5 +1,6 @@
[main]
@type = oneshot
@version = @vers@
@description = "Set font and keymap for tty"
@user = ( root )
@options = ( env )
@ -22,4 +23,4 @@
)
[environment]
conf_file=!@BOOTCONF@
conf_file=!@bootconf@

5
service/boot/system/system-fsck → module/boot@/system/system-fsck