Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
a28ed7f20d | |||
4739509ac7
|
|||
2d8d60c0bc
|
|||
04363a50bb
|
|||
f1368b1aa7
|
|||
51ef407331 | |||
33d9fd2da3 | |||
56f1455c77 | |||
5b35f20375 | |||
730908dc51 | |||
9672ce5b46
|
|||
9cf651405e
|
|||
65c79b931c | |||
19fae52dc0 | |||
1f62798998 |
25
Makefile
25
Makefile
@@ -1,4 +1,4 @@
|
|||||||
VERSION = 0.12
|
VERSION = 0.13.4
|
||||||
|
|
||||||
PKG = live-services
|
PKG = live-services
|
||||||
TOOLS = artools
|
TOOLS = artools
|
||||||
@@ -11,10 +11,17 @@ DATADIR = $(PREFIX)/share
|
|||||||
SYSUSERSDIR = $(PREFIX)/lib/sysusers.d
|
SYSUSERSDIR = $(PREFIX)/lib/sysusers.d
|
||||||
LIVEUSER ?= artix
|
LIVEUSER ?= artix
|
||||||
|
|
||||||
|
HOOKSDIR = $(DATADIR)/libalpm/hooks
|
||||||
|
SCRIPTSDIR = $(DATADIR)/libalpm/scripts
|
||||||
|
|
||||||
FMODE = -m0644
|
FMODE = -m0644
|
||||||
DMODE = -dm0755
|
DMODE = -dm0755
|
||||||
BMODE = -m0755
|
BMODE = -m0755
|
||||||
|
|
||||||
|
|
||||||
|
ALPMSCRIPTS = $(wildcard libalpm/scripts/*)
|
||||||
|
ALPMHOOKS = $(wildcard libalpm/hooks/*)
|
||||||
|
|
||||||
BIN = \
|
BIN = \
|
||||||
bin/artix-live
|
bin/artix-live
|
||||||
|
|
||||||
@@ -98,6 +105,12 @@ install_base:
|
|||||||
install $(DMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)
|
install $(DMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)
|
||||||
install $(FMODE) $(SHARED) $(DESTDIR)$(DATADIR)/$(TOOLS)
|
install $(FMODE) $(SHARED) $(DESTDIR)$(DATADIR)/$(TOOLS)
|
||||||
|
|
||||||
|
install_alpm:
|
||||||
|
install $(DMODE) $(DESTDIR)$(SCRIPTSDIR)
|
||||||
|
install $(DMODE) $(DESTDIR)$(HOOKSDIR)
|
||||||
|
install $(BMODE) $(ALPMSCRIPTS) $(DESTDIR)$(SCRIPTSDIR)
|
||||||
|
install $(FMODE) $(ALPMHOOKS) $(DESTDIR)$(HOOKSDIR)
|
||||||
|
|
||||||
install_rc:
|
install_rc:
|
||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/init.d
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/init.d
|
||||||
install $(BMODE) $(RC) $(DESTDIR)$(SYSCONFDIR)/init.d
|
install $(BMODE) $(RC) $(DESTDIR)$(SYSCONFDIR)/init.d
|
||||||
@@ -112,7 +125,7 @@ install_runit:
|
|||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init
|
||||||
install $(BMODE) $(RUNIT_SV) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init/run
|
install $(BMODE) $(RUNIT_SV) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init/run
|
||||||
|
|
||||||
install_s6:
|
install_s6: install_alpm
|
||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv
|
||||||
|
|
||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/pacman-init
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/pacman-init
|
||||||
@@ -121,7 +134,7 @@ install_s6:
|
|||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/artix-live
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/artix-live
|
||||||
install $(BMODE) $(S6_LIVE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/artix-live/
|
install $(BMODE) $(S6_LIVE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/artix-live/
|
||||||
|
|
||||||
install_66:
|
install_66: install_alpm
|
||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/66/service
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/66/service
|
||||||
|
|
||||||
install $(FMODE) $(66_LIVE) $(DESTDIR)$(SYSCONFDIR)/66/service/artix-live
|
install $(FMODE) $(66_LIVE) $(DESTDIR)$(SYSCONFDIR)/66/service/artix-live
|
||||||
@@ -129,12 +142,12 @@ install_66:
|
|||||||
|
|
||||||
install_dinit:
|
install_dinit:
|
||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/scripts
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/scripts
|
||||||
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/boot.d
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/live.d
|
||||||
install $(FMODE) $(DINIT_LIVE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/artix-live
|
install $(FMODE) $(DINIT_LIVE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/artix-live
|
||||||
install $(FMODE) $(DINIT_PI) $(DESTDIR)$(SYSCONFDIR)/dinit.d/pacman-init
|
install $(FMODE) $(DINIT_PI) $(DESTDIR)$(SYSCONFDIR)/dinit.d/pacman-init
|
||||||
install $(BMODE) $(DINIT_PI_SCRIPT) $(DESTDIR)$(SYSCONFDIR)/dinit.d/scripts/pacman-init
|
install $(BMODE) $(DINIT_PI_SCRIPT) $(DESTDIR)$(SYSCONFDIR)/dinit.d/scripts/pacman-init
|
||||||
ln -s ../artix-live $(DESTDIR)$(SYSCONFDIR)/dinit.d/boot.d
|
ln -s ../artix-live $(DESTDIR)$(SYSCONFDIR)/dinit.d/live.d
|
||||||
ln -s ../pacman-init $(DESTDIR)$(SYSCONFDIR)/dinit.d/boot.d
|
ln -s ../pacman-init $(DESTDIR)$(SYSCONFDIR)/dinit.d/live.d
|
||||||
|
|
||||||
install_xdg:
|
install_xdg:
|
||||||
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
||||||
|
@@ -9,6 +9,5 @@
|
|||||||
@execute = (
|
@execute = (
|
||||||
foreground { mkdir -p /etc/pacman.d/gnupg }
|
foreground { mkdir -p /etc/pacman.d/gnupg }
|
||||||
foreground { mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg }
|
foreground { mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg }
|
||||||
fdmove -c 2 1
|
|
||||||
foreground { pacman-key --init }
|
foreground { pacman-key --init }
|
||||||
foreground { pacman-key --populate artix } )
|
foreground { pacman-key --populate artix } )
|
||||||
|
12
libalpm/hooks/60-enable-liveservices.hook
Normal file
12
libalpm/hooks/60-enable-liveservices.hook
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[Trigger]
|
||||||
|
Operation = Install
|
||||||
|
Operation = Upgrade
|
||||||
|
Type = Package
|
||||||
|
Target = artix-live-s6
|
||||||
|
Target = artix-live-suite66
|
||||||
|
|
||||||
|
[Action]
|
||||||
|
Description = Enabling live services ...
|
||||||
|
When = PostTransaction
|
||||||
|
Exec = /usr/share/libalpm/scripts/liveservices-hook enable
|
||||||
|
NeedsTargets
|
11
libalpm/hooks/65-disable-liveservices.hook
Normal file
11
libalpm/hooks/65-disable-liveservices.hook
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[Trigger]
|
||||||
|
Operation = Remove
|
||||||
|
Type = Package
|
||||||
|
Target = artix-live-s6
|
||||||
|
Target = artix-live-suite66
|
||||||
|
|
||||||
|
[Action]
|
||||||
|
Description = Disabling live services ...
|
||||||
|
When = PreTransaction
|
||||||
|
Exec = /usr/share/libalpm/scripts/liveservices-hook disable
|
||||||
|
NeedsTargets
|
94
libalpm/scripts/liveservices-hook
Normal file
94
libalpm/scripts/liveservices-hook
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
# Only needed for s6 and suite66.
|
||||||
|
|
||||||
|
s6_enable_live_services(){
|
||||||
|
if [ -d /etc/s6/sv/gdm/dependencies.d ]; then
|
||||||
|
touch /etc/s6/sv/gdm/dependencies.d/artix-live
|
||||||
|
fi
|
||||||
|
if [ -d /etc/s6/sv/lightdm-srv/dependencies.d ]; then
|
||||||
|
touch /etc/s6/sv/lightdm-srv/dependencies.d/artix-live
|
||||||
|
fi
|
||||||
|
if [ -d /etc/s6/sv/sddm/dependencies.d ]; then
|
||||||
|
touch /etc/s6/sv/sddm/dependencies.d/artix-live
|
||||||
|
fi
|
||||||
|
# TODO: instead touch files under dependencies.d when s6-scripts updates
|
||||||
|
echo "artix-live" >> /etc/s6/sv/default/contents
|
||||||
|
echo "pacman-init" >> /etc/s6/sv/default/contents
|
||||||
|
}
|
||||||
|
|
||||||
|
s6_disable_live_services(){
|
||||||
|
# TODO: delete files under dependencies.d when s6-scripts updates
|
||||||
|
sed -i '/artix-live/d' /etc/s6/sv/default/contents
|
||||||
|
sed -i '/pacman-init/d' /etc/s6/sv/default/contents
|
||||||
|
rm -f /etc/s6/sv/gdm/dependencies.d/artix-live
|
||||||
|
rm -f /etc/s6/sv/lightdm-srv/dependencies.d/artix-live
|
||||||
|
rm -f /etc/s6/sv/sddm/dependencies.d/artix-live
|
||||||
|
}
|
||||||
|
|
||||||
|
suite66_enable_live_services(){
|
||||||
|
[ -d /var/lib/66/system/boot ] || 66-tree -n boot
|
||||||
|
[ -d /var/lib/66/system/default ] || 66-tree -ncE default
|
||||||
|
66-enable -t default artix-live pacman-init
|
||||||
|
|
||||||
|
if [ -f /usr/bin/gdm ]; then
|
||||||
|
66-disable -t default logind gdm
|
||||||
|
sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/gdm
|
||||||
|
66-enable -t default logind gdm
|
||||||
|
elif [ -f /usr/bin/lightdm ]; then
|
||||||
|
66-disable -t default logind lightdm
|
||||||
|
sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/lightdm
|
||||||
|
66-enable -t default logind lightdm
|
||||||
|
elif [ -f /usr/bin/sddm ]; then
|
||||||
|
66-disable -t default logind sddm
|
||||||
|
sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/sddm
|
||||||
|
66-enable -t default logind sddm
|
||||||
|
fi
|
||||||
|
|
||||||
|
66-enable -t boot -F boot@system
|
||||||
|
}
|
||||||
|
|
||||||
|
suite66_disable_live_services(){
|
||||||
|
66-disable -t default artix-live pacman-init
|
||||||
|
|
||||||
|
if [ -f /usr/bin/gdm ]; then
|
||||||
|
66-disable -t default logind gdm
|
||||||
|
sed -i -E 's# artix-live pacman-init##' /etc/66/service/gdm
|
||||||
|
66-enable -t default logind gdm
|
||||||
|
elif [ -f /usr/bin/lightdm ]; then
|
||||||
|
66-disable -t default logind lightdm
|
||||||
|
sed -i -E 's# artix-live pacman-init##' /etc/66/service/lightdm
|
||||||
|
66-enable -t default logind lightdm
|
||||||
|
elif [ -f /usr/bin/sddm ]; then
|
||||||
|
66-disable -t default logind sddm
|
||||||
|
sed -i -E 's# artix-live pacman-init##' /etc/66/service/sddm
|
||||||
|
66-enable -t default logind sddm
|
||||||
|
fi
|
||||||
|
|
||||||
|
66-enable -t boot -F boot@system
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_live_services() {
|
||||||
|
if [ -f /usr/bin/s6-init ]; then
|
||||||
|
s6_enable_live_services
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /usr/bin/suite66-init ]; then
|
||||||
|
suite66_enable_live_services
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_live_services() {
|
||||||
|
if [ -f /usr/bin/s6-init ]; then
|
||||||
|
s6_disable_live_services
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /usr/bin/suite66-init ]; then
|
||||||
|
suite66_disable_live_services
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
enable) enable_live_services ;;
|
||||||
|
disable) disable_live_services ;;
|
||||||
|
*) echo >&2 " Invalid operation '$1'"; exit 1 ;;
|
||||||
|
esac
|
Reference in New Issue
Block a user