19 Commits

Author SHA1 Message Date
obarun
ef93123fc6 fix README 2017-07-14 11:40:55 +11:00
obarun
96c517fbb6 rebuild database 2017-07-12 16:32:53 +11:00
obarun
928bcb559f separate ip6tables from iptables service 2017-07-12 16:32:21 +11:00
obarun
e2d67d7c8c rebuild the database 2017-07-12 14:01:42 +11:00
obarun
a483e72826 change output to reflect the choice on s6.conf 2017-07-12 14:00:42 +11:00
obarun
5aa4632678 remove s6-conf service and implement it on 00 service 2017-07-12 14:00:07 +11:00
obarun
c7d9be62f8 rebuild default compiled database 2017-06-21 13:06:20 +11:00
obarun
608df4bd47 replace deprecated import by importas command on rwfs-iptables/down file 2017-06-21 13:04:23 +11:00
obarun
c32cc76462 fix setfont command line 2017-06-21 13:02:54 +11:00
obarun
065c79b9ff replace absolute path by variable 2017-06-21 12:25:35 +11:00
obarun
97f13d2f1a add s6-conf file parsing as oneshot service 2017-06-21 12:25:13 +11:00
obarun
983d28ae45 replace absolute path by variable 2017-06-21 12:23:02 +11:00
obarun
1470fda317 add delay on tty to let the time to have the hostname set 2017-06-21 12:21:23 +11:00
obarun
9e41be013b reorganize environment variable 2017-06-21 12:17:55 +11:00
obarun
b53a85ef5c stage2 stage2.tini, replace absolute path by variable 2017-06-21 12:14:36 +11:00
obarun
3790871455 translate poweroff and reboot file on execlineb script 2017-06-21 12:12:34 +11:00
obarun
4aece292a1 init : replace absolute path by variable, remove s6.conf file parsing 2017-06-21 12:04:46 +11:00
obarun
ce00a75a25 rebuild default database 2017-03-28 10:05:31 +04:00
obarun
473a622f41 replace import command by importas 2017-03-28 09:58:26 +04:00
78 changed files with 286 additions and 204 deletions

View File

@@ -1,4 +1,4 @@
# s6-boot # s6-boot
Boot files for s6 Boot files for s6
For instructions about S6 supervision suite : http://skarnet.org/software/ 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
base-env/DESTBOOTSERV Normal file
View File

@@ -0,0 +1 @@
/run/boot

1
base-env/DESTRCSERV Normal file
View File

@@ -0,0 +1 @@
/run/boot-rc

1
base-env/S6CONF Normal file
View File

@@ -0,0 +1 @@
/run/s6-conf

1
base-env/SRCRCCOMPILED Normal file
View File

@@ -0,0 +1 @@
/etc/s6/compiled

1
base-env/SRCRCSERV Normal file
View File

@@ -0,0 +1 @@
/etc/s6/boot-rc-serv

View File

@@ -1,16 +1,14 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- 00 started } if { s6-echo -- 00 started }
s6-envdir /etc/s6/env/s6-conf foreground { if { s6-echo -- Mounting filesystem }
# mount proc sys dev run if doesn't exist # mount proc sys dev run if doesn't exist
#import -i HOSTNAME
#if { s6-hostname $HOSTNAME }
foreground { foreground {
forx -p first { proc sys dev run } forx -p first { proc sys dev run }
importas -ui -D "" first first importas -ui -D "" first first
foreground { foreground {
if -n { mountpoint -q /$first } if -n { mountpoint -q /$first }
s6-envdir /etc/s6/env/mount/$first s6-envdir /etc/s6/filesystem-env/$first
importas -ui -D "" fstype fstype importas -ui -D "" fstype fstype
importas -ui -D "" device device importas -ui -D "" device device
importas -ui -D "" mountpoint mountpoint importas -ui -D "" mountpoint mountpoint
@@ -38,7 +36,7 @@ if {
foreground { foreground {
if -n { mountpoint -q /dev/$third } if -n { mountpoint -q /dev/$third }
if { s6-mkdir -p -m 0755 /dev/$third } if { s6-mkdir -p -m 0755 /dev/$third }
s6-envdir /etc/s6/env/mount/$third s6-envdir /etc/s6/filesystem-env/$third
importas -ui -D "" fstype fstype importas -ui -D "" fstype fstype
importas -ui -D "" device device importas -ui -D "" device device
importas -ui -D "" mountpoint mountpoint importas -ui -D "" mountpoint mountpoint
@@ -47,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

View File

@@ -1,3 +1,3 @@
00
all-Boot all-Boot
#all-User
all-Switch all-Switch

View File

@@ -1,4 +1,3 @@
00
rofs-cgroups rofs-cgroups
rofs-kernmod rofs-kernmod
rofs-console rofs-console

View File

@@ -2,6 +2,7 @@ rwfs-fsrw
rwfs-tmpdir rwfs-tmpdir
rwfs-loopback rwfs-loopback
rwfs-iptables rwfs-iptables
rwfs-ip6tables
rwfs-nonetwork rwfs-nonetwork
rwfs-localtime rwfs-localtime
rwfs-random rwfs-random

View File

@@ -1,12 +1,14 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- checkfs-brtfs started } s6-envdir -if /etc/s6/base-env
s6-envdir /etc/s6/env/s6-conf importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" USEBTRFS USEBTRFS importas -D "" USEBTRFS USEBTRFS
foreground { ifelse -X { s6-test $USEBTRFS = yes }
if { s6-test $USEBTRFS = yes } {
if { s6-test -x /usr/bin/btrfs } if { s6-test -x /usr/bin/btrfs }
btrfs device scan if { s6-echo -- checkfs-brtfs started }
} foreground { btrfs device scan }
s6-echo -- checkfs-brtfs successfully started s6-echo -- checkfs-brtfs successfully started
}
s6-echo -- checkfs-brtfs desactived

View File

@@ -1,12 +1,14 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- checkfs-dmraid started } s6-envdir -if /etc/s6/base-env
s6-envdir /etc/s6/env/s6-conf importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" USEDMRAID USEDMRAID importas -D "" USEDMRAID USEDMRAID
foreground { ifelse -X { s6-test $USEDMRAID = yes }
if { s6-test $USEDMRAID = yes } {
if { s6-test -x /usr/bin/dmraid } if { s6-test -x /usr/bin/dmraid }
dmraid -i -ay 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

View File

@@ -1,19 +1,21 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- checkfs-fsckeck started } s6-envdir -if /etc/s6/base-env
s6-envdir /etc/s6/env/s6-conf importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" FORCECHCK FORCECHCK importas -D "" FORCECHCK FORCECHCK
foreground { ifelse -X { s6-test $FORCECHCK = yes }
if { s6-test $FORCECHCK = yes } {
redirfd -w 1 /dev/console redirfd -w 1 /dev/console
if { s6-echo -- Check of filesystem was asked, please wait } if { s6-echo -- Check of filesystem was asked, please wait }
foreground { fsck -A -T -a -f noopts=_netdev } foreground { fsck -A -T -a -f noopts=_netdev }
s6-echo -- Filesystem checked s6-echo -- Filesystem checked
} }
# if partition is checked, fsck return a fail exit # 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 # and a crash occurs, so whatever happens with fsck, the output need to be a success
if -t { 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 s6-echo -- checkfs-fscheck successfully started

View File

@@ -1,19 +1,22 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
s6-envdir /etc/s6/env/s6-conf s6-envdir -if /etc/s6/base-env
importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" USELVM USELVM importas -D "" USELVM USELVM
foreground { ifelse -X { s6-test $USELVM = yes }
if { s6-test $USELVM = yes } {
if { s6-echo -- checkfs-lvm started } if { s6-echo -- checkfs-lvm started }
foreground { foreground {
if -nt { s6-test -d /run/lvm } if -nt { s6-test -d /run/lvm }
s6-mkdir /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 } s6-echo -- lvm-prepare desactived
foreground {
if { /usr/bin/vgscan }
/usr/bin/vgchange -ay
}
pkill lvmetad
}
s6-echo -- lvm-prepare successfully started

View File

@@ -1,20 +1,24 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- rofs-cgroups started } s6-envdir -if /etc/s6/base-env
s6-envdir /etc/s6/env/s6-conf importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" CGROUPS CGROUPS importas -D "" CGROUPS CGROUPS
foreground { ifelse -X { s6-test $CGROUPS = yes }
if { s6-test $CGROUPS = yes } {
if { mkdir -p -m 0755 /sys/fs/cgroup } foreground {
if { s6-mount -wt tmpfs cgroup /sys/fs/cgroup } if { s6-echo -- rofs-cgroups started }
redirfd -r 0 /proc/cgroups if { mkdir -p -m 0755 /sys/fs/cgroup }
pipeline { s6-tail -n +2 } if { s6-mount -wt tmpfs cgroup /sys/fs/cgroup }
pipeline { s6-cut -d"\t" -f1 } redirfd -r 0 /proc/cgroups
pipeline { s6-grep -vF -- devices } pipeline { s6-tail -n +2 }
forstdin -d"\n" -- i pipeline { s6-cut -d"\t" -f1 }
importas -u -D "" i i pipeline { s6-grep -vF -- devices }
if { s6-mkdir /sys/fs/cgroup/${i} } forstdin -d"\n" -- i
s6-mount -t cgroup -o ${i} -- cgroup /sys/fs/cgroup/${i} importas -u -D "" i i
} if { s6-mkdir /sys/fs/cgroup/${i} }
s6-echo -- rofs-cgroups successfully started foreground { s6-mount -t cgroup -o ${i} -- cgroup /sys/fs/cgroup/${i} }
}
s6-echo -- rofs-cgroups successfully started
}
s6-echo -- rofs-cgroups desactived

View File

@@ -1,19 +1,19 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
s6-envdir -if /etc/s6/base-env
importas -i -D "" S6CONF S6CONF
if { s6-echo -- rofs-console started } if { s6-echo -- rofs-console started }
s6-envdir ${S6CONF}
s6-envdir /etc/s6/env/s6-conf importas -D "" KEYMAP KEYMAP
import -D "" KEYMAP importas -D "" FONT FONT
import -D "" FONT importas -D "" FONT_MAP FONT_MAP
import -D "" FONT_MAP importas -D "" FONT_UNIMAP FONT_UNIMAP
import -D "" FONT_UNIMAP
foreground { foreground {
loadkeys -q -u $KEYMAP loadkeys -q -u $KEYMAP
} }
foreground { foreground {
forx index { 0 1 2 3 4 5 6 7 8 9 10 } forx index { 0 1 2 3 4 5 6 7 8 9 10 }
importas -u -D "" index index importas -u -D "" index index
setfont -m $FONT_MAP -u $FONT_UNIMAP $FONT -C /dev/tty${index} exec bash -c "setfont ${FONT_MAP:+-m $FONT_MAP} ${FONT_UNIMAP:+-u $FONT_UNIMAP} $FONT -C /dev/tty${index}"
} }
s6-echo -- rofs-console successfully started s6-echo -- rofs-console successfully started

View File

@@ -1,11 +1,12 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
s6-envdir -if /etc/s6/base-env
importas -i -D "" S6CONF S6CONF
if { s6-echo -- rofs-hardclock started } if { s6-echo -- rofs-hardclock started }
foreground { foreground {
s6-envdir /etc/s6/env/s6-conf s6-envdir ${S6CONF}
import -D "" TZ importas -D "" TZ TZ
import -D "" HARDWARECLOCK importas -D "" HARDWARECLOCK HARDWARECLOCK
pipeline -d { echo $HARDWARECLOCK } pipeline -d { echo $HARDWARECLOCK }
pipeline { tr A-Z a-z } pipeline { tr A-Z a-z }
forstdin -- clock forstdin -- clock

View File

@@ -1,13 +1,15 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- rofs-kernruntime started } s6-envdir -if /etc/s6/base-env
s6-envdir /etc/s6/env/s6-conf importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" KERNELRUNTIME KERNELRUNTIME importas -D "" KERNELRUNTIME KERNELRUNTIME
foreground { ifelse -X { s6-test $KERNELRUNTIME = yes }
if { s6-test $KERNELRUNTIME = yes } {
if { s6-test -x /usr/bin/sysctl } if { s6-test -x /usr/bin/sysctl }
if { s6-test -e /etc/sysctl.conf } if { s6-test -e /etc/sysctl.conf }
sysctl -p /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 successfully started
}
s6-echo -- rofs-kernruntime desactived

View File

@@ -1,15 +1,17 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- rofs-modules started } s6-envdir -if /etc/s6/base-env
foreground { importas -i -D "" S6CONF S6CONF
if { s6-test -e /etc/s6/env/s6-conf/MODULES } ifelse -X { s6-test -e ${S6CONF}/MODULES }
redirfd -r 0 /etc/s6/env/s6-conf/MODULES {
forstdin -n -- mods if { s6-echo -- rofs-modules started }
importas -ui -D "" mods mods redirfd -r 0 ${S6CONF}/MODULES
foreground { forstdin -n -- mods
if { s6-test -n $mods } importas -ui -D "" mods mods
modprobe -ab $mods foreground {
if { s6-test -n $mods }
modprobe -ab $mods
}
s6-echo -- rofs-modules successfully started
} }
} s6-echo -- rofs-modules desactived
s6-echo -- rofs-modules successfully started

View File

@@ -1,11 +1,13 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- rofs-swap started } s6-envdir -if /etc/s6/base-env
s6-envdir /etc/s6/env/s6-conf importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" USESWAP USESWAP importas -D "" USESWAP USESWAP
foreground { ifelse -X { s6-test $USESWAP = yes }
if { s6-test $USESWAP = yes } {
swapon -a if { s6-echo -- rofs-swap started }
} foreground { swapon -a }
s6-echo -- rofs-swap successfully started s6-echo -- rofs-swap successfully started
}
s6-echo -- rofs-swap desactived

View File

@@ -0,0 +1,2 @@
rwfs-fsrw

View 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

View File

@@ -0,0 +1 @@
oneshot

View 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

View File

@@ -1,17 +1,13 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
s6-envdir /etc/s6/env/s6-conf s6-envdir -if /etc/s6/base-env
import -D "" IPTABLES importas -i -D "" S6CONF S6CONF
import -D "" IP6TABLES s6-envdir ${S6CONF}
foreground { importas -i -D "" IPTABLES IPTABLES
if { s6-test $IPTABLES = yes }
if { s6-test $IPTABLES = yes }
foreground {
if { s6-echo -- Flushing iptables } if { s6-echo -- Flushing iptables }
/usr/lib/iptables/scripts/iptables-flush /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 s6-echo -- Iptables flushed

View File

@@ -1,22 +1,15 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if { s6-echo -- rwfs-iptables started } s6-envdir -if /etc/s6/base-env
s6-envdir /etc/s6/env/s6-conf importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" IPTABLES IPTABLES importas -D "" IPTABLES IPTABLES
importas -D "" IP6TABLES IP6TABLES
foreground { ifelse -X { s6-test $IPTABLES = yes }
if { s6-test $IPTABLES = yes } {
if { s6-test -e /etc/iptables/iptables.rules } if { s6-test -e /etc/iptables/iptables.rules }
if { s6-echo -- Activing iptables } if { s6-echo -- Activing iptables }
foreground { iptables-restore /etc/iptables/iptables.rules } foreground { iptables-restore /etc/iptables/iptables.rules }
s6-echo -- Iptables actived s6-echo -- Iptables actived
} }
foreground { s6-echo -- rwfs-iptables desactived
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

View File

@@ -1,8 +1,9 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
s6-envdir -if /etc/s6/base-env
importas -i -D "" S6CONF S6CONF
if { s6-echo -- rwfs-localtime started } if { s6-echo -- rwfs-localtime started }
s6-envdir /etc/s6/env/s6-conf s6-envdir ${S6CONF}
importas -D "" TZ TZ importas -D "" TZ TZ
if { s6-ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime } if { s6-ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime }
s6-echo -- rwfs-localtime successfully started s6-echo -- rwfs-localtime successfully started

View File

@@ -1,6 +1,8 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
s6-envdir /etc/s6/env/s6-conf s6-envdir -if /etc/s6/base-env
importas -i -D "" S6CONF S6CONF
s6-envdir ${S6CONF}
importas -D "" S6LOCAL S6LOCAL importas -D "" S6LOCAL S6LOCAL
ifelse -X { s6-test $S6LOCAL = yes } ifelse -X { s6-test $S6LOCAL = yes }
{ exec -c /etc/s6/data/scripts/s6.local } { exec -c /etc/s6/data/scripts/s6.local }

View File

@@ -1,5 +1,13 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
fdmove -c 2 1 fdmove -c 2 1
if {
foreground {
if -n { s6-test -d /run/user/uncaught-logs }
s6-mkdir -p -m 0755 /run/user/uncaught-logs
}
}
redirfd -an 1 /run/user/uncaught-logs/fifo
fdmove -c 2 1
if { s6-echo -- switch-user started } if { s6-echo -- switch-user started }
if { s6-rc-init -c /etc/s6-serv/enabled/rc/compiled/current -l /run/user-rc /run/user/service } if { s6-rc-init -c /etc/s6-serv/enabled/rc/compiled/current -l /run/user-rc /run/user/service }
if { s6-rc -l /run/user-rc -u change All } if { s6-rc -l /run/user-rc -u change All }

View File

@@ -1,4 +1,5 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
foreground { /etc/s6/stage2.tini } foreground { /etc/s6/stage2.tini }
s6-svscanctl -h -- /run/boot/service s6-svscanctl -h -- ${DESTBOOTSERV}/service

View File

@@ -1,4 +1,5 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
foreground { /etc/s6/stage2.tini } foreground { /etc/s6/stage2.tini }
s6-svscanctl -6 -- /run/boot/service s6-svscanctl -6 -- ${DESTBOOTSERV}/service

View File

@@ -1,4 +1,5 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
foreground { /etc/s6/stage2.tini } foreground { /etc/s6/stage2.tini }
s6-svscanctl -q -- /run/boot/service s6-svscanctl -q -- ${DESTBOOTSERV}/service

View File

@@ -1,4 +1,5 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
foreground { /etc/s6/stage2.tini } foreground { /etc/s6/stage2.tini }
s6-svscanctl -t -- /run/boot/service s6-svscanctl -t -- ${DESTBOOTSERV}/service

View File

@@ -1,3 +1,4 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
s6-envdir -if /etc/s6/base-env
s6-svscanctl -an -- /run/boot/service importas -i -D "" DESTBOOTSERV DESTBOOTSERV
s6-svscanctl -an -- ${DESTBOOTSERV}/service

View File

@@ -1,4 +1,5 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
foreground { /etc/s6/stage2.tini } foreground { /etc/s6/stage2.tini }
s6-svscanctl -7 -- /run/boot/service s6-svscanctl -7 -- ${DESTBOOTSERV}/service

View File

@@ -1,9 +1,10 @@
#!/usr/local/bin/execlineb -S0 #!/usr/local/bin/execlineb -S0
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
cd / cd /
redirfd -w 2 /dev/console redirfd -w 2 /dev/console
fdmove -c 1 2 fdmove -c 1 2
foreground { s6-svc -X -- /run/boot/service/s6-svscan-log } foreground { s6-svc -X -- ${DESTBOOTSERV}/service/s6-svscan-log }
unexport ? unexport ?
wait -r -- { } wait -r -- { }
/etc/s6/stage3 ${@} /etc/s6/stage3 ${@}

View File

@@ -1,8 +1,9 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
redirfd -w 2 /dev/console redirfd -w 2 /dev/console
fdmove -c 1 2 fdmove -c 1 2
#redirfd -w 1 /dev/null #redirfd -w 1 /dev/null
redirfd -rnb 0 fifo redirfd -rnb 0 fifo
s6-applyuidgid -u 19 -g 19 -- s6-applyuidgid -u 19 -g 19 --
s6-log -bp -- t /run/boot/uncaught-logs s6-log -bp -- t ${DESTBOOTSERV}/uncaught-logs

View File

@@ -1,3 +1,3 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
/usr/bin/agetty -J 38400 tty1 /usr/bin/agetty --delay 02 -J 38400 tty1

View File

@@ -1,3 +1,3 @@
#!/usr/local/bin/execlineb -P #!/usr/local/bin/execlineb -P
/usr/bin/agetty -J 38400 tty2 /usr/bin/agetty --delay 02 -J 38400 tty2

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -8,8 +8,9 @@ pipeline -dw --
} }
if -nt -- if -nt --
{ {
redirfd -r 0 ./data/autofilled
s6-ipcclient -l0 -- s s6-ipcclient -l0 -- s
/usr/libexec/s6-rc-fdholder-filler -1 -- /usr/libexec/s6-rc-fdholder-filler -1 --
} }
s6-svc -t . s6-svc -t .
} }

View File

@@ -4,5 +4,5 @@ fdmove 1 3
s6-ipcserver-socketbinder -- s s6-ipcserver-socketbinder -- s
s6-ipcserverd -1 -- s6-ipcserverd -1 --
s6-ipcserver-access -v0 -E -l0 -i data/rules -- s6-ipcserver-access -v0 -E -l0 -i data/rules --
s6-sudod -t 2000 -- s6-sudod -t 30000 --
/usr/libexec/s6-rc-oneshot-run -l ../.. -- /usr/libexec/s6-rc-oneshot-run -l ../.. --

1
env/s6-conf vendored
View File

@@ -1 +0,0 @@
/run/s6-conf

43
init
View File

@@ -14,35 +14,14 @@
# Export good path # Export good path
/usr/local/bin/export PATH "/usr/local/bin:/usr/bin" /usr/bin/s6-envdir -if /etc/s6/base-env
/usr/local/bin/importas -i -D "" PATH PATH
cd / /usr/local/bin/export PATH ${PATH}
# 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 /run/s6-conf/ }
redirfd -w 1 /run/s6-conf/$var
s6-echo -- $value
}
}
# load hostname for earlier tty
foreground {
s6-envdir /etc/s6/env/s6-conf
importas -i -D "" HOSTNAME HOSTNAME
s6-hostname ${HOSTNAME}
}
# Clean environment
emptyenv -p
s6-envdir -if /etc/s6/env
/usr/local/bin/cd /
# Be clean and safe # Be clean and safe
emptyenv -p
s6-setsid -qb -- s6-setsid -qb --
umask 022 umask 022
@@ -54,22 +33,24 @@ if {
} }
# Copy service for pid1 at the right place # Copy service for pid1 at the right place
importas -i -D "" BOOTSERV BOOTSERV s6-envdir -if /etc/s6/base-env
importas -i -D "" SRCBOOTSERV SRCBOOTSERV
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
foreground { foreground {
if { s6-hiercopy ${BOOTSERV} /run/boot } if { s6-hiercopy ${SRCBOOTSERV} ${DESTBOOTSERV} }
} }
redirfd -r 0 /dev/null redirfd -r 0 /dev/null
redirfd -wnb 1 /run/boot/service/s6-svscan-log/fifo redirfd -wnb 1 ${DESTBOOTSERV}/service/s6-svscan-log/fifo
# Now we are good for stage2, start it # Now we are good for stage2, start it
background { background {
s6-setsid -- s6-setsid --
redirfd -w 1 /run/boot/service/s6-svscan-log/fifo redirfd -w 1 ${DESTBOOTSERV}/service/s6-svscan-log/fifo
fdmove -c 2 1 fdmove -c 2 1
/etc/s6/stage2 /etc/s6/stage2
} }
unexport ! unexport !
fdmove -c 2 1 fdmove -c 2 1
s6-svscan -st0 /run/boot/service s6-svscan -st0 ${DESTBOOTSERV}/service

View File

@@ -1,3 +1,5 @@
#!/bin/bash #!/usr/local/bin/execlineb -P
exec /run/boot/service/.s6-svscan/SIGUSR2 s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
exec ${DESTBOOTSERV}/service/.s6-svscan/SIGUSR2

6
reboot
View File

@@ -1,3 +1,5 @@
#!/bin/bash #!/usr/local/bin/execlineb -P
exec /run/boot/service/.s6-svscan/SIGINT s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
exec ${DESTBOOTSERV}/service/.s6-svscan/SIGINT

10
stage2
View File

@@ -12,17 +12,21 @@
# can do whatever you want with this stuff. If we meet some day, and you think # can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Eric Vidal http://obarun.org # this stuff is worth it, you can buy me a beer in return. Eric Vidal http://obarun.org
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTRCSERV DESTRCSERV
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
importas -i -D "" SRCRCCOMPILED SRCRCCOMPILED
if -nt { if -nt {
if { s6-echo -- "***************************************************************************" } if { s6-echo -- "***************************************************************************" }
if { s6-echo -- "** Start Stage 2 **" } if { s6-echo -- "** Start Stage 2 **" }
if { s6-echo -- "***************************************************************************" } if { s6-echo -- "***************************************************************************" }
# start service # start service
if { s6-rc-init -l /run/boot-rc -c /etc/s6/compiled/current /run/boot/service } if { s6-rc-init -l ${DESTRCSERV} -c ${SRCRCCOMPILED}/current ${DESTBOOTSERV}/service }
if { s6-rc -l /run/boot-rc -u change All } if { s6-rc -l ${DESTRCSERV} -u change All }
if { s6-echo -- "***************************************************************************" } if { s6-echo -- "***************************************************************************" }
if { s6-echo -- "** Stage 2 completed **" } if { s6-echo -- "** Stage 2 completed **" }
s6-echo -- "***************************************************************************" s6-echo -- "***************************************************************************"
} }
redirfd -w 1 /dev/console redirfd -w 1 /dev/console
s6-echo "Something wrong on stage2, please see the log at /run/boot/uncaught-logs/current to debug it" s6-echo "Something wrong on stage2, please see the log at ${DESTBOOTSERV}/uncaught-logs/current to debug it"

View File

@@ -12,11 +12,15 @@
# can do whatever you want with this stuff. If we meet some day, and you think # can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Eric Vidal http://obarun.org # this stuff is worth it, you can buy me a beer in return. Eric Vidal http://obarun.org
s6-envdir -if /etc/s6/base-env
importas -i -D "" DESTRCSERV DESTRCSERV
importas -i -D "" S6CONF S6CONF
if { s6-echo -- "***************************************************************************" } if { s6-echo -- "***************************************************************************" }
if { s6-echo -- "** Start Tini shutdown **" } if { s6-echo -- "** Start Tini shutdown **" }
if { s6-echo -- "***************************************************************************" } if { s6-echo -- "***************************************************************************" }
cd / cd /
foreground { s6-rc -v 2 -l /run/boot-rc -da change } foreground { s6-rc -v 2 -l ${DESTRCSERV} -da change }
foreground { foreground {
backtick -n bytes { cat /proc/sys/kernel/random/poolsize } backtick -n bytes { cat /proc/sys/kernel/random/poolsize }
importas -u bytes bytes importas -u bytes bytes
@@ -33,7 +37,7 @@ foreground {
dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=$bytes dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=$bytes
} }
foreground { foreground {
s6-envdir /etc/s6/env/s6-conf s6-envdir ${S6CONF}
importas -u -D "" HARDWARECLOCK HARDWARECLOCK importas -u -D "" HARDWARECLOCK HARDWARECLOCK
pipeline -d { echo $HARDWARECLOCK } pipeline -d { echo $HARDWARECLOCK }
pipeline { tr A-Z a-z } pipeline { tr A-Z a-z }
@@ -42,7 +46,7 @@ foreground {
hwclock --systohc --${clock} hwclock --systohc --${clock}
} }
foreground { foreground {
s6-envdir /etc/s6/env/s6-conf s6-envdir ${S6CONF}
importas -u -D "" TMPDIR TMPDIR importas -u -D "" TMPDIR TMPDIR
if { s6-test $TMPDIR = yes } if { s6-test $TMPDIR = yes }
if { s6-echo -- Cleaning /tmp directory } if { s6-echo -- Cleaning /tmp directory }