Compare commits
101 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eabd7a1d34 | ||
![]() |
055e273ef3 | ||
![]() |
a9e36c549b | ||
![]() |
7bacf4802b | ||
![]() |
d210542eff | ||
![]() |
4891598c3b | ||
![]() |
5300a7ee74 | ||
![]() |
ff894f2bcf | ||
![]() |
879a40fc69 | ||
![]() |
b4d04ecceb | ||
![]() |
ae2e097a6b | ||
![]() |
77057205d7 | ||
![]() |
4d67a11ce9 | ||
![]() |
a66aea9840 | ||
![]() |
6712d7bef0 | ||
![]() |
731f9414f1 | ||
![]() |
e02c2138db | ||
![]() |
1f6ec5f2f2 | ||
![]() |
2632e962ea | ||
![]() |
c09e70e9e2 | ||
![]() |
d628070a7a | ||
![]() |
ad09fc9981 | ||
![]() |
20d43abe7f | ||
![]() |
fea3b2675c | ||
![]() |
2dfb3ac0ad | ||
![]() |
fb924ced4f | ||
![]() |
7008745393 | ||
![]() |
5a93f2ca81 | ||
![]() |
3cd9f46117 | ||
![]() |
f88b0f4eac | ||
![]() |
1c6c1ff259 | ||
![]() |
f5217e18ef | ||
![]() |
051dacc843 | ||
![]() |
d3ec2f001e | ||
![]() |
0594295927 | ||
![]() |
95e074768e | ||
![]() |
dbc7e4d1af | ||
![]() |
4e1e004af7 | ||
![]() |
53bc1c3f84 | ||
![]() |
ea871d703a | ||
![]() |
2b6b36c265 | ||
![]() |
9acfccfad5 | ||
![]() |
32eaffc776 | ||
![]() |
de179883e4 | ||
![]() |
59f5925d6b | ||
![]() |
b5f41908b3 | ||
![]() |
a72258985a | ||
![]() |
9f81864f69 | ||
![]() |
571079581d | ||
![]() |
5153867c5c | ||
![]() |
3edf09f112 | ||
![]() |
7cceba59ba | ||
![]() |
f443c45b58 | ||
![]() |
a02517cd6c | ||
![]() |
780ccf8ccf | ||
![]() |
69b9f7ec7f | ||
![]() |
a0f3aa87f3 | ||
![]() |
2859cd5fa4 | ||
![]() |
a29d97570b | ||
![]() |
4e0a612d6c | ||
![]() |
426afc67cb | ||
![]() |
16f76d0e89 | ||
![]() |
3e198ee09d | ||
![]() |
157561ff1a | ||
![]() |
ee63627f34 | ||
![]() |
8aa20b50f3 | ||
![]() |
aaf133355a | ||
![]() |
69b64ba057 | ||
![]() |
376d28df6f | ||
![]() |
ca57ac6852 | ||
![]() |
c7b42d7b02 | ||
![]() |
9e6b8bf1b5 | ||
![]() |
a8a8109903 | ||
![]() |
3289c6c736 | ||
![]() |
1d17321c9a | ||
![]() |
f2ed6b08ac | ||
![]() |
8a2cd0bd2a | ||
![]() |
638a03632d | ||
![]() |
c1f8e69e31 | ||
![]() |
1188fd5a02 | ||
![]() |
66ff1cd25a | ||
![]() |
5dd10c21ab | ||
![]() |
f02e3e77f6 | ||
![]() |
c39d4eaa9f | ||
![]() |
5118d345f5 | ||
![]() |
0fdfb07785 | ||
![]() |
71c69a3712 | ||
![]() |
6e9aa207a9 | ||
![]() |
776956629c | ||
![]() |
9c398628df | ||
![]() |
1e3db3d992 | ||
![]() |
d734920302 | ||
![]() |
45228a409b | ||
![]() |
b05eb70a1a | ||
![]() |
f0e4ef7e71 | ||
![]() |
76bd850f2e | ||
![]() |
6a3223a718 | ||
![]() |
9c034c223c | ||
![]() |
08d073fe82 | ||
![]() |
aa834f05e4 | ||
![]() |
e4a337d82d |
18
LICENSE
18
LICENSE
@@ -1,4 +1,14 @@
|
|||||||
# "THE BEERWARE LICENSE" (Revision 42):
|
Copyright (c) 2015-2018 Eric Vidal <eric@obarun.org>
|
||||||
# <eric@obarun.org> wrote this file. As long as you retain this notice you
|
All rights reserved.
|
||||||
# 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
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
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.
|
||||||
|
85
Makefile
Normal file
85
Makefile
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
# Makefile for s6-boot
|
||||||
|
|
||||||
|
VERSION = $$(git describe --tags| sed 's/-.*//g;s/^v//;')
|
||||||
|
PKGNAME = s6-boot
|
||||||
|
|
||||||
|
BINDIR_EXECLINE = /usr/local/bin
|
||||||
|
BINDIR = /usr/bin
|
||||||
|
|
||||||
|
CLASSIC = `find classic/ -type f`
|
||||||
|
DATA = `find data/scripts -type f`
|
||||||
|
RC = `find rc/ -type f`
|
||||||
|
FILESYSTEM = `find filesystem-env/ -type f`
|
||||||
|
ENV = `find env/ -type f`
|
||||||
|
|
||||||
|
DIRS= \
|
||||||
|
/usr/bin \
|
||||||
|
/etc/s6 \
|
||||||
|
/etc/s6/compiled \
|
||||||
|
/etc/s6/data/scripts \
|
||||||
|
/etc/s6/env \
|
||||||
|
/etc/s6/filesystem-env \
|
||||||
|
/etc/s6/rc \
|
||||||
|
/etc/s6/classic/service \
|
||||||
|
/etc/s6/classic/uncaught-logs \
|
||||||
|
/usr/share/zsh/site-functions \
|
||||||
|
/usr/share/licenses
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -dm755 $(addprefix $(DESTDIR),$(DIRS))
|
||||||
|
|
||||||
|
for i in $(CLASSIC) $(RC) init stage2 stage2.tini stage3 poweroff reboot ; do \
|
||||||
|
sed -i 's,@BINDIR_EXECLINE@,$(BINDIR_EXECLINE),' $$i; \
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $(DATA) shutdown $(CLASSIC); do \
|
||||||
|
sed -i 's,@BINDIR@,$(BINDIR),' $$i; \
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $(CLASSIC); do \
|
||||||
|
install -Dm755 $$i $(DESTDIR)/etc/s6/$$i; \
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $(RC); do \
|
||||||
|
install -Dm644 $$i $(DESTDIR)/etc/s6/$$i; \
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $(FILESYSTEM); do \
|
||||||
|
install -Dm644 $$i $(DESTDIR)/etc/s6/$$i;\
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $(ENV); do \
|
||||||
|
install -m644 $$i $(DESTDIR)/etc/s6/$$i; \
|
||||||
|
done
|
||||||
|
|
||||||
|
rm $(DESTDIR)/etc/s6/classic/uncaught-logs/README
|
||||||
|
|
||||||
|
install -m755 data/scripts/s6.local $(DESTDIR)/etc/s6/data/scripts/s6.local
|
||||||
|
ln -sf /etc/s6/data/scripts/s6.local $(DESTDIR)/etc/s6.local
|
||||||
|
install -m755 data/scripts/master.sh $(DESTDIR)/etc/s6/data/scripts/master.sh
|
||||||
|
install -m755 data/scripts/modules.sh $(DESTDIR)/etc/s6/data/scripts/modules.sh
|
||||||
|
install -m755 data/scripts/tmpfiles.sh $(DESTDIR)/etc/s6/data/scripts/tmpfiles.sh
|
||||||
|
|
||||||
|
cp -P -a compiled/default $(DESTDIR)/etc/s6/compiled/default
|
||||||
|
ln -sf /etc/s6/compiled/default $(DESTDIR)/etc/s6/compiled/current
|
||||||
|
ln -sf /etc/s6/compiled/default $(DESTDIR)/etc/s6/compiled/previous
|
||||||
|
|
||||||
|
install -m755 init $(DESTDIR)/$(BINDIR)
|
||||||
|
for i in stage2 stage2.tini stage3 reboot shutdown poweroff; do \
|
||||||
|
install -m755 $$i $(DESTDIR)/etc/s6/$$i;\
|
||||||
|
done
|
||||||
|
ln -sf /etc/s6/poweroff $(DESTDIR)/$(BINDIR)
|
||||||
|
ln -sf /etc/s6/reboot $(DESTDIR)/$(BINDIR)
|
||||||
|
ln -sf /etc/s6/shutdown $(DESTDIR)/$(BINDIR)
|
||||||
|
|
||||||
|
install -m644 s6.conf $(DESTDIR)/etc/s6
|
||||||
|
ln -sf /etc/s6/s6.conf $(DESTDIR)/etc/s6.conf
|
||||||
|
|
||||||
|
install -m644 _s6-svc $(DESTDIR)/usr/share/zsh/site-functions
|
||||||
|
|
||||||
|
install -Dm644 LICENSE $(DESTDIR)/usr/share/licenses/$(PKGNAME)/LICENSE
|
||||||
|
|
||||||
|
version:
|
||||||
|
@echo $(VERSION)
|
||||||
|
|
||||||
|
.PHONY: install version
|
70
NEWS
Normal file
70
NEWS
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
Changelog for s6-boot
|
||||||
|
|
||||||
|
In 0.2.1
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Bugs fix
|
||||||
|
- rc database for root is started at the same scandir than boot,
|
||||||
|
meaning /run/boot, with a prefix define at env/MASTER file.
|
||||||
|
- classic service for root used the same scandir than boot, meaning
|
||||||
|
/run/boot/service.
|
||||||
|
- data/scripts/user.sh : this file was renamed as master.sh and only
|
||||||
|
manage root supervision tree creation.
|
||||||
|
- S6.conf : new features TTY which allow to start multiple tty at
|
||||||
|
boot time.
|
||||||
|
- Earlier tty is now started at tty6 instead of tty2.
|
||||||
|
|
||||||
|
|
||||||
|
In 0.2.0
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Bugs fix
|
||||||
|
- Improve udevd and udevadm service
|
||||||
|
- Umount NFS4 system if exist on stage2.tini
|
||||||
|
|
||||||
|
In 0.1.9
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Bugs fix
|
||||||
|
|
||||||
|
In 0.1.8
|
||||||
|
--------
|
||||||
|
|
||||||
|
- add data/scripts/modules.sh : the variable MODULES at s6.conf was
|
||||||
|
removed. Modules are now loaded by this file with the rofs-modules
|
||||||
|
oneshot service which run the scripts data/scripts/modules.sh. This
|
||||||
|
scripts read, parse and load modules founded in files
|
||||||
|
/usr/lib/modules-load.d, /run/modules-load.d, and /etc/modules-load.d
|
||||||
|
the last supersedes the previous one.
|
||||||
|
- fix bug at rwfs-ip6tables at the shutdown process
|
||||||
|
- add rwfs-tmpfiles services : the file founded at /usr/lib/tmpfiles.d
|
||||||
|
is now parsed and applied at boot time. Those files create sub-directories
|
||||||
|
at /run directories.
|
||||||
|
- fix rwfs-end oneshot service
|
||||||
|
|
||||||
|
In 0.1.7
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Pass to ISC license
|
||||||
|
- S6opts is now a dependences of s6-boot
|
||||||
|
- Rename boot-serv directory to classic
|
||||||
|
- Rename boot-rc-serv directory to rc
|
||||||
|
- Rename base-env directory to env :
|
||||||
|
- rename DESTBOOTSERV to DEST
|
||||||
|
- rename DESTRCSERV to DESTRC : this variable point now to /run/boot/rc
|
||||||
|
- rename SRCBOOTSERV to SRC : this variable point now to /etc/s6/classic
|
||||||
|
- rename SRCRCCOMPILED to SRCRC
|
||||||
|
- remove SRCRCSERV
|
||||||
|
- add HANDLE : point to /etc/s6/data/scripts to find user.sh scripts
|
||||||
|
- add TEMPLATE : point to /usr/share/obarun/s6opts/template to find supervison tree creation scheme
|
||||||
|
- Modify files in classic/.s6-svscan to reflect the change into env/ directory
|
||||||
|
- Modify files init, stage2, stage2.tini, poweroff, shutdown, reboot to reflect the change into env/ directory
|
||||||
|
- Simplify stage2.tini : random-seed and hwclock command is now made by down file of respectively services
|
||||||
|
- Use *.conf files at _s6-svc to define path for completion
|
||||||
|
- Remove all-Switch bundle, switch-{user,svscan,ready} rc service and replace it by adduser service:
|
||||||
|
- the supervision tree for root user is now created by adduser service calling data/scripts/user.sh to do it
|
||||||
|
- Remove s6-serv directory (added to s6opts)
|
||||||
|
- Add data/scripts/user.sh scripts : This scripts allow to create a supervison tree whatever the user calling it.
|
||||||
|
The scripts source {s6opts,service}.conf to define path, name of the different elements of the supervision tree.
|
||||||
|
- Add Makefile
|
||||||
|
- Block tty1 service until boot procedure is not fully operational.
|
@@ -1,4 +1,9 @@
|
|||||||
# s6-boot
|
# s6-boot
|
||||||
Boot files for s6
|
|
||||||
For instructions about S6 supervision suite : http://skarnet.org/software/
|
|
||||||
|
|
||||||
|
Obarun boot files for s6
|
||||||
|
|
||||||
|
For instructions about [S6 supervision suite.](https://skarnet.org/software/)
|
||||||
|
|
||||||
|
[Bug reports](https://forum.obarun.org)
|
||||||
|
|
||||||
|
|
||||||
|
25
_s6-svc
25
_s6-svc
@@ -1,11 +1,28 @@
|
|||||||
#compdef s6-svc
|
#compdef s6-svc
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
# completion for s6-svc
|
# completion for s6-svc
|
||||||
# Copyright (C) 2015-2017 Eric Vidal <eric@obarun.org>
|
# Change the path variable to suit your needs.
|
||||||
# services in /run/s6/service. Change the path variable to suit your needs.
|
|
||||||
|
first_word=${${(z)BUFFER}[1]}
|
||||||
|
|
||||||
|
#overwrite config with user specification
|
||||||
|
|
||||||
|
if [[ $first_word == "sudo" ]] || [[ $first_word == "su" ]] || [[ $EUID == 0 ]]; then
|
||||||
|
source /etc/obarun/s6opts.conf
|
||||||
|
else
|
||||||
|
source $(getent passwd $(whoami)|cut -d : -f 6)/service/service.conf
|
||||||
|
fi
|
||||||
|
|
||||||
path_dir_boot=/run/boot/service
|
path_dir_boot=/run/boot/service
|
||||||
path_dir_user=/run/user/service
|
path_dir_user=${LIVE_CLASSIC_PATH}
|
||||||
|
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
@@ -13,7 +30,7 @@ _path() {
|
|||||||
local list_dir
|
local list_dir
|
||||||
list_dir_boot=( $path_dir_boot/* )
|
list_dir_boot=( $path_dir_boot/* )
|
||||||
list_dir_user=( $path_dir_user/* )
|
list_dir_user=( $path_dir_user/* )
|
||||||
compadd "$@" -a list_dir_boot list_dir_user
|
compadd "$@" -a list_dir_boot list_dir_root list_dir_user
|
||||||
}
|
}
|
||||||
|
|
||||||
_list_common=(
|
_list_common=(
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
/run/boot-rc
|
|
@@ -1 +0,0 @@
|
|||||||
/etc/s6/boot-serv
|
|
@@ -1 +0,0 @@
|
|||||||
/etc/s6/boot-rc-serv
|
|
@@ -1,75 +0,0 @@
|
|||||||
#!/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 }
|
|
||||||
importas -ui -D "" first first
|
|
||||||
foreground {
|
|
||||||
if -n { mountpoint -q /$first }
|
|
||||||
s6-envdir /etc/s6/filesystem-env/$first
|
|
||||||
importas -ui -D "" fstype fstype
|
|
||||||
importas -ui -D "" device device
|
|
||||||
importas -ui -D "" mountpoint mountpoint
|
|
||||||
importas -ui -D "" options options
|
|
||||||
s6-mount -o $options -t $fstype $device $mountpoint
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# create needed directory on run if doesn't exist
|
|
||||||
if {
|
|
||||||
forx -p second { lvm user lock }
|
|
||||||
importas -ui -D "" second second
|
|
||||||
foreground {
|
|
||||||
if -n { s6-test -d /run/$second }
|
|
||||||
s6-mkdir -p -m 0755 /run/$second
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# finaly mount /dev/shm /dev/pts
|
|
||||||
if {
|
|
||||||
forx -p third { shm pts }
|
|
||||||
importas -ui -D "" third third
|
|
||||||
if {
|
|
||||||
foreground {
|
|
||||||
if -n { mountpoint -q /dev/$third }
|
|
||||||
if { s6-mkdir -p -m 0755 /dev/$third }
|
|
||||||
s6-envdir /etc/s6/filesystem-env/$third
|
|
||||||
importas -ui -D "" fstype fstype
|
|
||||||
importas -ui -D "" device device
|
|
||||||
importas -ui -D "" mountpoint mountpoint
|
|
||||||
importas -ui -D "" options options
|
|
||||||
s6-mount -o $options -n -t $fstype $device $mountpoint
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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,3 +0,0 @@
|
|||||||
switch-ready
|
|
||||||
switch-svscan
|
|
||||||
switch-user
|
|
@@ -1,14 +0,0 @@
|
|||||||
#!/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 "" USEBTRFS USEBTRFS
|
|
||||||
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
|
|
@@ -1,14 +0,0 @@
|
|||||||
#!/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 "" USEDMRAID USEDMRAID
|
|
||||||
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 desactived
|
|
@@ -1,22 +0,0 @@
|
|||||||
#!/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 "" USELVM USELVM
|
|
||||||
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
|
|
||||||
}
|
|
||||||
s6-echo -- lvm-prepare desactived
|
|
@@ -1 +0,0 @@
|
|||||||
bundle
|
|
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
fdmove -c 2 1
|
|
||||||
foreground {
|
|
||||||
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 { mountpoint -q /sys/fs/cgroup/${i} }
|
|
||||||
umount -R /sys/fs/cgroup/${i}
|
|
||||||
}
|
|
||||||
umount /sys/fs/cgroup
|
|
@@ -1,19 +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 -- rofs-console started }
|
|
||||||
s6-envdir ${S6CONF}
|
|
||||||
importas -D "" KEYMAP KEYMAP
|
|
||||||
importas -D "" FONT FONT
|
|
||||||
importas -D "" FONT_MAP FONT_MAP
|
|
||||||
importas -D "" FONT_UNIMAP FONT_UNIMAP
|
|
||||||
foreground {
|
|
||||||
loadkeys -q -u $KEYMAP
|
|
||||||
}
|
|
||||||
foreground {
|
|
||||||
forx index { 0 1 2 3 4 5 6 7 8 9 10 }
|
|
||||||
importas -u -D "" index 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
|
|
@@ -1,16 +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 -- rofs-hardclock started }
|
|
||||||
foreground {
|
|
||||||
s6-envdir ${S6CONF}
|
|
||||||
importas -D "" TZ TZ
|
|
||||||
importas -D "" HARDWARECLOCK HARDWARECLOCK
|
|
||||||
pipeline -d { echo $HARDWARECLOCK }
|
|
||||||
pipeline { tr A-Z a-z }
|
|
||||||
forstdin -- clock
|
|
||||||
importas -iu -D "" clock clock
|
|
||||||
hwclock --systz --${clock} --noadjfile
|
|
||||||
}
|
|
||||||
s6-echo -- rofs-hardclock successfully started
|
|
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- rofs-kermod started }
|
|
||||||
foreground {
|
|
||||||
pipeline -d { kmod static-nodes }
|
|
||||||
pipeline { s6-grep -F -- Module: }
|
|
||||||
pipeline { s6-cut -d":" -f2 }
|
|
||||||
pipeline { s6-cut -d" " -f2 }
|
|
||||||
forstdin -d"\n" -- mod
|
|
||||||
importas -iu -D "" mod mod
|
|
||||||
modprobe $mod
|
|
||||||
}
|
|
||||||
s6-echo -- rofs-kermod successfully started
|
|
@@ -1,15 +0,0 @@
|
|||||||
#!/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 "" KERNELRUNTIME KERNELRUNTIME
|
|
||||||
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
|
|
@@ -1,17 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" S6CONF S6CONF
|
|
||||||
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 desactived
|
|
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
fdmove -c 2 1
|
|
||||||
swapoff -a
|
|
@@ -1,13 +0,0 @@
|
|||||||
#!/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 "" USESWAP USESWAP
|
|
||||||
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
|
|
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- rwfs-dmesglog started }
|
|
||||||
foreground {
|
|
||||||
redirfd -w 1 /var/log/dmesg.log
|
|
||||||
dmesg
|
|
||||||
}
|
|
||||||
s6-echo -- rwfs-dmesglog successfully started
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- rwfs-fsrw started }
|
|
||||||
if { s6-mount -o remount,rw / / }
|
|
||||||
s6-echo -- rwfs-fsrw successfully started
|
|
@@ -1,13 +0,0 @@
|
|||||||
#!/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
|
|
@@ -1,15 +0,0 @@
|
|||||||
#!/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
|
|
@@ -1,13 +0,0 @@
|
|||||||
#!/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 "" IPTABLES IPTABLES
|
|
||||||
|
|
||||||
if { s6-test $IPTABLES = yes }
|
|
||||||
foreground {
|
|
||||||
if { s6-echo -- Flushing iptables }
|
|
||||||
/usr/lib/iptables/scripts/iptables-flush
|
|
||||||
}
|
|
||||||
s6-echo -- Iptables flushed
|
|
@@ -1,15 +0,0 @@
|
|||||||
#!/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 "" IPTABLES IPTABLES
|
|
||||||
|
|
||||||
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,9 +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 -- rwfs-localtime started }
|
|
||||||
s6-envdir ${S6CONF}
|
|
||||||
importas -D "" TZ TZ
|
|
||||||
if { s6-ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime }
|
|
||||||
s6-echo -- rwfs-localtime successfully started
|
|
@@ -1,6 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- rwfs-loopback started }
|
|
||||||
if { ip link set up dev lo }
|
|
||||||
s6-echo -- rwfs-loopback successfully started
|
|
@@ -1,6 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- rwfs-nonetwork started }
|
|
||||||
if { mount -a -t "nosysfs,nonfs,nonfs4,nosmbfs,nocifs" -O no_netdev }
|
|
||||||
s6-echo -- rwfs-nonetwork successfully started
|
|
@@ -1,9 +0,0 @@
|
|||||||
#!/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 "" S6LOCAL S6LOCAL
|
|
||||||
ifelse -X { s6-test $S6LOCAL = yes }
|
|
||||||
{ exec -c /etc/s6/data/scripts/s6.local }
|
|
||||||
s6-echo -- s6.local desactived
|
|
@@ -1,10 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- rwfs-tmpdir started }
|
|
||||||
|
|
||||||
foreground {
|
|
||||||
if { s6-echo -- Create /tmp directory }
|
|
||||||
mkdir -p -m1777 /tmp
|
|
||||||
}
|
|
||||||
|
|
||||||
s6-echo -- rwfs-tmpdir successfully started
|
|
@@ -1 +0,0 @@
|
|||||||
all-Boot
|
|
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- start switch-presvscan }
|
|
||||||
if { s6-mkdir -p -m 0755 /run/user/service }
|
|
||||||
forbacktickx -p -0 serv { s6-ls -0 /etc/s6-serv/enabled/classic }
|
|
||||||
importas -u -D "" serv serv
|
|
||||||
s6-ln -s -- /etc/s6-serv/enabled/classic/${serv} /run/user/service
|
|
@@ -1 +0,0 @@
|
|||||||
switch-ready
|
|
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
s6-svscan -t0 /run/user/service
|
|
@@ -1,2 +0,0 @@
|
|||||||
switch-ready
|
|
||||||
switch-svscan
|
|
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-rc -l /run/user-rc -da change
|
|
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
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-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 }
|
|
||||||
s6-echo -- switch-user successfully started
|
|
@@ -1,6 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- udevd-udev longrun started }
|
|
||||||
exec -c
|
|
||||||
udevd
|
|
||||||
|
|
@@ -1 +0,0 @@
|
|||||||
longrun
|
|
@@ -1,2 +0,0 @@
|
|||||||
udevd-udev
|
|
||||||
udevd-udevrules
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- udevd-udevadm started }
|
|
||||||
s6-devd
|
|
||||||
/usr/bin/udevadm settle
|
|
@@ -1 +0,0 @@
|
|||||||
longrun
|
|
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- udevd-udevrules started }
|
|
||||||
foreground {
|
|
||||||
if { udevadm trigger --action=add --type=subsystems }
|
|
||||||
udevadm trigger --action=add --type=devices
|
|
||||||
}
|
|
||||||
s6-echo -- udevd-udevrules successfully started
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
foreground { /etc/s6/stage2.tini }
|
|
||||||
s6-svscanctl -h -- ${DESTBOOTSERV}/service
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
foreground { /etc/s6/stage2.tini }
|
|
||||||
s6-svscanctl -6 -- ${DESTBOOTSERV}/service
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
foreground { /etc/s6/stage2.tini }
|
|
||||||
s6-svscanctl -q -- ${DESTBOOTSERV}/service
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
foreground { /etc/s6/stage2.tini }
|
|
||||||
s6-svscanctl -t -- ${DESTBOOTSERV}/service
|
|
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
s6-svscanctl -an -- ${DESTBOOTSERV}/service
|
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
foreground { /etc/s6/stage2.tini }
|
|
||||||
s6-svscanctl -7 -- ${DESTBOOTSERV}/service
|
|
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
redirfd -r 0 /dev/console
|
|
||||||
redirfd -w 1 /dev/console
|
|
||||||
fdmove -c 2 1
|
|
||||||
foreground { s6-echo -- "s6-svscan crashed. Dropping to an interactive shell." }
|
|
||||||
/bin/sh -i
|
|
@@ -1,10 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -S0
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
cd /
|
|
||||||
redirfd -w 2 /dev/console
|
|
||||||
fdmove -c 1 2
|
|
||||||
foreground { s6-svc -X -- ${DESTBOOTSERV}/service/s6-svscan-log }
|
|
||||||
unexport ?
|
|
||||||
wait -r -- { }
|
|
||||||
/etc/s6/stage3 ${@}
|
|
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
|
||||||
redirfd -w 2 /dev/console
|
|
||||||
fdmove -c 1 2
|
|
||||||
#redirfd -w 1 /dev/null
|
|
||||||
redirfd -rnb 0 fifo
|
|
||||||
s6-applyuidgid -u 19 -g 19 --
|
|
||||||
s6-log -bp -- t ${DESTBOOTSERV}/uncaught-logs
|
|
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
/usr/bin/agetty --delay 02 -J 38400 tty1
|
|
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
|
|
||||||
/usr/bin/agetty --delay 02 -J 38400 tty2
|
|
15
classic/service/.s6-svscan/SIGHUP
Executable file
15
classic/service/.s6-svscan/SIGHUP
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
foreground { /etc/s6/stage2.tini }
|
||||||
|
s6-svscanctl -h -- ${DEST}/service
|
15
classic/service/.s6-svscan/SIGINT
Executable file
15
classic/service/.s6-svscan/SIGINT
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
foreground { /etc/s6/stage2.tini }
|
||||||
|
s6-svscanctl -6 -- ${DEST}/service
|
15
classic/service/.s6-svscan/SIGQUIT
Executable file
15
classic/service/.s6-svscan/SIGQUIT
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
foreground { /etc/s6/stage2.tini }
|
||||||
|
s6-svscanctl -7 -- ${DEST}/service
|
15
classic/service/.s6-svscan/SIGTERM
Executable file
15
classic/service/.s6-svscan/SIGTERM
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
foreground { /etc/s6/stage2.tini }
|
||||||
|
s6-svscanctl -t -- ${DEST}/service
|
14
classic/service/.s6-svscan/SIGUSR1
Executable file
14
classic/service/.s6-svscan/SIGUSR1
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
s6-svscanctl -an -- ${DEST}/service
|
16
classic/service/.s6-svscan/SIGUSR2
Executable file
16
classic/service/.s6-svscan/SIGUSR2
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
foreground { /etc/s6/stage2.tini }
|
||||||
|
s6-svscanctl -0 -- ${DEST}/service
|
||||||
|
|
17
classic/service/.s6-svscan/crash
Executable file
17
classic/service/.s6-svscan/crash
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
redirfd -r 0 /dev/console
|
||||||
|
redirfd -w 1 /dev/console
|
||||||
|
fdmove -c 2 1
|
||||||
|
foreground { s6-echo -- "s6-svscan at ${DEST}/service crashed. Dropping to an interactive shell." }
|
||||||
|
/bin/sh -i
|
19
classic/service/.s6-svscan/finish
Executable file
19
classic/service/.s6-svscan/finish
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -S0
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
s6-envdir -if /etc/s6/env
|
||||||
|
importas -i DEST DEST
|
||||||
|
cd /
|
||||||
|
redirfd -w 2 /dev/console
|
||||||
|
fdmove -c 1 2
|
||||||
|
foreground { s6-svc -X -- ${DEST}/service/s6-svscan-log }
|
||||||
|
unexport ?
|
||||||
|
wait -r -- { }
|
||||||
|
/etc/s6/stage3 ${@}
|
16
classic/service/s6-svscan-log/run
Executable file
16
classic/service/s6-svscan-log/run
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
importas -i DEST DEST
|
||||||
|
redirfd -w 2 /dev/console
|
||||||
|
fdmove -c 1 2
|
||||||
|
redirfd -rnb 0 fifo
|
||||||
|
s6-setuidgid s6log
|
||||||
|
s6-log -bp -- t ${DEST}/uncaught-logs
|
11
classic/service/tty6/run
Executable file
11
classic/service/tty6/run
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
/usr/bin/agetty --delay 02 -J 38400 tty6
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
s6-svscan -t0 /run/user/service
|
|
@@ -1,4 +1,13 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
#!/usr/local/bin/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
fdmove -c 2 1
|
fdmove -c 2 1
|
||||||
if { s6-echo -- udevd-udev longrun started }
|
if { s6-echo -- udevd-udev longrun started }
|
||||||
exec -c
|
exec -c
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
|
||||||
fdmove -c 2 1
|
|
||||||
if { s6-echo -- udevd-udevadm started }
|
|
||||||
s6-devd
|
|
||||||
/usr/bin/udevadm settle
|
|
114
data/scripts/master.sh
Executable file
114
data/scripts/master.sh
Executable file
@@ -0,0 +1,114 @@
|
|||||||
|
#!@BINDIR@/bash
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
|
|
||||||
|
exec 2>&1
|
||||||
|
exec 1>/var/log/master.log
|
||||||
|
|
||||||
|
log(){
|
||||||
|
printf "%s %s %s\n" "$(date +"%Y-%m-%d %H:%M:%S")" "${FUNCNAME[1]} ::" "${@}"
|
||||||
|
}
|
||||||
|
|
||||||
|
ENV="/etc/s6/env"
|
||||||
|
DEST=$(<${ENV}/DEST) #/run/boot
|
||||||
|
|
||||||
|
if ! source /etc/obarun/s6opts.conf; then
|
||||||
|
out_error "/etc/obarun/s6opts.conf not found, existing"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
SOURCE="/etc/obarun/s6opts.conf"
|
||||||
|
fi
|
||||||
|
GEN_NAME=$(<${ENV}/MASTER)
|
||||||
|
DEST_USER=$(<${ENV}/DEST)
|
||||||
|
LIVE_CLASSIC_PATH=${DEST_USER}/service
|
||||||
|
LIVE_RC_PATH=${DEST_USER}
|
||||||
|
LIST_SERV=$(ls ${CLASSIC_ENABLED})
|
||||||
|
|
||||||
|
add_env() {
|
||||||
|
local -a list_env=$(printenv)
|
||||||
|
local var value line list
|
||||||
|
|
||||||
|
log "mkdir ${DEST}/env"
|
||||||
|
mkdir -p -m 0755 ${DEST}/env
|
||||||
|
|
||||||
|
while read line;do
|
||||||
|
|
||||||
|
if [[ "${line:0:1}" == "#" ]] || [[ -z "${line}" ]];then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
var=$(awk -F"=" '{print $1}' <<< "${line}")
|
||||||
|
value=${!var}
|
||||||
|
|
||||||
|
log "create new file ${var} with ${value} at ${DEST}/env/"
|
||||||
|
touch ${DEST}/env/"${var}"
|
||||||
|
echo "${value}" > ${DEST}/env/"${var}"
|
||||||
|
|
||||||
|
done < "${SOURCE}"
|
||||||
|
|
||||||
|
|
||||||
|
# need improvement
|
||||||
|
for list in ${list_env[@]};do
|
||||||
|
|
||||||
|
while read line;do
|
||||||
|
|
||||||
|
var=$(awk -F"=" '{print $1}' <<< "${line}")
|
||||||
|
value=${!var}
|
||||||
|
|
||||||
|
case "${var}" in
|
||||||
|
_|?|PWD|G_DEBUG) continue
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log "create new file ${var} with ${value} at ${DEST}/env/"
|
||||||
|
touch ${DEST}/env/"${var}"
|
||||||
|
echo "${value}" > ${DEST}/env/"${var}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done <<< "${list}"
|
||||||
|
|
||||||
|
done
|
||||||
|
for tidy_loop in GEN_NAME DEST_USER LIVE_CLASSIC_PATH LIVE_RC_PATH;do
|
||||||
|
var=${!tidy_loop}
|
||||||
|
log "create new file ${tidy_loop} with ${var} at ${DEST}/env"
|
||||||
|
touch ${DEST}/env/"${tidy_loop}"
|
||||||
|
echo "${var}" > ${DEST}/env/"${tidy_loop}"
|
||||||
|
done
|
||||||
|
|
||||||
|
unset list_env var value line list
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# copy daemon enabled by USER
|
||||||
|
enabled_daemon() {
|
||||||
|
for serv in ${LIST_SERV[@]};do
|
||||||
|
log "enable ${serv} daemon"
|
||||||
|
ln -sfT ${CLASSIC_ENABLED}/${serv} ${LIVE_CLASSIC_PATH}/${serv}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
start_database() {
|
||||||
|
log "init s6-rc database with -l ${LIVE_RC_PATH}/${GEN_NAME} -c ${RC_DATABASE_COMPILED}/current ${LIVE_CLASSIC_PATH}"
|
||||||
|
s6-rc-init -l ${LIVE_RC_PATH}/${GEN_NAME} -c ${RC_DATABASE_COMPILED}/current -p ${GEN_NAME} ${LIVE_CLASSIC_PATH}
|
||||||
|
s6-rc -v 3 -l ${LIVE_RC_PATH}/${GEN_NAME} -u change All
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
|
||||||
|
#add_env || exit 1
|
||||||
|
|
||||||
|
enabled_daemon || exit 1
|
||||||
|
|
||||||
|
svscanctl -an "${LIVE_CLASSIC_PATH}" 2>/dev/null
|
||||||
|
|
||||||
|
start_database || exit 1
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
start
|
71
data/scripts/modules.sh
Executable file
71
data/scripts/modules.sh
Executable file
@@ -0,0 +1,71 @@
|
|||||||
|
#!@BINDIR@/bash
|
||||||
|
# Copyright (c) 2015-2018 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;
|
||||||
|
}
|
||||||
|
check_file(){
|
||||||
|
local tidy_loop conf
|
||||||
|
|
||||||
|
for tidy_loop in ${MODULES_PATH[@]}; do
|
||||||
|
if [[ -d "${tidy_loop}" ]]; then
|
||||||
|
for conf in "${tidy_loop}"/*.conf ; do
|
||||||
|
check_elements ${conf##*/} ${MODULES_NAME[@]}
|
||||||
|
if (( $? )); then
|
||||||
|
MODULES_NAME+=("${conf##*/}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
unset tidy_loop conf
|
||||||
|
}
|
||||||
|
check_path(){
|
||||||
|
local path tidy_loop
|
||||||
|
for path in ${MODULES_PATH[@]}; do
|
||||||
|
for tidy_loop in ${MODULES_NAME[@]}; do
|
||||||
|
if [[ -f "${path}/${tidy_loop}" ]]; then
|
||||||
|
check_elements "${tidy_loop}" ${MODULES_RESULT[@]##*/}
|
||||||
|
if (( $? ));then
|
||||||
|
MODULES_RESULT+=("${path}/${tidy_loop}")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
check_file
|
||||||
|
if [[ -n ${MODULES_NAME[@]} ]]; then
|
||||||
|
check_path
|
||||||
|
else
|
||||||
|
echo "rofs-modules :: Nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
for mod in ${MODULES_RESULT[@]}; do
|
||||||
|
while read line; do
|
||||||
|
if [[ "${line:0:1}" == "#" ]] || [[ -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
|
@@ -1,3 +1,12 @@
|
|||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
#
|
||||||
# Default s6.local for obarun; add your custom commands here.
|
# Default s6.local for obarun; add your custom commands here.
|
||||||
#
|
#
|
||||||
# This is run by s6 before the user services are executed.
|
# This is run by s6 before the user services are executed.
|
||||||
|
411
data/scripts/tmpfiles.sh
Executable file
411
data/scripts/tmpfiles.sh
Executable file
@@ -0,0 +1,411 @@
|
|||||||
|
#!@BINDIR@/sh
|
||||||
|
# This is a reimplementation of the systemd tmpfiles.d code
|
||||||
|
# Control creation, deletion, and cleaning of volatile and temporary files
|
||||||
|
#
|
||||||
|
# Copyright (c) 2012 Gentoo Foundation
|
||||||
|
# Released under the 2-clause BSD license.
|
||||||
|
#
|
||||||
|
# This instance is a pure-POSIX sh version, written by Robin H Johnson
|
||||||
|
# <robbat2@gentoo.org>, based on the Arch Linux version as of 2012/01/01:
|
||||||
|
# http://projects.archlinux.org/initscripts.git/tree/arch-tmpfiles
|
||||||
|
#
|
||||||
|
# See the tmpfiles.d manpage as well:
|
||||||
|
# http://0pointer.de/public/systemd-man/tmpfiles.d.html
|
||||||
|
# This script should match the manpage as of 2012/03/12
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
# This file was modified by Eric Vidal <eric@obarun.org> for Obarun
|
||||||
|
DRYRUN=0
|
||||||
|
|
||||||
|
checkprefix() {
|
||||||
|
n=$1
|
||||||
|
shift
|
||||||
|
for x in $@; do
|
||||||
|
case $n in
|
||||||
|
${x}*) return 0 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
warninvalid() {
|
||||||
|
printf "tmpfiles: ignoring invalid entry on line %d of \`%s'\n" "$LINENUM" "$FILE"
|
||||||
|
error=$(( error+1 ))
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
dryrun_or_real() {
|
||||||
|
local dryrun=
|
||||||
|
[ $DRYRUN -eq 1 ] && dryrun=echo
|
||||||
|
$dryrun "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
relabel() {
|
||||||
|
local path
|
||||||
|
local paths=$1 mode=$2 uid=$3 gid=$4
|
||||||
|
|
||||||
|
for path in ${paths}; do
|
||||||
|
if [ -e "$path" ]; then
|
||||||
|
[ -x /sbin/restorecon ] && dryrun_or_real restorecon $CHOPTS "$path"
|
||||||
|
[ $uid != '-' ] && dryrun_or_real chown $CHOPTS "$uid" "$path"
|
||||||
|
[ $gid != '-' ] && dryrun_or_real chgrp $CHOPTS "$gid" "$path"
|
||||||
|
[ $mode != '-' ] && dryrun_or_real chmod $CHOPTS "$mode" "$path"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
splitpath() {
|
||||||
|
local path=$1
|
||||||
|
while [ -n "$path" ]; do
|
||||||
|
echo $path
|
||||||
|
path=${path%/*}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
_restorecon() {
|
||||||
|
local path=$1
|
||||||
|
if [ -x /sbin/restorecon ]; then
|
||||||
|
dryrun_or_real restorecon -F $(splitpath "$path")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_b() {
|
||||||
|
# Create a block device node if it doesn't exist yet
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
|
if [ ! -e "$path" ]; then
|
||||||
|
dryrun_or_real mknod -m $mode $path b ${arg%:*} ${arg#*:}
|
||||||
|
_restorecon "$path"
|
||||||
|
dryrun_or_real chown $uid:$gid $path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_c() {
|
||||||
|
# Create a character device node if it doesn't exist yet
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
|
if [ ! -e "$path" ]; then
|
||||||
|
dryrun_or_real mknod -m $mode $path c ${arg%:*} ${arg#*:}
|
||||||
|
_restorecon "$path"
|
||||||
|
dryrun_or_real chown $uid:$gid $path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_C() {
|
||||||
|
# recursively copy a file or directory
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
|
if [ ! -e "$path" ]; then
|
||||||
|
dryrun_or_real cp -r "$arg" "$path"
|
||||||
|
_restorecon "$path"
|
||||||
|
[ $uid != '-' ] && dryrun_or_real chown "$uid" "$path"
|
||||||
|
[ $gid != '-' ] && dryrun_or_real chgrp "$gid" "$path"
|
||||||
|
[ $mode != '-' ] && dryrun_or_real chmod "$mode" "$path"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_f() {
|
||||||
|
# Create a file if it doesn't exist yet
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
|
|
||||||
|
[ $CREATE -gt 0 ] || return 0
|
||||||
|
|
||||||
|
if [ ! -e "$path" ]; then
|
||||||
|
#dryrun_or_real $CHECKPATH -fq -m "$mode" -o "$uid:$gid" "$path"
|
||||||
|
dryrun_or_real touch "$path"
|
||||||
|
dryrun_or_real chmod "$mode" "$path"
|
||||||
|
dryrun_or_real chown "$uid:$gid" "$path"
|
||||||
|
[ -z "$arg" ] || _w "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_F() {
|
||||||
|
# Create or truncate a file
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
|
|
||||||
|
[ $CREATE -gt 0 ] || return 0
|
||||||
|
if [ -e "$path" ]; then
|
||||||
|
[ -z "$arg" ] || _w "$@"
|
||||||
|
else
|
||||||
|
#dryrun_or_real $CHECKPATH -Fq -m "$mode" -o "$uid:$gid" "$path"
|
||||||
|
dryrun_or_real touch "$path"
|
||||||
|
dryrun_or_real chmod "$mode" "$path"
|
||||||
|
dryrun_or_real chown "$uid:$gid" "$path"
|
||||||
|
[ -z "$arg" ] || _w "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_d() {
|
||||||
|
# Create a directory if it doesn't exist yet
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4
|
||||||
|
|
||||||
|
[ $CREATE -gt 0 ] || return 0
|
||||||
|
|
||||||
|
if [ ! -d "$path" ]; then
|
||||||
|
dryrun_or_real mkdir -p "$path" 2>/dev/null
|
||||||
|
_restorecon "$path"
|
||||||
|
#dryrun_or_real $CHECKPATH -dq -m "$mode" -o "$uid:$gid" "$path"
|
||||||
|
dryrun_or_real chmod "$mode" "$path"
|
||||||
|
dryrun_or_real chown "$uid:$gid" "$path"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_D() {
|
||||||
|
# Create or empty a directory
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4
|
||||||
|
|
||||||
|
if [ -d "$path" ] && [ $REMOVE -gt 0 ]; then
|
||||||
|
dryrun_or_real find "$path" -mindepth 1 -maxdepth 1 -xdev -exec rm -rf {} +
|
||||||
|
_restorecon "$path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $CREATE -gt 0 ]; then
|
||||||
|
dryrun_or_real mkdir -p "$path" 2>/dev/null
|
||||||
|
_restorecon "$path"
|
||||||
|
#dryrun_or_real $CHECKPATH -Dq -m "$mode" -o "$uid:$gid" "$path"
|
||||||
|
dryrun_or_real chmod "$mode" "$path"
|
||||||
|
dryrun_or_real chown "$uid:$gid" "$path"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_v() {
|
||||||
|
# Create a subvolume if the path does not exist yet and the file system
|
||||||
|
# supports this (btrfs). Otherwise create a normal directory.
|
||||||
|
# TODO: Implement btrfs subvol creation.
|
||||||
|
_d "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_L() {
|
||||||
|
# Create a symlink if it doesn't exist yet
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
|
[ ! -e "$path" ] && dryrun_or_real ln -s "$arg" "$path"
|
||||||
|
_restorecon "$path"
|
||||||
|
}
|
||||||
|
|
||||||
|
_p() {
|
||||||
|
# Create a named pipe (FIFO) if it doesn't exist yet
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4
|
||||||
|
|
||||||
|
[ $CREATE -gt 0 ] || return 0
|
||||||
|
|
||||||
|
if [ ! -p "$path" ]; then
|
||||||
|
#dryrun_or_real $CHECKPATH -pq -m $mode -o "$uid:$gid" "$path"
|
||||||
|
dryrun_or_real mkfifo -m "$mode" "$path"
|
||||||
|
dryrun_or_real chown "$uid:$gid" "$path"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_x() {
|
||||||
|
# Ignore a path during cleaning. Use this type to exclude paths from clean-up as
|
||||||
|
# controlled with the Age parameter. Note that lines of this type do not
|
||||||
|
# influence the effect of r or R lines. Lines of this type accept shell-style
|
||||||
|
# globs in place of of normal path names.
|
||||||
|
:
|
||||||
|
# XXX: we don't implement this
|
||||||
|
}
|
||||||
|
|
||||||
|
_X() {
|
||||||
|
# Ignore a path during cleanup. Use this type to prevent path
|
||||||
|
# removal as controled with the age parameter. Note that if path is
|
||||||
|
# a directory, the content of the directory is not excluded from
|
||||||
|
# clean-up, only the directory itself.
|
||||||
|
# Lines of this type accept shell-style globs in place of normal path names.
|
||||||
|
:
|
||||||
|
# XXX: we don't implement this
|
||||||
|
}
|
||||||
|
|
||||||
|
_r() {
|
||||||
|
# Remove a file or directory if it exists. This may not be used to remove
|
||||||
|
# non-empty directories, use R for that. Lines of this type accept shell-style
|
||||||
|
# globs in place of normal path names.
|
||||||
|
local path
|
||||||
|
local paths=$1
|
||||||
|
|
||||||
|
[ $REMOVE -gt 0 ] || return 0
|
||||||
|
|
||||||
|
for path in ${paths}; do
|
||||||
|
if [ -f "$path" ]; then
|
||||||
|
dryrun_or_real rm -f "$path"
|
||||||
|
elif [ -d "$path" ]; then
|
||||||
|
dryrun_or_real rmdir "$path"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
_R() {
|
||||||
|
# Recursively remove a path and all its subdirectories (if it is a directory).
|
||||||
|
# Lines of this type accept shell-style globs in place of normal path names.
|
||||||
|
local path
|
||||||
|
local paths=$1
|
||||||
|
|
||||||
|
[ $REMOVE -gt 0 ] || return 0
|
||||||
|
|
||||||
|
for path in ${paths}; do
|
||||||
|
[ -d "$path" ] && dryrun_or_real rm -rf --one-file-system "$path"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
_w() {
|
||||||
|
# Write the argument parameter to a file, if it exists.
|
||||||
|
local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
|
||||||
|
if [ -f "$path" ]; then
|
||||||
|
if [ $DRYRUN -eq 1 ]; then
|
||||||
|
echo "echo \"$arg\" >>\"$path\""
|
||||||
|
else
|
||||||
|
echo "$arg" >>"$path"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_z() {
|
||||||
|
# Set ownership, access mode and relabel security context of a file or
|
||||||
|
# directory if it exists. Lines of this type accept shell-style globs in
|
||||||
|
# place of normal path names.
|
||||||
|
[ $CREATE -gt 0 ] || return 0
|
||||||
|
|
||||||
|
relabel "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_Z() {
|
||||||
|
# Recursively set ownership, access mode and relabel security context of a
|
||||||
|
# path and all its subdirectories (if it is a directory). Lines of this type
|
||||||
|
# accept shell-style globs in place of normal path names.
|
||||||
|
[ $CREATE -gt 0 ] || return 0
|
||||||
|
|
||||||
|
CHOPTS=-R relabel "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOT=0 CREATE=0 REMOVE=0 CLEAN=0 VERBOSE=0 DRYRUN=0 error=0 LINENO=0
|
||||||
|
EXCLUDE=
|
||||||
|
PREFIX=
|
||||||
|
FILE=
|
||||||
|
fragments=
|
||||||
|
# XXX: The harcoding of /usr/lib/ is an explicit choice by upstream
|
||||||
|
tmpfiles_dirs='/usr/lib/tmpfiles.d/ /run/tmpfiles.d/ /etc/tmpfiles.d/'
|
||||||
|
tmpfiles_basenames=''
|
||||||
|
tmpfiles_d=''
|
||||||
|
# Build a list of sorted unique basenames
|
||||||
|
# directories declared later in the tmpfiles_d array will override earlier
|
||||||
|
# directories, on a per file basename basis.
|
||||||
|
# `/etc/tmpfiles.d/foo.conf' supersedes `/usr/lib/tmpfiles.d/foo.conf'.
|
||||||
|
# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf'
|
||||||
|
for d in ${tmpfiles_dirs} ; do
|
||||||
|
[ -d $d ] && for f in ${d}/*.conf ; do
|
||||||
|
case "${f##*/}" in
|
||||||
|
systemd.conf|systemd-*.conf) continue;;
|
||||||
|
esac
|
||||||
|
[ -f $f ] && tmpfiles_basenames="${tmpfiles_basenames}\n${f##*/}"
|
||||||
|
done # for f in ${d}
|
||||||
|
done # for d in ${tmpfiles_dirs}
|
||||||
|
tmpfiles_basenames="$(printf "${tmpfiles_basenames}\n" | sort -u )"
|
||||||
|
|
||||||
|
for b in $tmpfiles_basenames ; do
|
||||||
|
real_f=''
|
||||||
|
for d in $tmpfiles_dirs ; do
|
||||||
|
f=${d}/${b}
|
||||||
|
[ -f "${f}" ] && real_f=$f
|
||||||
|
done
|
||||||
|
[ -f "${real_f}" ] && tmpfiles_d="${tmpfiles_d} ${real_f}"
|
||||||
|
done
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case $1 in
|
||||||
|
--boot) BOOT=1 ;;
|
||||||
|
--create) CREATE=1 ;;
|
||||||
|
--remove) REMOVE=1 ;;
|
||||||
|
--clean) CLEAN=1 ;; # TODO: Not implemented
|
||||||
|
--verbose) VERBOSE=1 ;;
|
||||||
|
--dryrun|--dry-run) DRYRUN=1 ;;
|
||||||
|
--exclude-prefix=*) EXCLUDE="${EXCLUDE}${1##--exclude-prefix=} " ;;
|
||||||
|
--prefix=*) PREFIX="${PREFIX}${1##--prefix=} " ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $(( CLEAN )) -eq 1 ] ; then
|
||||||
|
printf '%s clean mode is not implemented\n' "${0##*/}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CREATE$REMOVE" = '00' ]; then
|
||||||
|
printf 'usage: %s [--exclude-prefix=path] [--prefix=path] [--boot] [--create] [--remove] [--clean] [--verbose] [--dry-run]\n' "${0##*/}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
error=0
|
||||||
|
|
||||||
|
# loop through the gathered fragments, sorted globally by filename.
|
||||||
|
# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf'
|
||||||
|
for FILE in $tmpfiles_d ; do
|
||||||
|
LINENUM=0
|
||||||
|
|
||||||
|
### FILE FORMAT ###
|
||||||
|
# XXX: We ignore the 'Age' parameter
|
||||||
|
# 1 2 3 4 5 6 7
|
||||||
|
# Cmd Path Mode UID GID Age Argument
|
||||||
|
# d /run/user 0755 root root 10d -
|
||||||
|
# Mode, UID, GID, Age, Argument may be omitted!
|
||||||
|
# If Cmd ends with !, the line is only processed if --boot is passed
|
||||||
|
|
||||||
|
# XXX: Upstream says whitespace is NOT permitted in the Path argument.
|
||||||
|
# But IS allowed when globs are expanded for the x/r/R/z/Z types.
|
||||||
|
while read cmd path mode uid gid age arg; do
|
||||||
|
LINENUM=$(( LINENUM+1 ))
|
||||||
|
FORCE=0
|
||||||
|
|
||||||
|
# Unless we have both command and path, skip this line.
|
||||||
|
if [ -z "$cmd" -o -z "$path" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $cmd in
|
||||||
|
\#*) continue ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
while [ ${#cmd} -gt 1 ]; do
|
||||||
|
case $cmd in
|
||||||
|
*!) cmd=${cmd%!}; [ "$BOOT" -eq "1" ] || continue 2 ;;
|
||||||
|
*+) cmd=${cmd%+}; FORCE=1; ;;
|
||||||
|
*) warninvalid ; continue 2 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# whine about invalid entries
|
||||||
|
case $cmd in
|
||||||
|
f|F|w|d|D|v|p|L|c|C|b|x|X|r|R|z|Z) ;;
|
||||||
|
*) warninvalid ; continue ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# fall back on defaults when parameters are passed as '-'
|
||||||
|
if [ "$mode" = '-' -o "$mode" = '' ]; then
|
||||||
|
case "$cmd" in
|
||||||
|
p|f|F) mode=0644 ;;
|
||||||
|
d|D|v) mode=0755 ;;
|
||||||
|
C|z|Z|x|r|R|L) ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ "$uid" = '-' -o "$uid" = '' ] && uid=0
|
||||||
|
[ "$gid" = '-' -o "$gid" = '' ] && gid=0
|
||||||
|
[ "$age" = '-' -o "$age" = '' ] && age=0
|
||||||
|
[ "$arg" = '-' -o "$arg" = '' ] && arg=''
|
||||||
|
set -- "$path" "$mode" "$uid" "$gid" "$age" "$arg"
|
||||||
|
|
||||||
|
[ -n "$EXCLUDE" ] && checkprefix $path $EXCLUDE && continue
|
||||||
|
[ -n "$PREFIX" ] && ! checkprefix $path $PREFIX && continue
|
||||||
|
|
||||||
|
if [ $FORCE -gt 0 ]; then
|
||||||
|
case $cmd in
|
||||||
|
p|L|c|b) [ -f "$path" ] && dryrun_or_real rm -f "$path"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ "$VERBOSE" -eq "1" ] && echo _$cmd "$@"
|
||||||
|
_$cmd "$@"
|
||||||
|
rc=$?
|
||||||
|
if [ "${DRYRUN}" -eq "0" ]; then
|
||||||
|
[ $rc -ne 0 ] && error=$((error + 1))
|
||||||
|
fi
|
||||||
|
done <$FILE
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $error
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2 sts=2 noet ft=sh:
|
0
base-env/DESTBOOTSERV → env/DEST
vendored
0
base-env/DESTBOOTSERV → env/DEST
vendored
1
env/DESTRC
vendored
Normal file
1
env/DESTRC
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/run/boot/rc
|
1
env/HANDLE
vendored
Normal file
1
env/HANDLE
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/etc/s6/data/scripts
|
1
env/MASTER
vendored
Normal file
1
env/MASTER
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
master-
|
0
base-env/PATH → env/PATH
vendored
0
base-env/PATH → env/PATH
vendored
0
base-env/S6CONF → env/S6CONF
vendored
0
base-env/S6CONF → env/S6CONF
vendored
0
base-env/SRCRCCOMPILED → env/SRCRC
vendored
0
base-env/SRCRCCOMPILED → env/SRCRC
vendored
1
env/TEMPLATE
vendored
Normal file
1
env/TEMPLATE
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/usr/share/obarun/s6opts/template
|
0
base-env/TERM → env/TERM
vendored
0
base-env/TERM → env/TERM
vendored
54
init
54
init
@@ -1,56 +1,50 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
# Copyright (C) 2015-2017 Eric Vidal <eric@obarun.org>
|
# Copyright (c) 2015-2018 Eric Vidal <eric@obarun.org>
|
||||||
#
|
# All rights reserved.
|
||||||
# This file is distributed in the hope that it will be useful, but WITHOUT ANY
|
#
|
||||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
# This file is part of Obarun. It is subject to the license terms in
|
||||||
# FOR A PARTICULAR PURPOSE.
|
# the LICENSE file found in the top-level directory of this
|
||||||
#
|
# distribution.
|
||||||
# This scripts is under License Beerware.
|
# This file may not be copied, modified, propagated, or distributed
|
||||||
#
|
# except according to the terms contained in the LICENSE file.
|
||||||
# "THE BEERWARE LICENSE" (Revision 42):
|
|
||||||
# <eric@obarun.org> wrote this file. As long as you retain this notice you
|
|
||||||
# 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
|
|
||||||
|
|
||||||
|
|
||||||
# Export good path
|
# Export good path
|
||||||
/usr/bin/s6-envdir -if /etc/s6/base-env
|
/usr/bin/s6-envdir -if /etc/s6/env
|
||||||
/usr/local/bin/importas -i -D "" PATH PATH
|
@BINDIR_EXECLINE@/importas -i PATH PATH
|
||||||
/usr/local/bin/export PATH ${PATH}
|
@BINDIR_EXECLINE@/export PATH ${PATH}
|
||||||
|
|
||||||
/usr/local/bin/cd /
|
@BINDIR_EXECLINE@/cd /
|
||||||
|
|
||||||
# Be clean and safe
|
# Be clean and safe
|
||||||
emptyenv -p
|
emptyenv -p
|
||||||
s6-setsid -qb --
|
s6-setsid -qb --
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
if {
|
foreground {
|
||||||
if { s6-echo -- "***************************************************************************" }
|
if { s6-echo -- "***************************************************************************" }
|
||||||
if { s6-echo -- "** Booting Obarun under S6 **" }
|
if { s6-echo -- "** Booting Obarun with S6 **" }
|
||||||
if { s6-echo -- "** https://obarun.org/ **" }
|
if { s6-echo -- "** https://obarun.org/ **" }
|
||||||
s6-echo -- "***************************************************************************"
|
s6-echo -- "***************************************************************************"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copy service for pid1 at the right place
|
# Copy service for pid1 at the right place
|
||||||
s6-envdir -if /etc/s6/base-env
|
s6-envdir -if /etc/s6/env
|
||||||
importas -i -D "" SRCBOOTSERV SRCBOOTSERV
|
importas -i SRC SRC
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
importas -i DEST DEST
|
||||||
foreground {
|
foreground {
|
||||||
if { s6-hiercopy ${SRCBOOTSERV} ${DESTBOOTSERV} }
|
s6-hiercopy ${SRC} ${DEST}
|
||||||
}
|
}
|
||||||
|
|
||||||
redirfd -r 0 /dev/null
|
redirfd -r 0 /dev/null
|
||||||
redirfd -wnb 1 ${DESTBOOTSERV}/service/s6-svscan-log/fifo
|
redirfd -wnb 1 ${DEST}/service/s6-svscan-log/fifo
|
||||||
|
fdmove -c 2 1
|
||||||
|
|
||||||
# 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 ${DESTBOOTSERV}/service/s6-svscan-log/fifo
|
redirfd -w 1 ${DEST}/service/s6-svscan-log/fifo
|
||||||
fdmove -c 2 1
|
|
||||||
/etc/s6/stage2
|
/etc/s6/stage2
|
||||||
}
|
}
|
||||||
|
|
||||||
unexport !
|
unexport !
|
||||||
fdmove -c 2 1
|
s6-svscan -st0 ${DEST}/service
|
||||||
s6-svscan -st0 ${DESTBOOTSERV}/service
|
|
||||||
|
16
poweroff
16
poweroff
@@ -1,5 +1,13 @@
|
|||||||
#!/usr/local/bin/execlineb -P
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2018 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.
|
||||||
|
|
||||||
s6-envdir -if /etc/s6/base-env
|
s6-envdir -if /etc/s6/env
|
||||||
importas -i -D "" DESTBOOTSERV DESTBOOTSERV
|
importas -i DEST DEST
|
||||||
exec ${DESTBOOTSERV}/service/.s6-svscan/SIGUSR2
|
exec -c ${DEST}/service/.s6-svscan/SIGQUIT
|
||||||
|
94
rc/00/up
Normal file
94
rc/00/up
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2017 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.
|
||||||
|
|
||||||
|
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 }
|
||||||
|
importas -ui -D "" first first
|
||||||
|
foreground {
|
||||||
|
if -n { mountpoint -q /$first }
|
||||||
|
s6-envdir /etc/s6/filesystem-env/$first
|
||||||
|
importas -ui fstype fstype
|
||||||
|
importas -ui device device
|
||||||
|
importas -ui mountpoint mountpoint
|
||||||
|
importas -ui options options
|
||||||
|
s6-mount -o $options -t $fstype $device $mountpoint
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# create needed directory on run if doesn't exist
|
||||||
|
if {
|
||||||
|
forx -p second { lvm user lock }
|
||||||
|
importas -ui second second
|
||||||
|
foreground {
|
||||||
|
if -n { s6-test -d /run/$second }
|
||||||
|
s6-mkdir -p -m 0755 /run/$second
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# finaly mount /dev/shm /dev/pts
|
||||||
|
if {
|
||||||
|
forx -p third { shm pts }
|
||||||
|
importas -ui third third
|
||||||
|
if {
|
||||||
|
foreground {
|
||||||
|
if -n { mountpoint -q /dev/$third }
|
||||||
|
if { s6-mkdir -p -m 0755 /dev/$third }
|
||||||
|
s6-envdir /etc/s6/filesystem-env/$third
|
||||||
|
importas -ui fstype fstype
|
||||||
|
importas -ui device device
|
||||||
|
importas -ui mountpoint mountpoint
|
||||||
|
importas -ui options options
|
||||||
|
s6-mount -o $options -n -t $fstype $device $mountpoint
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s6-echo -- filesystem was mounted successfully
|
||||||
|
}
|
||||||
|
|
||||||
|
# parse s6.conf before loading environment
|
||||||
|
foreground {
|
||||||
|
|
||||||
|
if { s6-echo -- Parsing s6-conf }
|
||||||
|
|
||||||
|
importas -i S6CONF S6CONF
|
||||||
|
foreground {
|
||||||
|
redirfd -r 0 /etc/s6/s6.conf
|
||||||
|
pipeline { s6-grep -vF -- "#" }
|
||||||
|
forstdin -nCd"\n" -- conf
|
||||||
|
importas -ui conf conf
|
||||||
|
multidefine -d"=" $conf { var value }
|
||||||
|
foreground {
|
||||||
|
if { mkdir -p ${S6CONF}/ }
|
||||||
|
redirfd -w 1 ${S6CONF}/$var
|
||||||
|
s6-echo -- $value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s6-echo -- s6-conf was parsed successfully
|
||||||
|
}
|
||||||
|
|
||||||
|
# load hostname for earlier tty
|
||||||
|
foreground {
|
||||||
|
|
||||||
|
if { s6-echo -- Define hostname }
|
||||||
|
importas -i S6CONF S6CONF
|
||||||
|
s6-envdir ${S6CONF}
|
||||||
|
importas -i HOSTNAME HOSTNAME
|
||||||
|
s6-hostname ${HOSTNAME}
|
||||||
|
}
|
||||||
|
s6-echo -- 00 successfully started
|
@@ -1,3 +1,4 @@
|
|||||||
00
|
00
|
||||||
all-Boot
|
all-Boot
|
||||||
all-Switch
|
adduser
|
||||||
|
tty
|
1
rc/adduser/dependencies
Normal file
1
rc/adduser/dependencies
Normal file
@@ -0,0 +1 @@
|
|||||||
|
all-Boot
|
16
rc/adduser/up
Normal file
16
rc/adduser/up
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!@BINDIR_EXECLINE@/execlineb -P
|
||||||
|
# Copyright (c) 2015-2017 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.
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
importas -i HANDLE HANDLE
|
||||||
|
if { s6-echo -- start adduser }
|
||||||
|
if { ${HANDLE}/master.sh }
|
||||||
|
s6-echo -- adduser started successfully
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user