Unified · Split
| @@ -18,4 +18,5 @@ install() { · 17 unmodified lines | |||
| 18 | inst_hook pre-pivot 02 "$moddir/display-manager-autologin.sh" | 18 | inst_hook pre-pivot 02 "$moddir/display-manager-autologin.sh" |
| 19 | inst_hook pre-pivot 03 "$moddir/copy-initramfs.sh" | 19 | inst_hook pre-pivot 03 "$moddir/copy-initramfs.sh" |
| 20 | inst_hook pre-pivot 04 "$moddir/locale.sh" | 20 | inst_hook pre-pivot 04 "$moddir/locale.sh" |
| 21 | inst_hook pre-pivot 05 "$moddir/services.sh" | ||
| 21 | } | 22 | } |
| @@ -0,0 +1,29 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | ||
| 3 | # ex: ts=8 sw=4 sts=4 et filetype=sh | ||
| 4 | |||
| 5 | type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh | ||
| 6 | |||
| 7 | SERVICEDIR=$NEWROOT/etc/sv/ | ||
| 8 | SERVICES="$(getarg live.services)" | ||
| 9 | |||
| 10 | for f in ${SERVICES}; do | ||
| 11 | ln -s /etc/sv/$f $NEWROOT/etc/runit/runsvdir/default/ | ||
| 12 | done | ||
| 13 | |||
| 14 | dhcpcd=1 | ||
| 15 | for f in connmand NetworkManager wicd; do | ||
| 16 | if [ -e $SERVICEDIR/$f ]; then | ||
| 17 | unset dhcpcd | ||
| 18 | fi | ||
| 19 | done | ||
| 20 | |||
| 21 | # Enable all services by default... with some exceptions. | ||
| 22 | for f in $SERVICEDIR/*; do | ||
| 23 | _service=${f##*/} | ||
| 24 | case "${_service}" in | ||
| 25 | agetty-console|sulogin|dhcpcd-*) ;; # ignored | ||
| 26 | dhcpcd) [ -n "$dhcpcd" ] && ln -sf ${f##$NEWROOT} $NEWROOT/etc/runit/runsvdir/default/;; | ||
| 27 | *) ln -sf ${f##$NEWROOT} $NEWROOT/etc/runit/runsvdir/default/;; | ||
| 28 | esac | ||
| 29 | done | ||