From db3bdeb697a06b35cce61b52d83858757e82b8ec Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 13 Jan 2008 18:19:14 +0000 Subject: reimplemented splashy stuff via Theme plugin: * activated invocation of init-hooks * removed explicit splashy calls from init (they are now done in several init-hooks provided by the Theme plugin) * the stage3 plugins are now invoked via '.' instead via a separate shell, such that they can export changed environment variables * changed invocation of initial_boot() - we now pass in the list of initscripts as otherwise I have been unable to let this function access a changed D_INITSCRIPTS variable (it would only see initial content) * moved invocation of initial_boot from servconfig to init (again such that a changed D_INITSCRIPTS will be handled correctly) * config-demuxer now passes the active plugins into mkdxsinitrd * mkdxsinitrd accepts a list of active plugins (-p) and copies the hooks directly into the initialramfs, such that they are available immediately in stage3 The bootsplash stuff (splashy) seems to work properly, but the handling of displaymanager themes is currently broken. I will look into that tomorrow. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1472 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/distro-specs/gentoo/functions-default | 3 +- initramfs/initrd-stuff/bin/servconfig | 25 ---------------- initramfs/initrd-stuff/etc/functions | 12 ++++---- initramfs/initrd-stuff/init | 38 ++++--------------------- initramfs/mkdxsinitrd | 12 +++++++- 5 files changed, 26 insertions(+), 64 deletions(-) (limited to 'initramfs') diff --git a/initramfs/distro-specs/gentoo/functions-default b/initramfs/distro-specs/gentoo/functions-default index 363d35b3..74d0e794 100644 --- a/initramfs/distro-specs/gentoo/functions-default +++ b/initramfs/distro-specs/gentoo/functions-default @@ -55,6 +55,7 @@ echo -e "\tafter $1\n}" >> /tmp/sedscript # setup initial boot scripts (rather strange concept I did not get # completely) initial_boot () { +local scripts=$* local after="" local script d_mkrlscript init boot "Starting Gentoo base initialization" @@ -120,7 +121,7 @@ cat >>/mnt/etc/${D_INITDIR}/boot <>/mnt/etc/resolv.conf; done; } -############################################################################# -# initial boot scripts -# delete and create runlevel links for initial booting (SuSE, Debian, Ubuntu, -# Fedora, ...) -# splashy stuff -if [ ${nosplash} = 0 ]; then - D_INITSCRIPTS="${D_INITSCRIPTS} splashy.stop" - d_mkrlscript init splashy.stop "Stopping Splashy ..." - echo -e "\t/var/lib/openslx/bin/splashy_update exit 2>/dev/null - \tkillall -9 splashy\n\trm -f /var/lib/openslx/bin/splashy_update" \ - >>/mnt/etc/${D_INITDIR}/splashy.stop - d_mkrlscript close splashy.stop "" -fi - -initial_boot - ############################################################################# # run distro specific configuration function config_distro @@ -438,15 +422,6 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then /mnt/etc/vmware/vmnet8/nat 2>/dev/null fi -############################################################################# -# theming -testmkd /mnt/var/lib/openslx/themes/displaymanager -testmkd /mnt/var/lib/openslx/bin -[ -d /usr/share/themes/displaymanager ] && \ - cp -a /usr/share/themes/displaymanager /mnt/var/lib/openslx/themes -[ -d /etc/splashy -a ${nosplash} = 0 ] && (cp -a /bin/splashy_update \ - /mnt/var/lib/openslx/bin) - ############################################################################# # preparation of /tmp directory (partition 44, nfs scratch, ramdisk). there # might be the chance that we have a disk partition available, so wait for diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 830e7008..577bf9b8 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -556,9 +556,9 @@ fi # execute all shell scripts in the given init-hook folder runinithook () { local hook=$1 -if [ -d /initramfs/init-hooks/$hook ]; then - for hook_script in /initramfs/init-hooks/$hook/*; do - . hook_script +if [ -d /etc/init-hooks/$hook ]; then + for hook_script in /etc/init-hooks/$hook/*; do + . $hook_script done fi } @@ -846,15 +846,17 @@ esac # setup initial boot scripts (for most standard distributions, gentoo is to # be handled differently) initial_boot () { +local scripts=$* local count=10 # boot.slx is a special runlevel script generated within initialramfs which # should be executed before the normal runlevel scripts. Proper shutdown is # not needed!? -for i in boot.slx ${D_INITSCRIPTS}; do +for i in boot.slx $scripts; do count=$(($count + 1)) - revcnt=$((41 - $count)) + echo "boot-runlevelscript $i" ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/S${count}$i # uncomment if proper shutdown of bootup scripts is required + #revcnt=$((41 - $count)) #ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/K${revcnt}$i done } diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 7cfba25b..28a98459 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -113,15 +113,6 @@ echo "noldap" > /tmp/ldap-done # standard path (.../tftpboot/client-config/ ...) file="yes" -# splashy stuff seems to depend on /proc/fb with VESA!? -# only activate with kernel option quiet -if grep -E "(VESA|VGA)" /proc/fb > /dev/null 2>&1 \ - && grep -qi " quiet " /proc/cmdline > /dev/null 2>&1; then - export nosplash=0 -else - export nosplash=1 -fi - # read kernel commandline read KCMDLINE < /proc/cmdline export KCMDLINE @@ -137,14 +128,12 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup # single token for debugging ... debug) DEBUGLEVEL=1 - nosplash=1 ;; # ... or a specified debug level debug=*) DEBUGLEVEL=${opts#debug=} [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 20 ] && \ echo "** SLX init started near $(sysup)" - [ ${DEBUGLEVEL} != 0 ] && nosplash=1 ;; # essid for WLAN boot (experimental, might be moved to a module component # in later versions @@ -281,9 +270,6 @@ done runinithook '05-have-kernelvars' -# splashy stuff -[ ${nosplash} = 0 ] && /bin/splashy boot 2>/dev/null - # at this point a timer should be started to ensure an automated reboot # or halt of the machine if SLX init does not succeed (e.g. missing kernel # module for the network adaptor) @@ -566,9 +552,6 @@ $(sysup)" # and should be generalized for nbd, dnbd, iscsi fi -# splashy stuff -[ ${nosplash} = 0 ] && /bin/splashy_update "progress 10" 2>/dev/null - # if no type of root filesystem is passed via kernel command line try # information gathered from dhcp process (only valid for nfs) if [ -z "${bldmod}" -a -z "${bldhost}" -a -z "${nfsroot}" ] ; then @@ -637,9 +620,6 @@ if [ -n "${aufs}" ]; then fi fi -# splashy stuff -[ ${nosplash} = 0 ] && /bin/splashy_update "progress 30" 2>/dev/null - # setup of client root filesystem dependent on the availability of UnionFS if [ -n "${unionfs}" -o -n "${aufs}" ] ; then echo "Using ${union_type} for rw access" @@ -714,9 +694,6 @@ fi runinithook '50-have-layered-fs' -# splashy stuff -[ ${nosplash} = 0 ] && /bin/splashy_update "progress 50" 2>/dev/null - # script for stuff to execute during early bootup d_mkrlscript init boot.slx "Running configuration postponed from InitRamFS" echo "fs complete at $(sysup)" >/tmp/fscmpl @@ -772,9 +749,6 @@ fi runinithook '60-have-servconfig' -# splashy stuff -[ ${nosplash} = 0 ] && /bin/splashy_update "progress 80" 2>/dev/null - # wait a while for hardware setup to complete and copy stuff to stage4 waitfor /tmp/hwcfg 20000 || error "$init_errhw" [ -f /tmp/scanner-udev ] && cat /tmp/scanner-udev \ @@ -817,14 +791,17 @@ runinithook '70-before-plugins' # check for any plugin-specific runlevel scripts and run them, if found: if [ -d /initramfs/plugin-init.d ]; then for plugin_starter in /initramfs/plugin-init.d/*; do - [ $DEBUGLEVEL -gt 0 ] && \ - echo "Running plugin starter $plugin_starter ..." - /bin/sh $plugin_starter + [ $DEBUGLEVEL -gt 0 ] \ + && echo "Running plugin starter $plugin_starter ..." + . $plugin_starter done fi runinithook '80-after-plugins' +# create links for initial stage4 boot scripts +initial_boot $D_INITSCRIPTS + # post init for some distro specific postinit [ -s /initramfs/postinit.local ] && { @@ -875,8 +852,5 @@ unset BOOT_IMAGE KCMDLINE KERNEL MODPRV NWMODULES OLDPWD UDEVD_EVENT_TIMEOUT \ runinithook '99-handing-over' -# splashy stuff -[ ${nosplash} = 0 ] && /bin/splashy_update "progress 100" 2>/dev/null - # new style of pivoting (switch_root or run-init) exec /bin/switch_root -c dev/console /mnt /sbin/init || error "$init_runinit" diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd index 46225024..b822ee9e 100755 --- a/initramfs/mkdxsinitrd +++ b/initramfs/mkdxsinitrd @@ -82,6 +82,7 @@ usage() echo " -f list of blockdev/filesystem modules" echo " -n list of network adaptor modules" echo " -m list of misc modules not covered by -f or -n" + echo " -p list of active plugins" echo " -r path to stage1 root (vendor OS, e.g. /var/opt/openslx/stage1/suse-..." echo " -S name of the system for which the initramfs is built" echo " -s theme (for splash)" @@ -298,7 +299,7 @@ echo ######################################################################### # End of function declaration -while getopts :Cdhk:c:i:r:o:s:f:n:m:S:tu:wI:a: a ; do +while getopts :Cdhk:c:i:r:o:s:f:n:m:p:S:tu:wI:a: a ; do case $a in \:|\?) case $OPTARG in @@ -308,6 +309,7 @@ while getopts :Cdhk:c:i:r:o:s:f:n:m:S:tu:wI:a: a ; do f) echo "-f requires file system module (list) parameter";; n) echo "-n requires network module (list) parameter";; m) echo "-m requires misc module (list) parameter";; + p) echo "-p requires plugins (list) parameter";; r) echo "-r requires root dir parameter";; s) echo "-s may require theme name";; I) echo "-I requires network interface parameter";; @@ -326,6 +328,7 @@ while getopts :Cdhk:c:i:r:o:s:f:n:m:S:tu:wI:a: a ; do f) FSMODULES=$OPTARG;; n) NWMODULES=$OPTARG;; m) MISCMODULES=$OPTARG;; + p) PLUGINS=$OPTARG;; r) ROOTDIR=$OPTARG;; s) theme=$OPTARG;; S) SYSTEM_NAME=$OPTARG;; @@ -730,6 +733,13 @@ if [ -z "$cdboot" ] ; then test -f ${SLX_PRIVATE_PATH}/config/$cfg && \ cp ${SLX_PRIVATE_PATH}/config/$cfg ${INSTDIR}/bin done + # copy init-hooks from all plugins which are going to be executed in stage3 + mkdir -p ${INSTDIR}/etc/init-hooks + for plugin in $PLUGINS ; do + test -d ${SLX_BASE_PATH}/lib/plugins/$plugin/init-hooks && \ + cp -r ${SLX_BASE_PATH}/lib/plugins/$plugin/init-hooks/* \ + ${INSTDIR}/etc/init-hooks/ + done # custom hardware configuration files pcitable.local and Cards.local # fixme!! New source for these files (instead of templates)! if [ -f ${SLX_SHARE_PATH}/templates/pcitable.local ] ; then -- cgit v1.2.3-55-g7522