diff options
author | Dirk von Suchodoletz | 2007-04-05 00:14:42 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-04-05 00:14:42 +0200 |
commit | 01fc142f21e29e51952d5ec50f15047810650c6d (patch) | |
tree | 3a6ac944c1e3c4478aa382e8ca0a22d3bfa34ce3 | |
parent | added path /var/X11R6/bin to .desktop files for KDM start. (diff) | |
download | core-01fc142f21e29e51952d5ec50f15047810650c6d.tar.gz core-01fc142f21e29e51952d5ec50f15047810650c6d.tar.xz core-01fc142f21e29e51952d5ec50f15047810650c6d.zip |
Writing halt script for SuSE systems from functions-*, see #111
Pass SLXVERSION string (via slxconfig, slxconf_slxver -> SLXVERSION) for
better version marking ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@863 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r-- | initramfs/distro-specs/suse/functions-default | 15 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/bin/servconfig | 13 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/init | 3 | ||||
-rwxr-xr-x | initramfs/mkdxsinitrd | 10 | ||||
-rwxr-xr-x | initramfs/slxmkramfs | 4 |
5 files changed, 32 insertions, 13 deletions
diff --git a/initramfs/distro-specs/suse/functions-default b/initramfs/distro-specs/suse/functions-default index e549d56e..92a032f5 100644 --- a/initramfs/distro-specs/suse/functions-default +++ b/initramfs/distro-specs/suse/functions-default @@ -31,8 +31,21 @@ 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 "DXS VERSION = 4.1.0\nINITRAMFS GENERATION DATE = $date" \ +echo -e "SLX VERSION = $SLXVERSION\nINITRAMFS GENERATION DATE = $date" \ >> /mnt/etc/SuSE-release +# 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..." +\t command="reboot"\n\t ;;\nesac\n +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/${D_INITDIR}/halt # add the halt link to the 0 and 6 runlevel directories ln -sf ../halt /mnt/etc/${D_INITDIR}/rc0.d/S20halt ln -sf ../halt /mnt/etc/${D_INITDIR}/rc6.d/S20reboot diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig index f65ccb70..0fa0d395 100755 --- a/initramfs/initrd-stuff/bin/servconfig +++ b/initramfs/initrd-stuff/bin/servconfig @@ -11,7 +11,7 @@ # # universal (distro independent) configuration script for OpenSLX linux # diskless clients (executed in stage3 within initial ramfs). The file- -# system is setup when servconfig starts +# system setup is completed when servconfig starts ############################################################################# # check for configuration files to source @@ -24,6 +24,7 @@ # specific functions may overwrite functions defined in /etc/functions . /etc/sysconfig/config . /etc/distro-functions +. /etc/sysconfig/slxconfig # get location of logfile definition . /mnt/etc/${D_SYSCONFDIR}/logfile @@ -58,10 +59,10 @@ cfgcomplete cp -a /rootfs/* /mnt 2>/dev/null # set greeting and add information on booted system (distro) -len=$(expr length $DISTRO) -dstr="$DISTRO)" -while [ $len -le 16 ] ; do - dstr="$dstr " +len=$(expr length ${SLXVERSION}${DISTRO}) +vdstr="v${SLXVERSION}/${DISTRO})" +while [ $len -le 20 ] ; do + vdstr="$vdstr " len=$(expr $len + 1) done len=$(expr length $host_name) @@ -78,7 +79,7 @@ echo " | |_| | | | |___| | | | ____| | |___ / / _____/|__| |______|__| |__| |_______|______|__| |__| - Diskless Workstation (v4.0.8/$dstr (c) <OpenSLX.ORG project> + Stateless Workstation ($vdstr (c) <OpenSLX.ORG project> ">/mnt/etc/issue ############################################################################# diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 8e5c4580..d68d18a8 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -39,6 +39,7 @@ export DEBUGLEVEL=0 export KERNEL="${slxconf_kernver}" export NWMODULES="${slxconf_listnwmod}" export DISTRO="${slxconf_distro}" +export SLXVERSION="${slxconf_slxver}" # do not use dnbd cache file nodnbdcache="yes" @@ -656,6 +657,6 @@ umount -n /proc # unset old environment variables unset debug date initrd ip dnbdroot nbdroot nfsroot rootfs ticks vci vga unset BOOT_IMAGE KCMDLINE KERNEL MODPRV NWMODULES OLDPWD UDEVD_EVENT_TIMEOUT \ - UDEVD_EXPECTED_SEQNUM PATH + SLXVERSION UDEVD_EXPECTED_SEQNUM PATH # new style of pivoting (switch_root or run-init in klibc) exec /bin/switch_root -c dev/console /mnt /sbin/init || error "$init_runinit" diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd index a85ca6ae..1d86c90c 100755 --- a/initramfs/mkdxsinitrd +++ b/initramfs/mkdxsinitrd @@ -96,8 +96,8 @@ usage() echo " Kernelmodule (misc) die nicht von -n bzw. -f abgedeckt werden" echo " (z.B. xenbr for xen network bridge)." echo " -r path" - echo " Pfad zum Wurzelverzeichnis des zu exportierenden Betriebsystems" - echo " (z.B. /export/10.1)." + echo " Pfad zum Wurzelverzeichnis des Ausgangssystems (Vendor-OS)" + echo " (z.B. /var/opt/openslx/stage1/suse-10.2)." echo " -s theme (for splash)" echo " -d debug (add special modules to initramfs)" echo " -D Name" @@ -192,8 +192,10 @@ else -e "s,@@@DATE@@@,${DATE},g;/^#[^!].*/d" \ ${SLX_SHARE_PATH}/initramfs/${FILENAME} >> ${INSTDIR}/${FILENAME} # ugly hack for creating a general slx config file instead of "patching" - # the stage3 init - echo -e "slxconf_date=${DATE}\nslxconf_kernver=${KERNVER}\nslxconf_listnwmod=\"${NWMODULES}\"\nslxconf_distro=${DISTRO}-${DISTRO_VER}" > ${INSTDIR}/etc/sysconfig/slxconfig + # the stage3 init - fixme: version string should be added in a more clever way + echo -e "slxconf_date=${DATE}\nslxconf_kernver=${KERNVER}\n\ +slxconf_listnwmod=\"${NWMODULES}\"\nslxconf_distro=${DISTRO}-${DISTRO_VER}\n\ +slxconf_slxver=\"4.0.8b\"" > ${INSTDIR}/etc/sysconfig/slxconfig [ "$use_busybox" = 1 ] && sed -e "s,^#!/bin/sh,#!/bin/ash," \ -i ${INSTDIR}/${FILENAME} fi diff --git a/initramfs/slxmkramfs b/initramfs/slxmkramfs index e07b186f..a0fe3914 100755 --- a/initramfs/slxmkramfs +++ b/initramfs/slxmkramfs @@ -91,7 +91,7 @@ usage() echo " -m module list of otherwise uncovered modules, e.g. xen stuff" echo " -n module list of client network adaptors to support" echo " -r path to the root of the stage1 system you are preparing" - echo " ramdisk for" + echo " ramdisk for e.g. /var/opt/openslx/stage1/suse-10.2" echo " -s settings-file" echo " -T theme (for splash)" echo " -d debug (add special modules to initramfs)" @@ -316,6 +316,8 @@ mkdir -p ${INSTDIR}/etc/sysconfig if [ -n "${settings_file}" ] ; then # copy settings file (slxconfig) into the right place: cp $settings_file ${INSTDIR}/etc/sysconfig/slxconfig + # fixme: echo version number + echo 'slxconf_slxver="4.0.8b"' >> ${INSTDIR}/etc/sysconfig/slxconfig fi # if still no distro name set, try to find it using significant files |