From bf1b3dbfafbbfd56e20fe51de8085f4138a5d501 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Mon, 15 Mar 2010 15:58:29 +0100 Subject: Adding the runlevel linker again (having the upstart component for newer Ubuntus and backward compability ...) --- initramfs/distro-specs/ubuntu/functions-default | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'initramfs/distro-specs/ubuntu/functions-default') diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default index ef7ece69..bfd01524 100644 --- a/initramfs/distro-specs/ubuntu/functions-default +++ b/initramfs/distro-specs/ubuntu/functions-default @@ -76,6 +76,31 @@ initial_boot () { : } +# runlevel linker - mostly deprecated in the old form because of new upstart +# mechanism (with backward compatibility) +rllinker () { +local script="$1" +# activating the new way, check if a appropriate script is available, else +# try the traditional approach +if [ -e /mnt/etc/init.inactive/${script}.conf ] ; then + mv /mnt/etc/init.inactive/${script}.conf /mnt/etc/init +elif [ -e /mnt/etc/init.d/${script} -a -n "$1" -a -n "$2" ] ; then + if [ $2 -lt 10 ] ; then + local start="0$2"; else local start="$2" + fi + if [ $3 -lt 10 ] ; then + local stop="0$3"; else local stop="$3" + fi + for i in rc2.d/K$stop$script rc3.d/K$stop$script \ + rc2.d/S$start$script rc3.d/S$start$script ; do + ln -sf ../init.d/$script /mnt/etc/$i + [ "$DEBUGLEVEL" == 5 ] && echo "Linked $script" + done +else + error echo "Target $(pwd)../${script} does not exist. Skipping links." +fi +} + # set up localization like keytable, console dlocale () { # fixme -- use keytable setup script here -- cgit v1.2.3-55-g7522