summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-12-22 17:27:36 +0100
committerDirk von Suchodoletz2006-12-22 17:27:36 +0100
commit280108a7fadbe4a95e7d7c446240d8e7638d6390 (patch)
treea7fdaa354c5c20a11f9dd97f7bdf49a04650f021 /initramfs
parentFix for non-busybox watchdog (or should we add (u)sleep to the initramfs (diff)
downloadcore-280108a7fadbe4a95e7d7c446240d8e7638d6390.tar.gz
core-280108a7fadbe4a95e7d7c446240d8e7638d6390.tar.xz
core-280108a7fadbe4a95e7d7c446240d8e7638d6390.zip
Small cleanups ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@581 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rw-r--r--initramfs/distro-specs/debian/functions-default29
-rw-r--r--initramfs/distro-specs/suse/functions-10.114
-rw-r--r--initramfs/distro-specs/suse/functions-default6
-rw-r--r--initramfs/distro-specs/ubuntu/functions-6.0630
-rw-r--r--initramfs/distro-specs/ubuntu/functions-default9
-rwxr-xr-xinitramfs/initrd-stuff/init23
6 files changed, 64 insertions, 47 deletions
diff --git a/initramfs/distro-specs/debian/functions-default b/initramfs/distro-specs/debian/functions-default
index 573950ae..b6d4329a 100644
--- a/initramfs/distro-specs/debian/functions-default
+++ b/initramfs/distro-specs/debian/functions-default
@@ -1,11 +1,13 @@
# configuration script for general Debian to configure linux diskless clients
# (executed within initialramfs after genconfig)
#
-# Dirk von Suchodoletz <dirk@goe.net>, 31-10-2006
+# this file is distributed under the GPLv2, see ~/openslx/COPYING
+#
+# Dirk von Suchodoletz <dvs@OpenSLX.com>, 22-12-2006
# Felix Endres, 30-04-2006
#
# (c) 2006 - RZ Universitaet Freiburg
-# (c) 2006 - OpenSLX.ORG Project
+# (c) 2006 - OpenSLX GmbH
# empty functions are defined at the beginning of /etc/functions
@@ -131,6 +133,7 @@ fi
config_syslog () {
if [ "x$start_syslog" != "xno" ] ; then
: # fixme: Evtl. Verzweigung fuer syslog/-ng Varianten, siehe Ubuntu
+ # bzw. SuSE
fi
}
@@ -157,23 +160,25 @@ if [ "x$start_snmp" = "xyes" ] ; then
# x11 stuff
descsession () {
+# variable desktop_session is most probably deprecated in near future
if [ "x$desktop_session" != "x" ] ; then
windowmanagers="$desktop_session"
- # write script for desktop-session chooser
- if [ "x$vmware" != "xno" ] ; then
- debug=""
- [ ${DEBUGLEVEL} -gt 0 ] && debug="--debug 1"
- echo -e "#!/bin/sh\n#\n# file generated by\n#\t$0:\n#\t$date\n
+else
+ windowmanagers="kde,gnome,icewm,failsafe"
+fi
+
+# write script for desktop-session chooser (see in suse/functions*)
+if [ "x$vmware" != "xno" ] ; then
+ debug=""
+ [ ${DEBUGLEVEL} -gt 0 ] && debug="--debug 1"
+ echo -e "#!/bin/sh\n#\n# file generated by\n#\t$0:\n#\t$date\n
OSTYPE=\`echo \$0 | sed -e \"s,-, ,\" -e \"s,.*/,,\" | awk '{print \$1}'\`
SPECTYPE=\`echo \$0 | sed -e \"s,-, ,\" -e \"s,.*/,,\" | awk '{print \$2}'\`\n
OPTS=\"-o \$OSTYPE \${SPECTYPE:+\"-s \$SPECTYPE\"}\"\n
xterm -bg black -fg white -geometry 170x30+0-0 +sb \
-e \"runvmware \$OPTS $debug\"\n" > /mnt/var/X11R6/bin/desktop-session
- chmod a+x /mnt/var/X11R6/bin/desktop-session
- addpath="true";
- fi
-else
- windowmanagers="kde,gnome,icewm,failsafe"
+ chmod a+x /mnt/var/X11R6/bin/desktop-session
+ addpath="true";
fi
# check if /usr/X11R6/bin is writeable, else use /var/X11R6/bin
if [ -w /mnt/usr/X11R6/bin/WM-Session ] ; then
diff --git a/initramfs/distro-specs/suse/functions-10.1 b/initramfs/distro-specs/suse/functions-10.1
index f1a76ed3..ceb29061 100644
--- a/initramfs/distro-specs/suse/functions-10.1
+++ b/initramfs/distro-specs/suse/functions-10.1
@@ -1,11 +1,13 @@
# configuration functions for SuSE 10.1 which differ from functions defined
# in general SuSE base definitions ... General changes should be done there,
-# version specific changes for the 10.1 go here.
+# version specific changes for the 10.1 go here
#
-# Dirk von Suchodoletz <dvs@OpenSLX.com>, 14-12-2006
+# this file is distributed under the GPLv2, see ~/openslx/COPYING
+#
+# Dirk von Suchodoletz <dvs@OpenSLX.com>, 22-12-2006
#
# (c) 2006 - RZ Universitaet Freiburg
-# (c) 2006 - OpenSLX.ORG Project
+# (c) 2006 - OpenSLX GmbH
# some specific stuff to initialize
preinit () {
@@ -122,6 +124,8 @@ case "${XMODULE}" in
radeon)
# check ${XDESC}/ hwsetup.info device string in Cards file and then
# for needed components
+ # not all radeon cards are properly supported by fglrx, so the decision on
+ # module might be done via hwsetup!?
test -e /mnt/lib/modules/${KERNEL}/kernel/drivers/char/drm/fglrx.ko \
&& test -e /mnt/usr/X11R6/lib/modules/drivers/fglrx_drv.* && {
XMODULE=fglrx
@@ -129,7 +133,7 @@ case "${XMODULE}" in
ln -sf /usr/X11R6/lib/libGL.so.1.2 \
/mnt/usr/X11R6/lib/libGL.so.1 2>/dev/null
}
- # check whether to enable tvout
+ # check whether to enable tvout. option could be set in machine-setup
if [ -n "$tvout" ] && [ "$tvout" != "no" -a "$tvout" != "NO" ] ; then
[ "$tvout" = "yes" ] && tvout="PAL-B"
TVOUT='\tOption\t\t"TVFormat" "'$tvout
@@ -137,7 +141,7 @@ case "${XMODULE}" in
fi
;;
nv)
- # check for needed components
+ # check for needed components (kernel and libraries)
test -e /mnt/lib/modules/${KERNEL}/kernel/drivers/char/drm/nvidia.ko \
&& test -e /mnt/usr/X11R6/lib/modules/drivers/nvidia_drv.* && {
gllib=$(ls /mnt/usr/X11R6/lib/libGL.so.1.0.* 2>/dev/null|sed -n "1p")
diff --git a/initramfs/distro-specs/suse/functions-default b/initramfs/distro-specs/suse/functions-default
index c7014adf..4b281f42 100644
--- a/initramfs/distro-specs/suse/functions-default
+++ b/initramfs/distro-specs/suse/functions-default
@@ -3,11 +3,13 @@
# inclusion of the main functions file). This file is the main base for the
# several SuSE distro versions
#
-# Dirk von Suchodoletz <dvs@OpenSLX.com>, 14-12-2006
+# this file is distributed under the GPLv2, see ~/openslx/COPYING
+#
+# Dirk von Suchodoletz <dvs@OpenSLX.com>, 22-12-2006
# mj0 09-11-2006
#
# (c) 2006 - RZ Universitaet Freiburg
-# (c) 2006 OpenSLX.ORG Project
+# (c) 2006 OpenSLX GmbH
# empty functions are defined at the beginning of /etc/functions
diff --git a/initramfs/distro-specs/ubuntu/functions-6.06 b/initramfs/distro-specs/ubuntu/functions-6.06
index e439df4f..a2f54be5 100644
--- a/initramfs/distro-specs/ubuntu/functions-6.06
+++ b/initramfs/distro-specs/ubuntu/functions-6.06
@@ -3,12 +3,14 @@
# initial ramfs - stage3) It may overwrite settings from the default config
# file (/etc/functions)
#
-# Dirk von Suchodoletz <dirk@goe.net>, 31-08-2006
+# this file is distributed under the GPLv2, see ~/openslx/COPYING
+#
+# Dirk von Suchodoletz <dirk@goe.net>, 22-12-2006
# Nico Dietrich
# Felix Endres, 29-08-2006
#
# (c) 2006 - RZ Universitaet Freiburg
-# (c) 2006 - OpenSLX.ORG Project
+# (c) 2006 - OpenSLX GmbH
# distro specific stuff to initialize
preinit () {
@@ -41,28 +43,26 @@ udev_hotplug () {
}
-
-
-
# x11 stuff
descsession () {
+# variable desktop_session is most probably deprecated
if [ "x$desktop_session" != "x" ] ; then
windowmanagers="$desktop_session"
- # write script for desktop-session chooser
- if [ "x$vmware" != "xno" ] ; then
- debug=""
- [ ${DEBUGLEVEL} -gt 0 ] && debug="--debug 1"
- echo -e "#!/bin/sh\n#\n# file generated by\n#\t$0:\n#\t$date\n
+else
+ windowmanagers="kde,gnome,icewm,failsafe"
+fi
+# write script for desktop-session chooser
+if [ "x$vmware" != "xno" ] ; then
+ debug=""
+ [ ${DEBUGLEVEL} -gt 0 ] && debug="--debug 1"
+ echo -e "#!/bin/sh\n#\n# file generated by\n#\t$0:\n#\t$date\n
OSTYPE=\`echo \$0 | sed -e \"s,-, ,\" -e \"s,.*/,,\" | awk '{print \$1}'\`
SPECTYPE=\`echo \$0 | sed -e \"s,-, ,\" -e \"s,.*/,,\" | awk '{print \$2}'\`\n
OPTS=\"-o \$OSTYPE \${SPECTYPE:+\"-s \$SPECTYPE\"}\"\n
xterm -bg black -fg white -geometry 170x30+0-0 +sb \
-e \"runvmware \$OPTS $debug\"\n" > /mnt/var/X11R6/bin/desktop-session
- chmod a+x /mnt/var/X11R6/bin/desktop-session
- addpath="true";
- fi
-else
- windowmanagers="kde,gnome,icewm,failsafe"
+ chmod a+x /mnt/var/X11R6/bin/desktop-session
+ addpath="true";
fi
# check if /usr/X11R6/bin is writeable, else use /var/X11R6/bin
if [ -w /mnt/usr/X11R6/bin/WM-Session ] ; then
diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default
index 03652d68..b245f8fb 100644
--- a/initramfs/distro-specs/ubuntu/functions-default
+++ b/initramfs/distro-specs/ubuntu/functions-default
@@ -1,13 +1,15 @@
# configuration script for general Ubuntu to configure OpenSLX linux
# diskless clients (executed within initial ramdisk after genconfig)
#
-# Dirk von Suchodoletz <dirk@goe.net>, 23-06-2006
+# this file is distributed under the GPLv2, see ~/openslx/COPYING
+#
+# Dirk von Suchodoletz <dirk@goe.net>, 22-12-2006
# Nico Dietrich
# Felix Endres
# mj0, 12-12-2006
#
# (c) 2006 - RZ Universitaet Freiburg
-# (c) 2006 - OpenSLX.ORG project
+# (c) 2006 - OpenSLX GmbH
# empty functions are defined at the beginning of /etc/functions
@@ -23,7 +25,8 @@ preinit () {
}
-#overwrite settings set by hwautocfg
+# overwrite settings set by hwautocfg, pathes will change for newer
+# Xorg version 7.X
displayvars (){
Files=' \t FontPath\t\t "/usr/share/X11/fonts/misc"\n
\t FontPath\t\t "/usr/share/X11/fonts/100dpi/:unscaled"\n
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index 02e2ecad..1e6dddd3 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -2,11 +2,13 @@
# main script for new type of initial ramdisk for OpenSLX linux diskless
# clients version 4
#
-# Dirk von Suchodoletz <dirk@goe.net>, 17-12-2006
+# this file is distributed under the GPLv2, see ~/openslx/COPYING
+#
+# Dirk von Suchodoletz <dirk@goe.net>, 22-12-2006
# <mj0@uni-freiburg.de> (xenbr), 27-09-2006
#
# (c) 2006 - RZ Universitaet Freiburg
-# (c) 2006 - OpenSLX.ORG Project
+# (c) 2006 - OpenSLX GmbH
# functions common for all distros, messages contains all error and info
# output (for some reason the error output is not produced properly - crash)
@@ -415,7 +417,6 @@ if [ -n "${UNIONFS}" -o -n "${UNION}" ] ; then
UNIONFS=""; }
fi
-
# setup of client root filesystem dependent on the availability of UnionFS
if [ -n "${UNIONFS}" ] ; then
echo "Using UnionFS for rw access"
@@ -510,8 +511,8 @@ done
for i in /var/run/utmp /var/log/wtmp /var/log/lastlog /etc/mtab ; do
echo -n > /mnt/$i
done
-chmod a+rwxt /mnt/tmp /mnt/tmp/scratch 2>/dev/null &
-chown 65534:0 /mnt/var/lib/nobody &
+chown 65534:0 /mnt/var/lib/nobody
+# /proc/bus/usb might be deprecated in newer kernels ...
echo -e "# /etc/fstab - file generated by $0 (initramfs from $date)\n#\
\tDirk von \
Suchodoletz, dirk@goe.net\n\nrootfs\t\t/\t\trootfs\t\tro\t\t 0 0\n\
@@ -548,7 +549,8 @@ postinit
[ -s /initramfs/postinit.local ] && \
cp /initramfs/postinit.local /bin/postinit.local
[ -x /bin/postinit.local ] && {
- echo "Running postinit.local - if boot stops here, check the script!"
+ [ $DEBUGLEVEL -gt 0 ] && \
+ echo "Running postinit.local - if boot stops here, check the script!"
/bin/postinit.local; }
# start a debug shell in higher debug levels
@@ -567,13 +569,14 @@ test -f /mnt/etc/inittab || error "$init_erritab"
d_mkrlscript close boot.ld ""
# put /tmp into stage4 mtab
sed -n "s,/mnt,,;/\/tmp /p" /proc/mounts >> /mnt/etc/mtab
-# preparations to leave initrd - umounting ...
+# preparations to leave initramfs - umounting ...
umount -n /sys || error "$init_errsys" nonfatal
umount -n /proc/bus/usb >/dev/null 2>&1
mount -n --move /dev /mnt/dev
-chmod a+rwxt /mnt/dev/shm
+chmod a+rwxt /mnt/dev/shm /mnt/tmp /mnt/tmp/scratch 2>/dev/null
+
killall -9 udevd 2>/dev/null
-# kill the watchdog (errhalt)
+# kill the watchdog (autopoweroff, if stage3 init never finishes)
[ -f /tmp/watchdogpid ] && kill $(cat /tmp/watchdogpid) 2>/dev/null
# runtimer
[ $DEBUGLEVEL -eq 8 ] && echo "** SLX init ended near $(sysup)"
@@ -582,5 +585,5 @@ umount -n /proc
unset debug date initrd ip dnbdroot nbdroot nfsroot vci vga
unset BOOT_IMAGE KCMDLINE KERNEL MODPRV NWMODULES OLDPWD UDEVD_EVENT_TIMEOUT \
UDEVD_EXPECTED_SEQNUM
-# new style of pivoting (exec -c would set an empty environment in bash)
+# new style of pivoting (switch_root or run-init in klibc)
exec switch_root -c dev/console /mnt /sbin/init || error "$init_runinit"