summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-01-28 13:44:22 +0100
committerDirk von Suchodoletz2009-01-28 13:44:22 +0100
commitddad116182104be171a9b958d449d6525979e295 (patch)
tree9071cc8a0e95f852c2f686cdcc503d8f5d97c2f4
parentAvoid interpretation of shell script variables by perl. (diff)
downloadcore-ddad116182104be171a9b958d449d6525979e295.tar.gz
core-ddad116182104be171a9b958d449d6525979e295.tar.xz
core-ddad116182104be171a9b958d449d6525979e295.zip
Rearranging preboot environment file structure.
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2537 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-xboot-env/preboot-cd/init60
-rw-r--r--boot-env/preboot-cd/preboot.sh35
-rw-r--r--initramfs/preboot/boot.mconf19
-rw-r--r--initramfs/preboot/mconf_examples144
-rw-r--r--initramfs/preboot/preboot.sh52
5 files changed, 53 insertions, 257 deletions
diff --git a/boot-env/preboot-cd/init b/boot-env/preboot-cd/init
index e25c8607..987c8192 100755
--- a/boot-env/preboot-cd/init
+++ b/boot-env/preboot-cd/init
@@ -1,5 +1,5 @@
#!/bin/ash
-# Copyright (c) 2008 - OpenSLX GmbH
+# Copyright (c) 2008..2009 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -9,8 +9,8 @@
#
# General information about OpenSLX can be found at http://openslx.org
#
-# Main script for cd-boot demo initial ramfs - preloading environment for
-# for running OpenSLX linux stateless clients version 4 for testing
+# Main script for preboot initial ramfs - preloading environment for running
+# OpenSLX linux stateless clients version 5 for testing
fetchip () {
# we expect to get an ip address within 10++ seconds
@@ -34,10 +34,9 @@ done
}
#############################################################################
-# device files get their own filesystem (to be move mounted later)
+# device files get their own filesystem
devdir="/dev"
mount -n -t tmpfs -o 'size=25%,mode=0755' initramfsdevs ${devdir}
-NWMODULES="forcedeth e1000 e100 tg3 3c59x via-rhine r8169 pcnet32 b44 8139too"
DEBUGLEVEL=0
# create basic device files an directories in dev (for most hardware related
@@ -54,38 +53,20 @@ for i in "/dev/mem c 1 1" "/dev/null c 1 3" "/dev/zero c 1 5" \
done
mkdir -p ${devdir}/pts ${devdir}/shm ${devdir}/.udevdb ${devdir}/.udev
-# source functions file common for all distros, messages contains all error
-# and info output (for some reason the error output is not produced properly
-# - crash)
-
# initramfs-setup configuration (common settings for all clients using a
# certain InitRamFS generated by slxmkramfs/mkdxsinitrd)
[ -f /etc/initramfs-setup ] && . /etc/initramfs-setup 2>/dev/null
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin
-# set a default LAN interface, might be modified for WLAN or on machines with
-# more than one ethernet card built in
+# set a default LAN interface, has to be modified for WLAN or on machines
+# with more than one ethernet card built in
nwif="eth0"
# mount the important standard directories
[ ! -f /proc/cpuinfo ] && mount -n -t proc proc /proc
[ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys
-# keep quiet
-#echo "0 0 0 0" >/proc/sys/kernel/printk
-
-# fixme: shut down if script fails
-trap "exec (sleep 30; echo o>/proc/sysrq-trigger)" \
- SIGHUP SIGINT SIGPIPE SIGTERM
-
-# if no kernel version is set, try to get it directly from /proc
-if [ -z $KERNEL ] ; then
- KERNEL=$(cat /proc/version)
- KERNEL=${KERNEL#*version }
- KERNEL=${KERNEL% (*) (*}
-fi
-
# load network adaptor modules
for mod in ${NWMODULES}; do
modprobe ${MODPRV} $mod || echo "module $mod did not load for some reason"
@@ -105,8 +86,9 @@ for opts in ${KCMDLINE} ; do
esac
done
-# start a watchdog 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)
+# start a watchdog to ensure an automated reboot or halt of the machine if the
+# preboot init does not succeed (e.g. missing kernel module/firmware for the
+# network adaptor)
if [ "${DEBUGLEVEL}" -gt 0 ] ; then
cat<<EOF > /bin/watchdog
#!/bin/ash
@@ -146,15 +128,11 @@ ip route add default via $router
# at this point a little selection script could be downloaded, which lets the
# user choose what kind of SLX client he wants to get
-
-# get kernel and initramfs, if something fails start debug shell
-echo "Fetching selected kernel and initial ramfs from the net ..."
-( wget -q -c -O /tmp/kernel \
- ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/kernel 2>/dev/null && \
-wget -q -c -O /tmp/initramfs \
- ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/$file 2>/dev/null ) || \
- /bin/ash
-
+echo "Fetching preboot interactive part and configuration from the net ..."
+wget -q -c -O /tmp/preboot.env \
+ ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/${prebootid}.env
+mkdir /preboot
+tar -xzf /tmp/${prebootid}.env -C /preboot
# start a debug shell if needed, else set quiet kernel parameter
if [ "${DEBUGLEVEL}" -gt 0 ] ; then
/bin/ash
@@ -162,10 +140,8 @@ else
quiet=quiet
echo -e "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
fi
+# run the preboot interactive part which finally will execute kexec
+exec /preboot/preboot.sh
+# we will never return from that one ...
+
-# start the new kernel with initialramfs and cmdline
-echo "Booting OpenSLX client ..."
-kexec -l /tmp/kernel --initrd=/tmp/initramfs \
- --append="ip=$ip:$siaddr:$router:$subnet \
- file=ftp://132.230.4.4/default.tgz debug=${DEBUGLEVEL} $quiet"
-kexec -e
diff --git a/boot-env/preboot-cd/preboot.sh b/boot-env/preboot-cd/preboot.sh
new file mode 100644
index 00000000..98a2c61e
--- /dev/null
+++ b/boot-env/preboot-cd/preboot.sh
@@ -0,0 +1,35 @@
+#!/bin/ash
+# Copyright (c) 2009 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# preboot script for user interaction with OpenSLX preloading environment for
+# Linux stateless clients
+
+# we expect to have a system selection dialog file in /preboot/syssel.dialog
+dialog --file syssel.dialog 2>result
+# source the system to boot configuration ($kernel, $initramfs, $append,
+# $label)
+. $(cat result)
+
+echo $kernel
+
+wget ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/$kernel \
+ -o /tmp/kernel
+wget ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/$initramfs \
+ -o initramfs
+
+# read primary IP configuration to pass it on
+. /tmp/ipstuff
+
+# start the new kernel with initialramfs and cmdline
+echo "Booting OpenSLX client $label ..."
+kexec -l /tmp/kernel --initrd=/tmp/initramfs \
+ --append="ip=$ip:$siaddr:$router:$subnet $append $quiet"
+kexec -e
diff --git a/initramfs/preboot/boot.mconf b/initramfs/preboot/boot.mconf
deleted file mode 100644
index 0f0acc17..00000000
--- a/initramfs/preboot/boot.mconf
+++ /dev/null
@@ -1,19 +0,0 @@
-mainmenu "OpenSLX Selection of Bootable Systems"
-choice
- prompt "Bootable Systems"
-
-config system1
- bool "scilin-4.7-default nfs"
-
-config system2
- bool "suse-10.2-main nfs"
-
-config system3
- bool "suse-11.0-vmtest nfs"
-
-config system4
- bool "ubuntu-8.04-default nfs"
-
-config system5
- bool "ubuntu-8.04-vmtest nfs"
-endchoice
diff --git a/initramfs/preboot/mconf_examples b/initramfs/preboot/mconf_examples
deleted file mode 100644
index 2a391b49..00000000
--- a/initramfs/preboot/mconf_examples
+++ /dev/null
@@ -1,144 +0,0 @@
-
-# drivers/Kconfig
-#
-
-mainmenu "OpenSLX Client Configuration"
-
-# keine Ahnung was das kann
-#config DEFCONFIG_LIST
-# string
-# depends on !UML
-# option defconfig_list
-# default "/lib/modules/$UNAME_RELEASE/.config"
-# default "/etc/kernel-config"
-# default "/boot/config-$UNAME_RELEASE"
-# default "arch/$ARCH/defconfig"
-
-menu "User Configuration"
-
-config ucfg_root_enabled
- bool "Enable administrator account (root) for login."
- default y
- help
- Allow to login as system administrator to your OpenSLX client. You should
- set a password then.
-
- If unsure, say N.
-
-config ucfg_root_password
- string "root password"
- depends on ucfg_root_enabled
- default "OpEnSlX"
- help
- Define a password for the system administrator (root) of your OpenSLX
- client.
-
-comment "First Standard User"
-
-config ucfg_standard_user
- default y
- bool "Define a standard user with normal priviledges."
- help
- This allows you to define a normal user to be configured on your OpenSLX
- client. Logging on using this user gives you standard experience with in
- the several environments.
-
- If you are unsure about this, Say Y here.
-
-config ucfg_stduser_name
- string "name of standard user"
- depends on ucfg_standard_user
- default "openslx"
- help
- Define an account name for the first standard user of your system.
-
-config ucfg_stduser_password
- string "password of standard user"
- depends on ucfg_standard_user
- default "change_it"
- help
- Please change the predefined password!
-
-comment "Further Standard Users"
-
-config ucfg_second_user
- default n
- bool "Define a second user with normal priviledges if you like."
- help
- This allows you to define an additional user to be configured on your
- OpenSLX client. Same priviledges like the standard user.
-
- If you are unsure about this, Say N here.
-
-config ucfg_secuser_name
- string "name of standard user"
- depends on ucfg_second_user
- default "second"
- help
- Define an account name for the second standard user of your system.
-
-config ucfg_secuser_password
- string "password of second user"
- depends on ucfg_second_user
- default "change_it_too"
- help
- Please change the predefined password!
-
-config ucfg_third_user
- default n
- bool "Define a third user with normal priviledges if you like."
- help
- This allows you to define an additional user to be configured on your
- OpenSLX client. Same priviledges like the standard user.
-
- If you are unsure about this, Say N here.
-
-config ucfg_thduser_name
- string "name of standard user"
- depends on ucfg_third_user
- default "third"
- help
- Define an account name for the second standard user of your system.
-
-config ucfg_thduser_password
- string "password of second user"
- depends on ucfg_third_user
- default "change_it_too"
- help
- Please change the predefined password!
-
-config RT_MUTEXES
- boolean
- select PLIST
-
-endmenu
-
-choice
- prompt "Subarchitecture Type"
- default X86_PC
-
-config X86_PC
- bool "PC-compatible"
- help
- Choose this option if your computer is a standard PC or compatible.
-
-config X86_XEN
- bool "Xen-compatible"
- depends on X86_32
- select SYS_HYPERVISOR
- help
- Choose this option if you plan to run this kernel on top of the
- Xen Hypervisor.
-
-config X86_ELAN
- bool "AMD Elan"
- depends on X86_32
- help
- Select this for an AMD Elan processor.
-
- Do not use this option for K6/Athlon/Opteron processors!
-
- If unsure, choose "PC-compatible" instead.
-
-endchoice
-
diff --git a/initramfs/preboot/preboot.sh b/initramfs/preboot/preboot.sh
deleted file mode 100644
index d7a12113..00000000
--- a/initramfs/preboot/preboot.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-
-echo "Fetching pxeboot for menu"
-#rm pxeboot
-#wget ftp://planets:pp2006-10@archive.ruf.uni-freiburg.de/internal/pxeboot
-
-
-# create the mconf configuration for the system to boot selection
-echo -e 'mainmenu "OpenSLX Selection of Bootable Systems\nchoice\n\
- prompt "Bootable Systems"\n' > boot.mconf
-
-count=0
-while read line; do
- #echo $line
- case "$line" in
- LABEL\ *)
- count=$(expr 1 + $count)
- file=${line#LABEL }
- echo "label=$file" > ${count}${file}.system
- echo -e "config boot_system${count}\n" >> boot.mconf
- ;;
- *MENU\ LABEL*)
- echo "menuentry=\"${line#* ^}\"" >> ${count}${file}.system
- echo " bool \"${line#* ^}\"" >> boot.mconf
- ;;
- *KERNEL\ *)
- echo "kernel=${line#*::}" >> ${count}${file}.system
- ;;
- *IPAPPEND*)
- :
- ;;
- *APPEND\ *)
- echo $line|sed "s/.*APPEND /append=\"/;s,initrd=.*/init,initrd=init,;s/$/\"/" >> ${coun
-t}${file}.system
- echo $line|sed "s,.*APPEND.*initrd=.*/init,initramfs=init,;s, .*,,;" >> ${count}${file}
-.system
- ;;
- *TEXT\ HELP*)
- echo " help\n Help text here ..." >> boot.mconf
- ;;
- esac
-done < pxeboot
-
-#while test -e ${i}*.system && . ${i}*.system 2>/dev/null ; do
-# dialogstring="$dialogstring \"$menuentry\" \"\" 1"
-# i=$(expr 1 + $i)
-#done
-
-
-
-wget ftp://planets:pp2006-10@archive.ruf.uni-freiburg.de/internal/$kernel -o kernel
-wget ftp://planets:pp2006-10@archive.ruf.uni-freiburg.de/internal/$initramfs -o initramfs
-