summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-12-16 01:13:02 +0100
committerDirk von Suchodoletz2006-12-16 01:13:02 +0100
commit0e41494e29e20161d0e7846b79d16324b99b323f (patch)
tree93a052fac7dd27114146d07130908fd0901a444a /initramfs
parentUse a temp dir to download the prerequired packages. If we can't create (diff)
downloadcore-0e41494e29e20161d0e7846b79d16324b99b323f.tar.gz
core-0e41494e29e20161d0e7846b79d16324b99b323f.tar.xz
core-0e41494e29e20161d0e7846b79d16324b99b323f.zip
Enabled busybox udev service (see #99 too). Integrated for genereal use
if present in InitRamFS... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@551 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rw-r--r--initramfs/distro-specs/gentoo/functions-default13
-rw-r--r--initramfs/distro-specs/suse/functions-10.014
-rw-r--r--initramfs/distro-specs/suse/functions-10.15
-rw-r--r--initramfs/distro-specs/suse/functions-9.317
-rw-r--r--initramfs/distro-specs/ubuntu/functions-default1
-rwxr-xr-xinitramfs/initrd-stuff/bin/hwautocfg16
-rw-r--r--initramfs/initrd-stuff/etc/functions24
-rwxr-xr-xinitramfs/initrd-stuff/init8
-rwxr-xr-xinitramfs/mkdxsinitrd19
9 files changed, 70 insertions, 47 deletions
diff --git a/initramfs/distro-specs/gentoo/functions-default b/initramfs/distro-specs/gentoo/functions-default
index f3b3d633..3cbe284a 100644
--- a/initramfs/distro-specs/gentoo/functions-default
+++ b/initramfs/distro-specs/gentoo/functions-default
@@ -1,12 +1,10 @@
-# Description: configuration script for Gentoo V2005.1 to configure
-# linux diskless clients (executed within initial ramdisk
-# after genconfig)
+# configuration script for Gentoo linux distribution to configure OpenSLX
+# linux diskless clients (executed within initialramfs after genconfig)
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 08-07-2006
+# Dirk von Suchodoletz <dirk@goe.net>, 08-07-2006
#
-# Copyright: (c) 2006 - RZ Universitaet Freiburg
-#
-# Version: 0.0.2c
+# (c) 2006 - RZ Universitaet Freiburg
+# (c) 2006 - OpenSLX.ORG Project
# empty functions are defined at the beginning of /etc/functions
@@ -22,7 +20,6 @@ config_rc_entry "KEYMAP" "${KEYTABLE}"
# udev service - not verified!
udev_hotplug () {
-echo "Starting udev"
ln -s /bin/udevd /bin/udevstart && udevstart &
if [ -x /bin/udevd ] ; then
export UDEVD_EXPECTED_SEQNUM=$(cat /sys/kernel/hotplug_seqnum)
diff --git a/initramfs/distro-specs/suse/functions-10.0 b/initramfs/distro-specs/suse/functions-10.0
index c0a31781..e35bad5e 100644
--- a/initramfs/distro-specs/suse/functions-10.0
+++ b/initramfs/distro-specs/suse/functions-10.0
@@ -1,13 +1,11 @@
-# Description: configuration functions for SuSE 10.0 which differ from
-# functions defined in general SuSE base settings ... General
-# changes should be done there, version specific changes for
-# the 10.0 here.
+# OpenSLX configuration functions for SuSE 10.0 which differ from functions
+# defined in general SuSE base settings ... General changes should be done
+# there, version specific changes for the 10.0 here.
#
-# Author(s): Dirk von Suchodoletz <dvs@openslx.com>, 28-10-2006
+# Dirk von Suchodoletz <dvs@openslx.com>, 28-10-2006
#
-# Copyright: (c) 2006 - RZ Universitaet Freiburg
-#
-# Version: 0.3.0a
+# (c) 2006 - RZ Universitaet Freiburg
+# (c) 2006 - OpenSLX.ORG Project
# udev service
udev_hotplug () {
diff --git a/initramfs/distro-specs/suse/functions-10.1 b/initramfs/distro-specs/suse/functions-10.1
index 14169bcf..f1a76ed3 100644
--- a/initramfs/distro-specs/suse/functions-10.1
+++ b/initramfs/distro-specs/suse/functions-10.1
@@ -29,11 +29,6 @@ chmod u+x /sbin/* /lib/udev/* /usr/sbin/*
# udev service
udev_hotplug () {
local result=0
-echo "Starting udev"
-# might be used if busybox is available
-#mknod /dev/console c 5 1
-#mknod /dev/null c 1 3
-#mknod /dev/kmsg c 1 11
if [ -x /bin/udevd ] ; then
echo "" > /proc/sys/kernel/hotplug
udevd --daemon || result=1
diff --git a/initramfs/distro-specs/suse/functions-9.3 b/initramfs/distro-specs/suse/functions-9.3
index 44c4e672..dcc92bab 100644
--- a/initramfs/distro-specs/suse/functions-9.3
+++ b/initramfs/distro-specs/suse/functions-9.3
@@ -1,14 +1,12 @@
-# Description: configuration script for SuSE 9.3 to configure linux
-# diskless clients (included by init, hwautocfg, servconfig
-# within initial ramdisk after inclusion of the main
-# functions file). This file might overwrite settings from
-# the main base for the several SuSE distro versions
+# configuration script for SuSE 9.3 to configure OpenSLX linux diskless
+# clients (included by init, hwautocfg, servconfig within initialramdfs after
+# inclusion of the main functions file). This file might overwrite settings
+# from the main base for the several SuSE distro versions
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-06-2006
+# Dirk von Suchodoletz <dvs@OpenSLX.com>, 16-12-2006
#
-# Copyright: (c) 2006 - RZ Universitaet Freiburg
-#
-# Version: 0.3.0a
+# (c) 2006 - RZ Universitaet Freiburg
+# (c) 2006 - OpenSLX.ORG Project
# distro specific stuff to initialize
postinit () {
@@ -20,7 +18,6 @@ postinit () {
udev_hotplug () {
local result=0
[ -d /etc/hotplug -a -d /etc/hotplug.d ] || error "$df_errhotpl" nonfatal
-echo "Enabling hotplug/udev"
udevstart || result=1
udevd -d || result=1
return $result
diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default
index 21d8c2e3..03652d68 100644
--- a/initramfs/distro-specs/ubuntu/functions-default
+++ b/initramfs/distro-specs/ubuntu/functions-default
@@ -64,7 +64,6 @@ config_distro () {
udev_hotplug () {
local result=0
[ -d /etc/hotplug -a -d /etc/hotplug.d ] || error "$df_errhotpl" nonfatal
- echo "Enabling hotplug/udev"
udevstart || result=1
udevd -d || result=1
return $result
diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg
index 9bdb4bc6..de275307 100755
--- a/initramfs/initrd-stuff/bin/hwautocfg
+++ b/initramfs/initrd-stuff/bin/hwautocfg
@@ -3,7 +3,7 @@
# universal (distro independent) hardware autoconfiguration script for
# OpenSLX linux diskless clients, using hwconfig from knoppix as base tool
#
-# Dirk von Suchodoletz <dvs@OpenSLX.com>, 14-12-2006
+# Dirk von Suchodoletz <dvs@OpenSLX.com>, 16-12-2006
#
# (c) 2003 - 2006 - RZ Universitaet Freiburg
# (c) 2006 - OpenSLX.org Project
@@ -301,6 +301,7 @@ for DRIVER in ohci-hcd uhci-hcd ehci-hcd ohci1394; do
modprobe ${MODPRV} ${DRIVER}
DRIVERLIST="${DRIVERLIST} ${DRIVER}"; }
done
+[ -x /bin/mdev ] && mdev -s &
# load usbhid (for USB keyboard/mouse) or remove usbcore module if USB
# is not present
if [ -n "$USB" ] ; then
@@ -343,7 +344,9 @@ 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
-test -f /proc/bus/usb/devices || mount -n -t usbfs usbfs /proc/bus/usb
+[ -x /bin/mdev ] && mdev -s &
+test -f /proc/bus/usb/devices || \
+ mount -n -t usbfs usbfs /proc/bus/usb 2>/dev/null
[ -n "$IDE" ] && modprobe -q ide_generic 2>/dev/null
usleep 10 && hwsetup -v > /tmp/hwsetup.info
# remaining drivers listed in /tmp/hwsetup.info
@@ -385,6 +388,7 @@ if strinfile "SCSI" /tmp/hwsetup.info ; then
echo -e 'KERNEL=="sg*",\t\tNAME="%k", GROUP="disk", MODE="666"' \
>> /tmp/scanner-udev
fi
+[ -x /bin/mdev ] && mdev -s &
# fixme - psmouse entladen, falls nicht vorhanden
# configure some variables from configuration file - wait for dhcp or ldap
@@ -467,6 +471,13 @@ if strinstr "/var/X11R6" "$link" ; then
[ -e "/mnt/$i" ] && { ln -sf $i /mnt/var/X11R6/bin/X; break; }
done
fi
+# if any new device appeared up to now
+if [ -x /bin/mdev ] ; then
+ mdev -s &
+ testmkd /dev/input
+ mknod /dev/input/mice c 13 63 2>/dev/null
+fi
+
# wait for completion of Xorg configuration
waitfor /tmp/xready 20000
cp /etc/xorg.conf ${D_XF86CONFFILE}
@@ -474,6 +485,7 @@ cp /etc/xorg.conf ${D_XF86CONFFILE}
# do not finish until tmp is setup properly
[ -n "$part44" ] && waitfor /tmp/tmpready 20000
+
# script run timer
[ $DEBUGLEVEL -eq 8 ] && echo "** HW setup finished at $(sysup)"
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index b27dfc66..aa0a8225 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -32,6 +32,7 @@ udev_hotplug () {
:
}
+
#############################################################################
# generate events with the sysfs trigger
trigger_device_events () {
@@ -61,6 +62,29 @@ trigger_device_events () {
}
#############################################################################
+# mini udev of busybox or distro specific udev_hotplug
+runudev () {
+if [ -x /bin/mdev ] ; then
+ # simple shell daemon which runs for 100 seconds and stops if hwautocfg is
+ # completed
+ #miniudev () {
+ # local maxwait=100
+ # local count=0
+ # while [ ! -e /tmp/hwcfg ] ; do
+ mdev -s
+ # sleep 1
+ # count=`expr $count + 1`
+ # [ $count -gt $maxwait ] && return 0
+ # done
+ #}
+ #miniudev &
+else
+ udev_hotplug
+fi
+echo "Started udev"
+}
+
+#############################################################################
# produce error message and if $2 is empty run (debug) shell
error () {
local e_msg="$1"
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init
index fec140c7..f29f10ba 100755
--- a/initramfs/initrd-stuff/init
+++ b/initramfs/initrd-stuff/init
@@ -65,8 +65,8 @@ NFSRO="nfs"
preinit
[ -x /bin/preinit.local ] && /bin/preinit.local
-# start device auto discovery service - distro specific function
-udev_hotplug
+# start device auto discovery service - busybox or distro specific function
+runudev
# switch off the several configuration methods, will be switched on
# according to kernel commandline settings
@@ -301,6 +301,7 @@ fi
if [ -n "${nbdmod}" ] ; then
# load block device driver if needed
modprobe ${MODPRV} ${nbdmod} || error "$init_errnbd"
+ [ -x /bin/mdev ] && mdev -s
[ -z "$nbdrfst" ] && nbdrfst=ext2
nbdhost=$(checkip $nbdhost)
echo "Diskless client using ${nbdmod} on $nbdhost:$nbdport with $nbdrfst"
@@ -311,7 +312,7 @@ if [ -n "${nbdmod}" ] ; then
# network block device present in standard kernel
nbd)
RDEV=/dev/nbd0
- waitfor "${RDEV}" 30000 || error "$init_nbddev"
+ waitfor "${RDEV}" 20000 || error "$init_nbddev"
while ! nbd-client $nbdhost $nbdport ${RDEV} ; do
usleep 10
done
@@ -342,6 +343,7 @@ if [ -n "${nbdmod}" ] ; then
modprobe ${MODPRV} cowloop || {
error "$init_loadcow" nonfatal
COWLOOP=""; }
+ [ -x /bin/mdev ] && mdev -s
fi
if [ -n "${COWLOOP}" ] ; then
if [ -n "${UNIONFS}" ] ; then
diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd
index df3a5eec..8aca056b 100755
--- a/initramfs/mkdxsinitrd
+++ b/initramfs/mkdxsinitrd
@@ -569,19 +569,18 @@ else
binfinder $dhcp && break;
done
cobi $dhcp bin
-fi
-mkdir -p ${INSTDIR}/var/{lib,run}
+ # hotplug/udev type and related stuff
+ cp -a ${ROOTDIR}/etc/udev ${INSTDIR}/etc
-# hotplug/udev type and related stuff
-cp -a ${ROOTDIR}/etc/udev ${INSTDIR}/etc
+ # type of hotplug/udev/dev (for etc directories see above!!)
+ for bbins in udev udevd udevstart udevtrigger udevsend ; do
+ cobi ${bbins} bin &>/dev/null || \
+ echo "Program ${bbins} not found; could be most probably ignored"
+ done
+fi
-# type of hotplug/udev/dev (for etc directories see above!!)
-for bbins in udev udevd udevstart udevtrigger udevsend
- do
- cobi ${bbins} bin &>/dev/null || \
- echo "Program ${bbins} not found; could be most probably ignored"
-done
+mkdir -p ${INSTDIR}/var/{lib,run}
# if nfs is used as clients root filesystem
cobi portmap bin