summaryrefslogtreecommitdiffstats
path: root/initrd
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-07-03 22:27:23 +0200
committerDirk von Suchodoletz2006-07-03 22:27:23 +0200
commit343d0f3d0efaf486ddc676130786d95fc06f682c (patch)
tree4f036b493d07325cdfa748fa558916311438ca5c /initrd
parentJust check in - do not use this version. (diff)
downloadcore-343d0f3d0efaf486ddc676130786d95fc06f682c.tar.gz
core-343d0f3d0efaf486ddc676130786d95fc06f682c.tar.xz
core-343d0f3d0efaf486ddc676130786d95fc06f682c.zip
Enhanced debugging settings (see DebugLevel), some fixes for the use
with busybox, ... git-svn-id: http://svn.openslx.org/svn/openslx/ld4@267 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd')
-rw-r--r--initrd/distro-specs/suse/functions-10.16
-rwxr-xr-xinitrd/initrd-stuff/bin/dhcpmkconfig5
-rwxr-xr-xinitrd/initrd-stuff/bin/hwautocfg77
-rwxr-xr-xinitrd/initrd-stuff/bin/screenres5
-rwxr-xr-xinitrd/initrd-stuff/bin/servconfig7
-rw-r--r--initrd/initrd-stuff/etc/functions12
-rwxr-xr-xinitrd/initrd-stuff/init9
-rwxr-xr-xinitrd/mkdxsinitrd14
8 files changed, 74 insertions, 61 deletions
diff --git a/initrd/distro-specs/suse/functions-10.1 b/initrd/distro-specs/suse/functions-10.1
index e366ae25..8e085348 100644
--- a/initrd/distro-specs/suse/functions-10.1
+++ b/initrd/distro-specs/suse/functions-10.1
@@ -14,13 +14,13 @@ preinit () {
# fake the existence of some helper binaries (which are not of any use
# within initialramfs)
for i in usb_id scsi_id vol_id edd_id ata_id path_id hwup ifup ; do
- echo -e "#!/bin/ash\n:" >/sbin/$i
+ echo -e "#!/bin/sh\n:" >/sbin/$i
done
mkdir /lib/udev /usr/sbin
for i in idedma.sh mount.sh rename_netiface create_floppy_devices ; do
- echo -e "#!/bin/ash\n:" >/lib/udev/$i
+ echo -e "#!/bin/sh\n:" >/lib/udev/$i
done
-echo -e "#!/bin/ash\n:" >/usr/sbin/alsactl
+echo -e "#!/bin/sh\n:" >/usr/sbin/alsactl
chmod u+x /sbin/* /lib/udev/* /usr/sbin/*
}
diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig
index ca9a6412..8f25f538 100755
--- a/initrd/initrd-stuff/bin/dhcpmkconfig
+++ b/initrd/initrd-stuff/bin/dhcpmkconfig
@@ -4,7 +4,7 @@
# several dhcp clients. The result is written in unified form
# to the /etc/machine-setup file
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 29-06-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 03-07-2006
# Lars Mueller, 23-06-2006
# Oliver Tappe, 23-06-2006
#
@@ -17,6 +17,9 @@ infomsg="# --> You are using $dhcl. With this client you are not \
able to\n# transfer any vendor specific, self defined dhcp options. If \
this is\n# intended, use dhclient instead or get them via tftp (to be \
enabled\n# via kernel command line)."
+# heavy debugging output in level 3 and above ... and on 13
+[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 13 ] && \
+ set -x
case $0 in
*dhcpcd*)
dhcl="dhcpcd"; echo -e "$infomsg" >>/tmp/confviadhcp
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg
index bc087964..ecc48b1a 100755
--- a/initrd/initrd-stuff/bin/hwautocfg
+++ b/initrd/initrd-stuff/bin/hwautocfg
@@ -4,7 +4,7 @@
# script for linux diskless clients, using hwconfig from
# knoppix as base tool
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 29-06-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 03-07-2006
# Felix Endres
#
# Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg
@@ -117,7 +117,7 @@ if [ -n "$hw_monitor" ] ; then
VS=${VS##* }
SCR_MODES="\"${hw_monitor##* }\""
else
- # Gather information about the Monitor capabilities
+ # gather information about the monitor capabilities
screenres > /tmp/screenres
VERTSR=`cat /tmp/screenres | sed -n '/Vertical Frequency Range/s/[^0-9]* \([0-9-]*\)/\1/p'`
HORISR=`cat /tmp/screenres | sed -n '/Horizontal Frequency Range/s/[^0-9]* \([0-9-]*\)/\1/p'`
@@ -125,27 +125,22 @@ else
VS=$VERTSR
# compute max resolution
SCR_MODES=`cat /tmp/screenres | sed -n '/Recommended Screen Modes:/s/[^"]*\(.*\)/\1/p'`
-# # gather monitor information automatically
-# ddcprobe > /tmp/ddcprobe
-# hwmsg="Please check the output of ddcprobe. The settings where not \
-#complete\n or non existant. The $0 script tried for a fully automatic\n\
-# configuration of display"
fi
-hwmsg="Please check your predefined monitor settings ($hw_monitor): Automatic\n\
-configuration of display"
-if [ -z "$HS" ] ; then error " $hwmsg timings was attempted, but the \
-horizontal frequency could not be detected. Using default frequency \
-range (${HSYNCRANGE})" nonfatal
+#hwmsg="Please check your predefined monitor settings ($hw_monitor): Automatic\n\
+#configuration of display"
+if [ -z "$HS" ] ; then #error " $hwmsg timings was attempted, but the \
+#horizontal frequency could not be detected. Using default frequency \
+#range (${HSYNCRANGE})" nonfatal
HS=${HSYNCRANGE}
fi
-if [ -z "$VS" ] ; then error " $hwmsg timings was attempted, but the \
-vertical frequency could not be detected. Using default frequency \
-range (${VSYNCRANGE})" nonfatal
+if [ -z "$VS" ] ; then #error " $hwmsg timings was attempted, but the \
+#vertical frequency could not be detected. Using default frequency \
+#range (${VSYNCRANGE})" nonfatal
VS=${VSYNCRANGE}
fi
-if [ -z "$SCR_MODES" ] ; then error " $hwmsg resolution was attempted but not \
-established. Using default resolutions (${DEFAULTMODES})" nonfatal
+if [ -z "$SCR_MODES" ] ; then #error " $hwmsg resolution was attempted but not \
+#established. Using default resolutions (${DEFAULTMODES})" nonfatal
SCR_MODES=${DEFAULTMODES}
fi
monmanual=yes
@@ -199,7 +194,7 @@ pci/agp bus needed for acceleration." ; }
;;
Module)
echo -e ${Module} >>$xfc
- [ x$DRM = "xyes" ] && \
+ #[ "x$DRM" = "xyes" ] && \
echo -e "\tLoad\t\t\"dri\"" >>$xfc
[ x$GLX != "xno" ] && \
echo -e "\tLoad\t\t\"glx\"" >>$xfc
@@ -225,7 +220,7 @@ pci/agp bus needed for acceleration." ; }
;;
Screen)
echo -e ${Screen} | sed -e "s,CDP,${CDP}," >>$xfc
- for BPP in 15 16 24 32
+ for BPP in 15 16 24
do echo -e '\tSubSection "Display"\n\t\tDepth\t'\
$BPP'\n\t\tModes\t'$SCR_MODES'\n\tEndSubSection' >>$xfc
[ $BPP = "$CDP" ] && break
@@ -234,6 +229,9 @@ pci/agp bus needed for acceleration." ; }
ServerLayout)
echo -e ${ServerLayout} >>$xfc
;;
+ DRI)
+ echo -e ${DRI} >>$xfc
+ ;;
esac
echo -e "EndSection\n" >>$xfc
done
@@ -252,8 +250,9 @@ done
. /etc/sysconfig/config
. /etc/distro-functions
-# heavy debugging output in level 3 and above ...
-[ $DEBUGLEVEL -gt 3 ] && set -x
+# heavy debugging output in level 3 and above and specific for 11
+[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 11 ] && \
+ set -x
# set X11 configuration file
if [ -n "${D_XF86CONFFILE}" ] ; then
@@ -339,19 +338,6 @@ for DRIVER in ${NWMODULES}; do
rmmod ${DRIVER} &
DRIVERLIST="${DRIVERLIST} ${DRIVER}"; }
done
-# sound card setup (alsa and oss compatibility drivers)
-if [ -f /etc/sysconfig/sound ] ; then
- . /etc/sysconfig/sound
-else DRIVER="snd-dummy"
-fi
-# special hack
-#if [ "${DRIVER}" = "snd-atiixp" ] ; then
-# rmmod snd_atiixp_modem snd_atiixp
-#fi
-modprobe ${MODPRV} ${DRIVER}
-
-DRIVERLIST="${DRIVERLIST} ${DRIVER} "
-modprobe -a ${MODPRV} snd_pcm_oss snd_mixer_oss
# check for PCMCIA / cardbus stuff
for DRIVER in yenta_socket i82365 pd6729 tcic; do
strinfile ${DRIVER} /tmp/hwsetup.info && {
@@ -363,6 +349,18 @@ if [ -n "${PCMCIA}" ] ; then
#echo "pcmcia=\"yes\"" > config
modprobe ${MODPRV} ds
fi
+# sound card setup (alsa and oss compatibility drivers)
+if [ -f /etc/sysconfig/sound ] ; then
+ . /etc/sysconfig/sound
+else DRIVER="snd-dummy"
+fi
+# problem with a specific module not disabled when busybox
+# rmmod snd_atiixp_modem snd_atiixp
+modprobe ${MODPRV} ${DRIVER}
+DRIVERLIST="${DRIVERLIST} ${DRIVER} "
+modprobe ${MODPRV} snd-pcm-oss
+modprobe ${MODPRV} snd-mixer-oss
+
# rerun the knoppix hardware autodetection tool for USB and ide devices
# like dvd or harddisk - wait a few seconds so hopefully the ide driver
# is initialized
@@ -370,13 +368,14 @@ test -f /proc/bus/usb/devices || mount -n -t usbfs usbfs /proc/bus/usb
[ -n "$IDE" ] && modprobe -q ide_generic 2>/dev/null
usleep 10 && hwsetup -v > /tmp/hwsetup.info
# remaining drivers listed in /tmp/hwsetup.info
+DRIVERLIST="${DRIVERLIST} ps/2 "
cat /tmp/hwsetup.info| while read LINE ; do
if strinstr "driver:" "${LINE}"; then
DRIVER=${LINE##driver: }
if ! strinstr " ${DRIVER} " "${DRIVERLIST}"; then
- strinstr "Card:" "${DRIVER}" || strinstr "ps/2" "${DRIVER}" || {
+ strinstr "Card:" "${DRIVER}" || {
modprobe ${MODPRV} ${DRIVER} &
- usleep 10; }
+ usleep 8; }
DRIVERLIST="${DRIVERLIST} ${DRIVER}"
fi
fi
@@ -389,9 +388,9 @@ strinfile "genericwheelusb" /tmp/hwsetup.info || \
# load IDE high level drivers
if [ -n "$IDE" ] ; then
# you might want to check /etc/sysconfig/floppy for more info
- strinfile "ZIP" /tmp/hwsetup.info && modprobe ${MODPRV} ide_floppy
- strinfile "CDROM" /tmp/hwsetup.info && modprobe ${MODPRV} ide_cd
- strinfile "HD" /tmp/hwsetup.info && modprobe ${MODPRV} ide_disk
+ strinfile "ZIP" /tmp/hwsetup.info && modprobe ${MODPRV} ide-floppy
+ strinfile "CDROM" /tmp/hwsetup.info && modprobe ${MODPRV} ide-cd
+ strinfile "HD" /tmp/hwsetup.info && modprobe ${MODPRV} ide-disk
fi
# not rather precise ...
diff --git a/initrd/initrd-stuff/bin/screenres b/initrd/initrd-stuff/bin/screenres
index 08f7f955..aa795174 100755
--- a/initrd/initrd-stuff/bin/screenres
+++ b/initrd/initrd-stuff/bin/screenres
@@ -26,9 +26,10 @@
# enable debugging in higher debug levels
[ -z "$DEBUGLEVEL" ] && DEBUGLEVEL=0
[ $DEBUGLEVEL -gt 1 ] && DEBUG="yes"
+# heavy debugging output in level 3 and above ...
+[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 14 ] && set -x
-
-#Define some default output values if the script fails to find better values:
+# Define some default output values if the script fails to find better values
# Empty defaults, s.t. hwautocfg defines the defaults
default_horiz_freq_range_khz="" #"31.5-63.5"
default_vert_freq_range_hz="" #"60-90"
diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig
index 92ee2cd8..44f8be90 100755
--- a/initrd/initrd-stuff/bin/servconfig
+++ b/initrd/initrd-stuff/bin/servconfig
@@ -4,7 +4,7 @@
# for linux diskless clients (executed within initial
# ramdisk)
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 27-06-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 03-07-2006
# Michael Janczyk, 31-05-2006
# Lars Mueller, 23-06-2006
# Oliver Tappe, 23-06-2006
@@ -28,7 +28,8 @@
. /mnt/etc/${D_SYSCONFDIR}/logfile
# heavy debugging output in level 3 and above ...
-[ $DEBUGLEVEL -gt 3 ] && set -x
+[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 12 ] && \
+ set -x
#######################################################################
# copy distro specific scripts, programs, libraries and configs
@@ -267,7 +268,7 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then
#fi
# generate a runlevel script
d_mkrlscript init vmware-prep "Starting preparation of vmware environment"
- sed "s,^#.*,,;/^$/d;s,^,\\t," /etc/vmware-prep >> \
+ sed "s,^#.*,,;/^$/d;s,^, ," /etc/vmware-prep >> \
/mnt/etc/${D_INITDIR}/vmware-prep
d_mkrlscript close vmware-prep ""
chmod u+x /mnt/etc/${D_INITDIR}/vmware-prep
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions
index 8565281c..e48d52bc 100644
--- a/initrd/initrd-stuff/etc/functions
+++ b/initrd/initrd-stuff/etc/functions
@@ -96,11 +96,15 @@ msg () {
echo -e "$1 info: $2"
}
#######################################################################
-# micro sleep - simply loop and delete 1 from the first argument gotten
-# until zero
+# micro sleep - either busybox command or simply loop and delete 1 from
+# the first argument gotten until zero
usleep () {
-local count=`expr $1 \* 10`
-while [ $count -gt 0 ] ; do count=`expr $count \- 1` ; done
+if [ -x /bin/usleep ]; then
+ /bin/usleep `expr $1 \* 80000`
+else
+ local count=`expr $1 \* 10`
+ while [ $count -gt 0 ] ; do count=`expr $count \- 1` ; done
+fi
return 0
}
#######################################################################
diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init
index 31e1335e..c3461a1f 100755
--- a/initrd/initrd-stuff/init
+++ b/initrd/initrd-stuff/init
@@ -2,7 +2,7 @@
# Description: main script for new type of initial ramdisk for
# linux diskless clients version 4
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 02-07-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 03-07-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
# (c) 2006 - odlx.org project
@@ -193,6 +193,7 @@ if [ "${DEBUGLEVEL}" -gt 0 ] ; then
set -x
# and the kernel too
echo "7 7 7 7" >/proc/sys/kernel/printk; }
+ [ "${DEBUGLEVEL}" -gt 10 ] && set +x
else
# switch off most of kernel debug output
echo "0 0 0 0" >/proc/sys/kernel/printk
@@ -315,9 +316,9 @@ if [ -n "${NBD}" ] ; then
NFSRO=""
fi
# finally mount the block device
- for i in 50 100 ; do
+ for i in 5 40 60 ; do
usleep $i
- mount -n -t $RFST -o $RWRO $RDEV /mnt 2>/dev/null
+ mount -n -t $RFST -o $RWRO $RDEV /mnt 2>/dev/null && break
done
fi
@@ -477,7 +478,7 @@ postinit
[ -x /bin/postinit.local ] && /bin/postinit.local
# start a debug shell in higher debug levels
-[ $DEBUGLEVEL -gt 2 ] && start_shell
+[ $DEBUGLEVEL -gt 2 ] && /bin/sh
# unmount the bind mounted modules directory
for i in 0 40 100 200 300 500 800 1000 1200; do
diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd
index 6271fa01..aed9345e 100755
--- a/initrd/mkdxsinitrd
+++ b/initrd/mkdxsinitrd
@@ -3,7 +3,7 @@
# Description: universal (distro independent) generator for initial
# ramdisks for linux diskless clients
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 01-07-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 03-07-2006
# Nico Dietrich
# Felix Endres
#
@@ -419,10 +419,12 @@ mknod ${INSTDIR}/tmp/kmsg c 1 11 &>/dev/null
mknod ${INSTDIR}/tmp/ctl b 241 255 &>/dev/null
# test for the existance of busybox
-[ -x busybox -a "$use_busybox" = 1 ] || {
- unset use_busybox
- echo "You wanted to include busybox, but did not provide it in \
-initrd/ directory."; }
+if [ "$use_busybox" = 1 ]; then
+ [ -x busybox ] || {
+ unset use_busybox
+ echo "You wanted to include busybox, but did not provide it in \
+ initrd/ directory."; }
+fi
if [ "$use_busybox" ] ; then
cp busybox ${INSTDIR}/bin
for bbins in [ arping ash cat chmod chown chroot cp date \
@@ -433,6 +435,8 @@ if [ "$use_busybox" ] ; then
umount uname usleep vconfig vi; do
ln -s /bin/busybox ${INSTDIR}/bin/$bbins
done
+ echo -e "#!/bin/ash\n/bin/ash $@" > ${INSTDIR}/bin/sh
+ chmod a+x ${INSTDIR}/bin/sh
else
# find and copy a shell to be used within initialramfs
for bbins in bash ash sh; do