summaryrefslogtreecommitdiffstats
path: root/src/initramfs/distro-specs/suse/functions-12.1
diff options
context:
space:
mode:
Diffstat (limited to 'src/initramfs/distro-specs/suse/functions-12.1')
-rw-r--r--src/initramfs/distro-specs/suse/functions-12.153
1 files changed, 48 insertions, 5 deletions
diff --git a/src/initramfs/distro-specs/suse/functions-12.1 b/src/initramfs/distro-specs/suse/functions-12.1
index 98daafa4..5f11e0a3 100644
--- a/src/initramfs/distro-specs/suse/functions-12.1
+++ b/src/initramfs/distro-specs/suse/functions-12.1
@@ -22,19 +22,63 @@
# D_DIRINDXS - directories in client filesystem which should be present
# anyhow
+# 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*
+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* *.wants/Network* \
+ *.wants/remote* *.wants/YaST2*";
+# translate wildcards
+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}
+done
+
+# enable magic sysrequest for the clients
+sed -e "1i# /etc/sysctl.conf - modified by $0 version $version" \
+ -e "s,kernel.sysrq =.*,kernel.sysrq = 1," \
+ -i /mnt/etc/sysctl.conf
+
+}
+
+
+# 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
+elif [ -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
testmkd /mnt/var/lib/rpcbind
-rllinker "rpcbind" 4 5
+rllinker "rpcbind"
}
+
# acpi and powersave daemons, required e.g. to shutdown the machine via
# power button, no need for early start
config_acpi () {
-rllinker acpid 22 12
+rllinker acpid
# dbus is required to run acpid and powersaved
start_dreshal="yes"
}
+
# configure dbus (inter application communication for kde and gnome), hal
# (hardware abstraction layer - used e.g. by powersaved)
config_dreshal () {
@@ -50,7 +94,6 @@ if [ "x$start_dreshal" = "xyes" ]; then
touch /mnt/var/lib/misc/PolicyKit.reload
chown polkituser.polkituser /mnt/var/lib/misc/PolicyKit.reload
- if [ -f /mnt/etc/init.d/dbus ] ; then
strinfile "messagebus:" /mnt/etc/passwd || \
echo "messagebus:x:102:103:User for D-BUS:/var/run/dbus:/bin/false" \
>> /mnt/etc/passwd
@@ -61,10 +104,10 @@ if [ "x$start_dreshal" = "xyes" ]; then
/mnt/etc/dbus-1/system.d/nm-*
rllinker "dbus" 1 20
- fi
fi
}
# function for ntp configuration
+#TODO: ntp we need a systemd startup script
config_ntp () {
if [ -e /mnt/etc/init.d/ntp ] ; then
if ! strinfile "ntp:" /mnt/etc/passwd ; then
@@ -76,7 +119,7 @@ if [ -e /mnt/etc/init.d/ntp ] ; then
testmkd /mnt/var/db
touch /mnt/var/db/ntp-kod
if [ "x$start_ntp" = "xyes" ] ; then
- rllinker "ntp" 2 14
+ rllinker "ntp"
fi
fi
}