Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3ada9e391e | ||
3d142ebda7 | |||
7a5877342a | |||
6a1c2c55d9 | |||
09bc2d021b | |||
8396101929 | |||
1344532759 |
14
Makefile
14
Makefile
@@ -33,9 +33,13 @@ UDEVHOOKS = $(wildcard udev/hooks/*)
|
|||||||
BASESCRIPTS = $(wildcard base/scripts/*)
|
BASESCRIPTS = $(wildcard base/scripts/*)
|
||||||
BASEHOOKS = $(wildcard base/hooks/*)
|
BASEHOOKS = $(wildcard base/hooks/*)
|
||||||
|
|
||||||
TMPFILESHOOKS = $(wildcard tmpfiles/hooks/*)
|
TMPFILESHOOKS = $(wildcard etmpfiles/hooks/*)
|
||||||
|
|
||||||
SYSUSERSHOOKS = $(wildcard sysusers/hooks/*)
|
SYSUSERSHOOKS = $(wildcard esysusers/hooks/*)
|
||||||
|
|
||||||
|
WRAPPER = $(wildcard wrapper/*)
|
||||||
|
|
||||||
|
WRAPPERDIR = $(PREFIX)/share/artix
|
||||||
|
|
||||||
DMODE = -dm0755
|
DMODE = -dm0755
|
||||||
MODE = -m0644
|
MODE = -m0644
|
||||||
@@ -105,4 +109,8 @@ install_dinit_at: install_hook_common
|
|||||||
install_dinit_dbus: install_hook_common
|
install_dinit_dbus: install_hook_common
|
||||||
install $(MODE) $(DINITDBUSHOOKS) $(DESTDIR)$(HOOKSDIR)
|
install $(MODE) $(DINITDBUSHOOKS) $(DESTDIR)$(HOOKSDIR)
|
||||||
|
|
||||||
.PHONY: install install_base install_s6 install_openrc install_runit install_dinit
|
install_wrapper:
|
||||||
|
install $(DMODE) $(DESTDIR)$(WRAPPERDIR)
|
||||||
|
install $(EMODE) $(WRAPPER) $(DESTDIR)$(WRAPPERDIR)
|
||||||
|
|
||||||
|
.PHONY: install install_base install_s6 install_openrc install_runit install_dinit install_wrapper
|
||||||
|
@@ -33,7 +33,7 @@ init_detect(){
|
|||||||
s6_init_remake(){
|
s6_init_remake(){
|
||||||
# we need to ensure that s6-linux-init-maker is run on every machine
|
# we need to ensure that s6-linux-init-maker is run on every machine
|
||||||
rm -rf /tmp/current
|
rm -rf /tmp/current
|
||||||
s6-linux-init-maker -1 -G "/usr/bin/agetty -L -8 tty7 115200" -c /etc/s6/current /tmp/current
|
s6-linux-init-maker -1 -G "/usr/bin/agetty -L -8 tty12 115200" -c /etc/s6/current /tmp/current
|
||||||
mv /tmp/current/bin/init /tmp/current/bin/s6-init
|
mv /tmp/current/bin/init /tmp/current/bin/s6-init
|
||||||
cp -a /tmp/current/bin /usr
|
cp -a /tmp/current/bin /usr
|
||||||
rm -rf /tmp/current/{bin,scripts}
|
rm -rf /tmp/current/{bin,scripts}
|
||||||
|
@@ -7,4 +7,4 @@ Target = usr/lib/sysusers.d/*.conf
|
|||||||
[Action]
|
[Action]
|
||||||
Description = Creating system user accounts...
|
Description = Creating system user accounts...
|
||||||
When = PostTransaction
|
When = PostTransaction
|
||||||
Exec = /usr/bin/sysusers
|
Exec = /usr/bin/esysusers
|
@@ -7,4 +7,4 @@ Target = usr/lib/tmpfiles.d/*.conf
|
|||||||
[Action]
|
[Action]
|
||||||
Description = Creating temporary files...
|
Description = Creating temporary files...
|
||||||
When = PostTransaction
|
When = PostTransaction
|
||||||
Exec = /usr/bin/tmpfiles --create
|
Exec = /usr/bin/etmpfiles --create
|
@@ -16,7 +16,7 @@ case "$op" in
|
|||||||
udev-reload)
|
udev-reload)
|
||||||
udevd_live
|
udevd_live
|
||||||
/usr/bin/udevadm control --reload
|
/usr/bin/udevadm control --reload
|
||||||
/usr/bin/udevadm trigger
|
/usr/bin/udevadm trigger -c change
|
||||||
/usr/bin/udevadm settle
|
/usr/bin/udevadm settle
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
55
wrapper/artix-svc
Normal file
55
wrapper/artix-svc
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sv_start() {
|
||||||
|
case "$init" in
|
||||||
|
openrc) exec /usr/bin/rc-service "$1" start ;;
|
||||||
|
runit) exec /usr/bin/sv start /run/runit/service/"$1" ;;
|
||||||
|
s6) exec /usr/bin/s6-rc -u change "$1" ;;
|
||||||
|
dinit) exec /usr/bin/dinitctl start "$1" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
sv_stop() {
|
||||||
|
case "$init" in
|
||||||
|
openrc) exec /usr/bin/rc-service "$1" stop ;;
|
||||||
|
runit) exec /usr/bin/sv stop /run/runit/service/"$1" ;;
|
||||||
|
s6) exec /usr/bin/s6-rc -d change "$1" ;;
|
||||||
|
dinit) exec /usr/bin/dinitctl stop "$1" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
sv_enable() {
|
||||||
|
case "$init" in
|
||||||
|
openrc) exec /usr/bin/rc-update add "$1" default ;;
|
||||||
|
runit) exec unlink /run/runit/service/"$1"/down ;;
|
||||||
|
s6) exec /usr/bin/s6-service add default "$1" ;;
|
||||||
|
dinit) exec /usr/bin/dinitctl enable "$1" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
sv_disable() {
|
||||||
|
case "$init" in
|
||||||
|
openrc) exec /usr/bin/rc-update del "$1" default ;;
|
||||||
|
runit) exec touch /run/runit/service/"$1"/down ;;
|
||||||
|
s6) exec /usr/bin/s6-service delete default "$1" ;;
|
||||||
|
dinit) exec /usr/bin/dinitctl disable "$1" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -d /run/openrc ]; then
|
||||||
|
init=openrc
|
||||||
|
elif [-d /run/runit ]; then
|
||||||
|
init=runit
|
||||||
|
elif [ -d /run/s6-rc ]; then
|
||||||
|
init=s6
|
||||||
|
elif [ -S /run/dinitctl ]; then
|
||||||
|
init=dinit
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start) shift; sv_start "$@" ;;
|
||||||
|
stop) shift; sv_stop "$@" ;;
|
||||||
|
enable) shift; sv_enable "$@" ;;
|
||||||
|
disable) shift; sv_disable "$@" ;;
|
||||||
|
esac
|
||||||
|
|
Reference in New Issue
Block a user