From b1a9e43de840b0d941d063cbdf4065bb69e163c0 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Tue, 17 Feb 2009 11:47:34 +0000 Subject: Produce proper output for "done", "failed" in SuSE ... git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2581 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/distro-specs/suse/functions-default | 95 ++++++++++++++------------- 1 file changed, 51 insertions(+), 44 deletions(-) (limited to 'initramfs') diff --git a/initramfs/distro-specs/suse/functions-default b/initramfs/distro-specs/suse/functions-default index 7b4ffc84..eefc0fda 100644 --- a/initramfs/distro-specs/suse/functions-default +++ b/initramfs/distro-specs/suse/functions-default @@ -35,39 +35,38 @@ D_DIRINDXS="/var/X11R6/compose-cache /var/run/sysconfig/tmp /var/adm \ # distro specific function called from servconfig script config_distro () { - # clean the runlevel directories which will be populated by the stage3 setup - for dir in rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d boot.d ; do - rm -rf /mnt/etc/init.d/${dir}/* - done - # link the additional key setup (notbook special keys) - grep -q -E "otebook" /etc/hwinfo.bios && \ - [ -e /mnt/etc/init.d/hotkey-setup ] && rllinker "hotkey-setup" 25 25 - - # no need to run start scripts in parallel - # enable magic sysrequest for the clients - sed -e "1i# /etc/sysconfig/sysctl - modified by $0 version $version" \ - -e "s,ENABLE_SYSRQ=.*,ENABLE_SYSRQ=\"yes\"," \ - -i /mnt/etc/sysconfig/sysctl - # add specific path /var/X11R6/bin ... - echo -e "# stuff generated by $0 (out of InitRamFS written $date)\n\ +# clean the runlevel directories which will be populated by the stage3 setup +for dir in rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d boot.d ; do + rm -rf /mnt/etc/init.d/${dir}/* +done +# link the additional key setup (notbook special keys) +grep -q -E "otebook" /etc/hwinfo.bios && \ + [ -e /mnt/etc/init.d/hotkey-setup ] && rllinker "hotkey-setup" 25 25 +# no need to run start scripts in parallel +# enable magic sysrequest for the clients +sed -e "1i# /etc/sysconfig/sysctl - modified by $0 version $version" \ + -e "s,ENABLE_SYSRQ=.*,ENABLE_SYSRQ=\"yes\"," \ + -i /mnt/etc/sysconfig/sysctl +# add specific path /var/X11R6/bin ... +echo -e "# stuff generated by $0 (out of InitRamFS written $date)\n\ PATH=\"\$PATH:/var/X11R6/bin\"\n\ test \"\$UID\" -ge 100 && PATH=\"\$PATH:.\"\n\ QTDIR=/usr/lib/qt3\nexport QTDIR\nno_proxy='localhost'\n\ export no_proxy" >/mnt/etc/SuSEconfig/profile - echo -e "SLX VERSION = $SLXVERSION\nINITRAMFS GENERATION DATE = $date" \ - >>/mnt/etc/SuSE-release +echo -e "SLX VERSION = $SLXVERSION\nINITRAMFS GENERATION DATE = $date" \ + >>/mnt/etc/SuSE-release - # remove annoying udev rule set for changing eth interface and rtc symlink - rm /mnt/etc/udev/rules.d/*persistent-net.rules \ - /mnt/etc/udev/rules.d/*net_persistent_names.rules >/dev/null 2>&1 - sed '/SYMLINK+="rtc"/d' -i \ +# remove annoying udev rule set for changing eth interface and rtc symlink +rm /mnt/etc/udev/rules.d/*persistent-net.rules \ + /mnt/etc/udev/rules.d/*net_persistent_names.rules >/dev/null 2>&1 +sed '/SYMLINK+="rtc"/d' -i \ /mnt/etc/udev/rules.d/50-udev-default.rules >/dev/null 2>&1 - # create a stateless specific halt script - echo -e '#!/bin/sh\n# script generated in InitRamFS (SLX stage3) - . /etc/rc.status\n - trap "echo" SIGINT SIGSEGV SIGQUIT SIGTERM\nset +e\n\n - case "$0" in\n\t*halt) +# create a stateless specific halt script +echo -e '#!/bin/sh\n# script generated in InitRamFS (SLX stage3) +. /etc/rc.status\n +trap "echo" SIGINT SIGSEGV SIGQUIT SIGTERM\nset +e\n\n +case "$0" in\n\t*halt) \t message="The system will be halted immediately." \t command="halt -p"\n\t ;;\n\t*reboot)\n \t message="Please stand by while rebooting the system..." @@ -76,13 +75,13 @@ rc_reset\ntest -e /etc/init.d/halt.local && { \techo Running /etc/init.d/halt.local\n\t/bin/sh /etc/init.d/halt.local \trc_status -v1 -r\n} echo $message\nexec $command -d -f' >/mnt/etc/init.d/halt - # add the halt link to the 0 and 6 runlevel directories - ln -sf ../halt /mnt/etc/init.d/rc0.d/S20halt - ln -sf ../halt /mnt/etc/init.d/rc6.d/S20reboot +# add the halt link to the 0 and 6 runlevel directories +ln -sf ../halt /mnt/etc/init.d/rc0.d/S20halt +ln -sf ../halt /mnt/etc/init.d/rc6.d/S20reboot - echo "LOGFILE=${LOGFILE}" >/mnt/etc/sysconfig/logfile - # fixme: rather ugly to write that boot script this way - echo ' +echo "LOGFILE=${LOGFILE}" >/mnt/etc/sysconfig/logfile +# fixme: rather ugly to write that boot script this way +echo ' #!/bin/sh # SuSE specific initial boot file modified for the use with OpenSLX clients # @@ -303,18 +302,26 @@ fi rc_reset exit 0' >/mnt/etc/init.d/boot - - # enable execution of all important start scripts - # running stuff in parallel seems to be rather useless and generates some - # difficult to solve problems. If you want to try nevertheless enable the - # following line and disable the latter one (switching off that feature) - sed -e "s,RUN_PARALLEL=.*,RUN_PARALLEL=\"no\"," \ - -i /mnt/etc/sysconfig/boot - # if YaST2 should be runnable (without much effect anyway) on the client - testmkd /mnt/var/log/YaST2 - # for screen sessions - testmkd /mnt/var/run/uscreens 4777 - echo "$host_name" > /mnt/etc/HOSTNAME +## end of initial stage4 boot script + +# enable execution of all important start scripts +# running stuff in parallel seems to be rather useless and generates some +# difficult to solve problems. If you want to try nevertheless enable the +# following line and disable the latter one (switching off that feature) +sed -e "s,RUN_PARALLEL=.*,RUN_PARALLEL=\"no\"," \ + -i /mnt/etc/sysconfig/boot +# if YaST2 should be runnable (without much effect anyway) on the client +testmkd /mnt/var/log/YaST2 +# for screen sessions +testmkd /mnt/var/run/uscreens 4777 +# set special SuSE HOSTNAME file +echo "$host_name" > /mnt/etc/HOSTNAME +# produce proper output formatting (of "done", "failed", ...) +sed -e '/^test $LINES/ { +i\ +# Script modified here by \$0 during stage3 bootup\ +LINECOL=$(stty size); LINES=${LINECOL% *}; COLUMNS=${LINECOL#* } +}' -e "/^if test -z \"\$LINES/,/fi$/d" -i /mnt/etc/rc.status } # initial (boot time) runlevel scripts -- cgit v1.2.3-55-g7522