From 48ab8f8aa6bdea343ec949fa4563ec588e0382da Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Mon, 28 Nov 2011 14:38:29 +0100 Subject: update rllinker for suse 12.1 --- src/initramfs/distro-specs/suse/functions-12.1 | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/initramfs') diff --git a/src/initramfs/distro-specs/suse/functions-12.1 b/src/initramfs/distro-specs/suse/functions-12.1 index a6b5db36..3b05ca2d 100644 --- a/src/initramfs/distro-specs/suse/functions-12.1 +++ b/src/initramfs/distro-specs/suse/functions-12.1 @@ -25,16 +25,17 @@ # distro specific function called from servconfig script config_distro () { # clean the runlevel directories which will be populated by the stage3 setup -#rm -rf /mnt/etc/init.d* +rm -rf /mnt/etc/init.d* touch /mnt/var/log/btmp touch /mnt/var/log/lastlog SERVICES="systemd-hostnamed.service dbus-org.freedesktop.hostname1.service \ remount-rootfs.service avahi-dnsconfd.service fsck* \ - Network* postfix* multi-user.target.wants/Network* \ - multi-user.target.wants/remote* default.target.wants/YaST2* \ - network.target.wants/Network*"; + Network* postfix* *.wants/Network* \ + *.wants/remote* *.wants/YaST2*"; # translate wildcards -SERVICES=$(cd /mnt/lib/systemd/system/ && ls -1 $SERVICES) +SERVICES_LIB=$(cd /mnt/lib/systemd/system/ && for f in $SERVICES; do echo $f; done| grep -v '*') +SERVICES_ETC=$(cd /mnt/etc/systemd/system/ && for f in $SERVICES; do echo $f; done| grep -v '*') +SERVICES=$(echo -e "$SERVICES_ETC\n$SERVICES_LIB" | sort -u) for file in $SERVICES; do ln -sf /dev/null /mnt/etc/systemd/system/${file} @@ -48,6 +49,21 @@ sed -e "1i# /etc/sysctl.conf - modified by $0 version $version" \ } +# linking runlevel scripts +rllinker () { +local script="$1" +# empty runlevel links - decision on running certain services is +# passed via configuration +if [ -f /mnt/etc/systemd/system/${script}.service ]; then + ln -sf /etc/systemd/system/${script}.service \ + /mnt/etc/systemd/system/default.target.wants/${script}.service +else if [ -f /mnt/lib/systemd/system/${script}.service ]; then + ln -sf /lib/systemd/system/${script}.service \ + /mnt/etc/systemd/system/default.target.wants/${script}.service +fi +} + + # start portmapper (needed at least for nfs and nis services) config_portmap () { # portmap is provided via rpcbind in suse 11.1,2,3,4 and 12.1 -- cgit v1.2.3-55-g7522