Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ef93123fc6 | ||
![]() |
96c517fbb6 | ||
![]() |
928bcb559f | ||
![]() |
e2d67d7c8c | ||
![]() |
a483e72826 | ||
![]() |
5aa4632678 |
@@ -1,4 +1,4 @@
|
||||
# s6-boot
|
||||
Boot files for s6
|
||||
For instructions about S6 supervision suite : http://skarnet.org/software/
|
||||
Please see here http://obarun.org/forum/viewtopic.php?id=123 for futher informations about obarun use it.
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#!/usr/local/bin/execlineb -P
|
||||
fdmove -c 2 1
|
||||
if { s6-echo -- 00 started }
|
||||
foreground { if { s6-echo -- Mounting filesystem }
|
||||
# mount proc sys dev run if doesn't exist
|
||||
foreground {
|
||||
forx -p first { proc sys dev run }
|
||||
@@ -44,4 +45,31 @@ if {
|
||||
}
|
||||
}
|
||||
}
|
||||
s6-echo -- 00 successfully started
|
||||
s6-echo -- filesystem was mounted successfully
|
||||
}
|
||||
foreground {
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- Parsing s6-conf }
|
||||
# parse s6.conf before loading environment
|
||||
foreground {
|
||||
redirfd -r 0 /etc/s6/s6.conf
|
||||
pipeline { s6-grep -vF -- "#" }
|
||||
forstdin -nCd"\n" -- conf
|
||||
importas -ui -D "" conf conf
|
||||
multidefine -d"=" $conf { var value }
|
||||
foreground {
|
||||
if { mkdir -p ${S6CONF}/ }
|
||||
redirfd -w 1 ${S6CONF}/$var
|
||||
s6-echo -- $value
|
||||
}
|
||||
}
|
||||
# load hostname for earlier tty
|
||||
foreground {
|
||||
s6-envdir ${S6CONF}
|
||||
importas -i -D "" HOSTNAME HOSTNAME
|
||||
s6-hostname ${HOSTNAME}
|
||||
}
|
||||
s6-echo -- s6-conf was parsed successfully
|
||||
}
|
||||
s6-echo -- 00 successfully started
|
@@ -1,4 +1,3 @@
|
||||
00
|
||||
s6-conf
|
||||
all-Boot
|
||||
all-Switch
|
||||
|
@@ -2,6 +2,7 @@ rwfs-fsrw
|
||||
rwfs-tmpdir
|
||||
rwfs-loopback
|
||||
rwfs-iptables
|
||||
rwfs-ip6tables
|
||||
rwfs-nonetwork
|
||||
rwfs-localtime
|
||||
rwfs-random
|
||||
|
@@ -2,12 +2,13 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- checkfs-brtfs started }
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" USEBTRFS USEBTRFS
|
||||
foreground {
|
||||
if { s6-test $USEBTRFS = yes }
|
||||
if { s6-test -x /usr/bin/btrfs }
|
||||
btrfs device scan
|
||||
}
|
||||
s6-echo -- checkfs-brtfs successfully started
|
||||
ifelse -X { s6-test $USEBTRFS = yes }
|
||||
{
|
||||
if { s6-test -x /usr/bin/btrfs }
|
||||
if { s6-echo -- checkfs-brtfs started }
|
||||
foreground { btrfs device scan }
|
||||
s6-echo -- checkfs-brtfs successfully started
|
||||
}
|
||||
s6-echo -- checkfs-brtfs desactived
|
||||
|
@@ -2,12 +2,13 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- checkfs-dmraid started }
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" USEDMRAID USEDMRAID
|
||||
foreground {
|
||||
if { s6-test $USEDMRAID = yes }
|
||||
if { s6-test -x /usr/bin/dmraid }
|
||||
dmraid -i -ay
|
||||
ifelse -X { s6-test $USEDMRAID = yes }
|
||||
{
|
||||
if { s6-test -x /usr/bin/dmraid }
|
||||
if { s6-echo -- checkfs-dmraid started }
|
||||
foreground { dmraid -i -ay }
|
||||
s6-echo -- checkfs-dmraid successfully started
|
||||
}
|
||||
s6-echo -- checkfs-dmraid successfully started
|
||||
s6-echo -- checkfs-dmraid desactived
|
||||
|
@@ -2,20 +2,20 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- checkfs-fsckeck started }
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" FORCECHCK FORCECHCK
|
||||
foreground {
|
||||
if { s6-test $FORCECHCK = yes }
|
||||
redirfd -w 1 /dev/console
|
||||
if { s6-echo -- Check of filesystem was asked, please wait }
|
||||
foreground { fsck -A -T -a -f noopts=_netdev }
|
||||
s6-echo -- Filesystem checked
|
||||
ifelse -X { s6-test $FORCECHCK = yes }
|
||||
{
|
||||
redirfd -w 1 /dev/console
|
||||
if { s6-echo -- Check of filesystem was asked, please wait }
|
||||
foreground { fsck -A -T -a -f noopts=_netdev }
|
||||
s6-echo -- Filesystem checked
|
||||
}
|
||||
|
||||
# if partition is checked, fsck return a fail exit
|
||||
# and a crash occurs, so whatever happens with fsck, the output need to be a success
|
||||
if -t {
|
||||
foreground { fsck -A -T -a noopts=_netdev }
|
||||
if { s6-echo -- checkfs-fsckeck started }
|
||||
fsck -A -T -a noopts=_netdev
|
||||
}
|
||||
s6-echo -- checkfs-fscheck successfully started
|
||||
|
@@ -4,18 +4,19 @@ s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" USELVM USELVM
|
||||
foreground {
|
||||
if { s6-test $USELVM = yes }
|
||||
if { s6-echo -- checkfs-lvm started }
|
||||
foreground {
|
||||
if -nt { s6-test -d /run/lvm }
|
||||
s6-mkdir /run/lvm
|
||||
ifelse -X { s6-test $USELVM = yes }
|
||||
{
|
||||
if { s6-echo -- checkfs-lvm started }
|
||||
foreground {
|
||||
if -nt { s6-test -d /run/lvm }
|
||||
s6-mkdir /run/lvm
|
||||
}
|
||||
if { /usr/bin/lvmetad -p /run/lvm/lvmetad.pid }
|
||||
foreground {
|
||||
if { /usr/bin/vgscan }
|
||||
/usr/bin/vgchange -ay
|
||||
}
|
||||
foreground { pkill lvmetad }
|
||||
s6-echo -- lvm-prepare successfully started
|
||||
}
|
||||
if { /usr/bin/lvmetad -p /run/lvm/lvmetad.pid }
|
||||
foreground {
|
||||
if { /usr/bin/vgscan }
|
||||
/usr/bin/vgchange -ay
|
||||
}
|
||||
pkill lvmetad
|
||||
}
|
||||
s6-echo -- lvm-prepare successfully started
|
||||
s6-echo -- lvm-prepare desactived
|
||||
|
@@ -2,20 +2,23 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- rofs-cgroups started }
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" CGROUPS CGROUPS
|
||||
foreground {
|
||||
if { s6-test $CGROUPS = yes }
|
||||
if { mkdir -p -m 0755 /sys/fs/cgroup }
|
||||
if { s6-mount -wt tmpfs cgroup /sys/fs/cgroup }
|
||||
redirfd -r 0 /proc/cgroups
|
||||
pipeline { s6-tail -n +2 }
|
||||
pipeline { s6-cut -d"\t" -f1 }
|
||||
pipeline { s6-grep -vF -- devices }
|
||||
forstdin -d"\n" -- i
|
||||
importas -u -D "" i i
|
||||
if { s6-mkdir /sys/fs/cgroup/${i} }
|
||||
s6-mount -t cgroup -o ${i} -- cgroup /sys/fs/cgroup/${i}
|
||||
}
|
||||
s6-echo -- rofs-cgroups successfully started
|
||||
ifelse -X { s6-test $CGROUPS = yes }
|
||||
{
|
||||
foreground {
|
||||
if { s6-echo -- rofs-cgroups started }
|
||||
if { mkdir -p -m 0755 /sys/fs/cgroup }
|
||||
if { s6-mount -wt tmpfs cgroup /sys/fs/cgroup }
|
||||
redirfd -r 0 /proc/cgroups
|
||||
pipeline { s6-tail -n +2 }
|
||||
pipeline { s6-cut -d"\t" -f1 }
|
||||
pipeline { s6-grep -vF -- devices }
|
||||
forstdin -d"\n" -- i
|
||||
importas -u -D "" i i
|
||||
if { s6-mkdir /sys/fs/cgroup/${i} }
|
||||
foreground { s6-mount -t cgroup -o ${i} -- cgroup /sys/fs/cgroup/${i} }
|
||||
}
|
||||
s6-echo -- rofs-cgroups successfully started
|
||||
}
|
||||
s6-echo -- rofs-cgroups desactived
|
||||
|
@@ -2,13 +2,14 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- rofs-kernruntime started }
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" KERNELRUNTIME KERNELRUNTIME
|
||||
foreground {
|
||||
if { s6-test $KERNELRUNTIME = yes }
|
||||
if { s6-test -x /usr/bin/sysctl }
|
||||
if { s6-test -e /etc/sysctl.conf }
|
||||
sysctl -p /etc/sysctl.conf
|
||||
}
|
||||
s6-echo -- rofs-kernruntime successfully started
|
||||
ifelse -X { s6-test $KERNELRUNTIME = yes }
|
||||
{
|
||||
if { s6-test -x /usr/bin/sysctl }
|
||||
if { s6-test -e /etc/sysctl.conf }
|
||||
if { s6-echo -- rofs-kernruntime started }
|
||||
foreground { sysctl -p /etc/sysctl.conf }
|
||||
s6-echo -- rofs-kernruntime successfully started
|
||||
}
|
||||
s6-echo -- rofs-kernruntime desactived
|
||||
|
@@ -2,15 +2,16 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- rofs-modules started }
|
||||
foreground {
|
||||
if { s6-test -e ${S6CONF}/MODULES }
|
||||
redirfd -r 0 ${S6CONF}/MODULES
|
||||
forstdin -n -- mods
|
||||
importas -ui -D "" mods mods
|
||||
foreground {
|
||||
if { s6-test -n $mods }
|
||||
modprobe -ab $mods
|
||||
ifelse -X { s6-test -e ${S6CONF}/MODULES }
|
||||
{
|
||||
if { s6-echo -- rofs-modules started }
|
||||
redirfd -r 0 ${S6CONF}/MODULES
|
||||
forstdin -n -- mods
|
||||
importas -ui -D "" mods mods
|
||||
foreground {
|
||||
if { s6-test -n $mods }
|
||||
modprobe -ab $mods
|
||||
}
|
||||
s6-echo -- rofs-modules successfully started
|
||||
}
|
||||
}
|
||||
s6-echo -- rofs-modules successfully started
|
||||
s6-echo -- rofs-modules desactived
|
||||
|
@@ -2,11 +2,12 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- rofs-swap started }
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" USESWAP USESWAP
|
||||
foreground {
|
||||
if { s6-test $USESWAP = yes }
|
||||
swapon -a
|
||||
}
|
||||
s6-echo -- rofs-swap successfully started
|
||||
ifelse -X { s6-test $USESWAP = yes }
|
||||
{
|
||||
if { s6-echo -- rofs-swap started }
|
||||
foreground { swapon -a }
|
||||
s6-echo -- rofs-swap successfully started
|
||||
}
|
||||
s6-echo -- rofs-swap desactived
|
||||
|
2
boot-rc-serv/rwfs-ip6tables/dependencies
Normal file
2
boot-rc-serv/rwfs-ip6tables/dependencies
Normal file
@@ -0,0 +1,2 @@
|
||||
rwfs-fsrw
|
||||
|
13
boot-rc-serv/rwfs-ip6tables/down
Normal file
13
boot-rc-serv/rwfs-ip6tables/down
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/local/bin/execlineb -P
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
s6-envdir ${S6CONF}
|
||||
importas -i -D "" IP6TABLES IP6TABLES
|
||||
|
||||
if { s6-test $IP6TABLES = yes }
|
||||
foreground {
|
||||
if { s6-echo -- Flushing ip6tables }
|
||||
/usr/lib/iptables/scripts/iptables-flush 6
|
||||
}
|
||||
s6-echo -- Ip6tables flushed
|
15
boot-rc-serv/rwfs-ip6tables/up
Normal file
15
boot-rc-serv/rwfs-ip6tables/up
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/local/bin/execlineb -P
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" IP6TABLES IP6TABLES
|
||||
|
||||
ifelse -X { s6-test $IP6TABLES = yes }
|
||||
{
|
||||
if { s6-test -e /etc/iptables/ip6tables.rules }
|
||||
if { s6-echo -- Activing ip6tables }
|
||||
foreground { ip6tables-restore /etc/iptables/ip6tables.rules }
|
||||
s6-echo -- Ip6tables actived
|
||||
}
|
||||
s6-echo -- rwfs-ip6tables desactived
|
@@ -4,16 +4,10 @@ s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
s6-envdir ${S6CONF}
|
||||
importas -i -D "" IPTABLES IPTABLES
|
||||
importas -i -D "" IP6TABLES IP6TABLES
|
||||
foreground {
|
||||
if { s6-test $IPTABLES = yes }
|
||||
|
||||
if { s6-test $IPTABLES = yes }
|
||||
foreground {
|
||||
if { s6-echo -- Flushing iptables }
|
||||
/usr/lib/iptables/scripts/iptables-flush
|
||||
|
||||
}
|
||||
foreground {
|
||||
if { s6-test $IP6TABLES = yes }
|
||||
if { s6-echo -- Flushing ip6tables }
|
||||
/usr/lib/iptables/scripts/iptables-flush 6
|
||||
}
|
||||
s6-echo -- Iptables flushed
|
||||
|
@@ -2,22 +2,14 @@
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- rwfs-iptables started }
|
||||
s6-envdir ${S6CONF}
|
||||
importas -D "" IPTABLES IPTABLES
|
||||
importas -D "" IP6TABLES IP6TABLES
|
||||
foreground {
|
||||
if { s6-test $IPTABLES = yes }
|
||||
if { s6-test -e /etc/iptables/iptables.rules }
|
||||
if { s6-echo -- Activing iptables }
|
||||
foreground { iptables-restore /etc/iptables/iptables.rules }
|
||||
s6-echo -- Iptables actived
|
||||
}
|
||||
foreground {
|
||||
if { s6-test $IP6TABLES = yes }
|
||||
if { s6-test -e /etc/iptables/ip6tables.rules }
|
||||
if { s6-echo -- Activing ip6tables }
|
||||
foreground { ip6tables-restore /etc/iptables/ip6tables.rules }
|
||||
s6-echo -- Ip6tables actived
|
||||
}
|
||||
s6-echo -- rwfs-iptables successfully started
|
||||
|
||||
ifelse -X { s6-test $IPTABLES = yes }
|
||||
{
|
||||
if { s6-test -e /etc/iptables/iptables.rules }
|
||||
if { s6-echo -- Activing iptables }
|
||||
foreground { iptables-restore /etc/iptables/iptables.rules }
|
||||
s6-echo -- Iptables actived
|
||||
}
|
||||
s6-echo -- rwfs-iptables desactived
|
||||
|
@@ -1,25 +0,0 @@
|
||||
#!/usr/local/bin/execlineb -P
|
||||
fdmove -c 2 1
|
||||
s6-envdir -if /etc/s6/base-env
|
||||
importas -i -D "" S6CONF S6CONF
|
||||
if { s6-echo -- s6-conf started }
|
||||
# parse s6.conf before loading environment
|
||||
foreground {
|
||||
redirfd -r 0 /etc/s6/s6.conf
|
||||
pipeline { s6-grep -vF -- "#" }
|
||||
forstdin -nCd"\n" -- conf
|
||||
importas -ui -D "" conf conf
|
||||
multidefine -d"=" $conf { var value }
|
||||
foreground {
|
||||
if { mkdir -p ${S6CONF}/ }
|
||||
redirfd -w 1 ${S6CONF}/$var
|
||||
s6-echo -- $value
|
||||
}
|
||||
}
|
||||
# load hostname for earlier tty
|
||||
foreground {
|
||||
s6-envdir ${S6CONF}
|
||||
importas -i -D "" HOSTNAME HOSTNAME
|
||||
s6-hostname ${HOSTNAME}
|
||||
}
|
||||
s6-echo -- s6-conf successfully started
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user