diff options
Diffstat (limited to 'initrd')
-rw-r--r-- | initrd/distro-specs/ubuntu/functions-5.10 | 33 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 11 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 28 |
3 files changed, 49 insertions, 23 deletions
diff --git a/initrd/distro-specs/ubuntu/functions-5.10 b/initrd/distro-specs/ubuntu/functions-5.10 index e5233bb7..a82e0111 100644 --- a/initrd/distro-specs/ubuntu/functions-5.10 +++ b/initrd/distro-specs/ubuntu/functions-5.10 @@ -15,23 +15,34 @@ preinit () { echo "dhcp:x:101:">>/etc/group echo "dhcp:x:101:101::/nonexistent:/bin/false">>/etc/passwd } - -# udev service +# AUS SuSE-9.3 +# udev/hotplug - auto device discovery service udev_hotplug () { local result=0 -echo "Starting udev" +[ -d /etc/hotplug -a -d /etc/hotplug.d ] || error " Hotplug subdirectory \ +is missing! udev(d) might not work as expected." nonfatal +echo "Enabling hotplug/udev" udevstart || result=1 -if [ -x /bin/udevd ] ; then - export UDEVD_EXPECTED_SEQNUM=$(cat /sys/kernel/hotplug_seqnum) - export UDEVD_EVENT_TIMEOUT=1 - echo "" > /proc/sys/kernel/hotplug - udevd --daemon || result=1 -else error " udev daemon is not available. Some devices might not \ -apprear." nonfatal -fi +udevd -d || result=1 return $result } +## udev service +#udev_hotplug () { +#local result=0 +#echo "Starting udev" +#udevstart || result=1 +#if [ -x /bin/udevd ] ; then +# export UDEVD_EXPECTED_SEQNUM=$(cat /sys/kernel/hotplug_seqnum) +# export UDEVD_EVENT_TIMEOUT=1 +# echo "" > /proc/sys/kernel/hotplug +# udevd --daemon || result=1 +#else error " udev daemon is not available. Some devices might not \ +#apprear." nonfatal +#fi +#return $result +#} + # linking runlevel scripts rllinker () { local script="$1" diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index a17fe98b..c74e1b36 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -22,6 +22,7 @@ specific configuration file could not be found" && exit 1 ) export PATH=/bin:/sbin:/usr/bin/:/usr/sbin export date="08-02-2006" +export DEBUGLEVEL=0 export KERNEL="@@@KERNVER@@@" export NWMODULES="@@@NWMODULES@@@" export DISTRO="@@@DISTRO@@@" @@ -43,12 +44,10 @@ exec < /dev/console > /dev/console 2>&1 # run pre init script preinit - # start device auto discovery service - distro specific function udev_hotplug # read kernel commandline TMPFSSIZE="50%" -export DEBUGLEVEL=0 echo "noldap" > /tmp/ldap-done echo "nodhcp" > /tmp/dhcp-done read KCMDLINE < /proc/cmdline @@ -185,8 +184,6 @@ else fi # get configuration data via dhcp (with vendor code identifier if present in # ${VCI} or ldap if available (in background) -echo "dhcp:!:13117:0:99999:7:::" > /etc/passwd -echo "dhcp:x:101:" > /etc/group [ -n "$DHCP" ] && rundhcp ${VCI} & if [ -n "$noipyet" ] ; then waitfor /tmp/dhcp-done 20000 @@ -391,10 +388,16 @@ d_mkbootld close # should be killed if started within init killall -9 dhcpcd dhclient pump 2>/dev/null # unmount the bind mounted modules directory + +bash + for i in 0 40 100 200 300 500 800 1000 1200; do usleep $i && umount -n /lib/modules/${KERNEL} 2>/dev/null && break error " Waited $i ticks to unmount kernel module directory ..." nonfatal done + + + [ $i -gt 1000 ] && error " Unmount of the kernel modules directory \ failed for some reason. Some\n modprobe still active!?" # check for inittab file diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 08f40640..0cbcbe1d 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -150,7 +150,7 @@ copy_distro_stuff() { ######################################################################### # End of function declaration -while getopts :hgk:i:r:o:s:f:n:Sut:d:I:V:a: a ; do +while getopts :hgk:i:r:o:s:f:n:Sut:d:v:I:V:a: a ; do case $a in \:|\?) case $OPTARG in k) echo "-k requires kernel version parameter" @@ -169,6 +169,8 @@ while getopts :hgk:i:r:o:s:f:n:Sut:d:I:V:a: a ; do ;; d) echo "-d requires linux distribution name" ;; + v) echo "-v requires linux distribution version" + ;; I) echo "-I requires network interface parameter" ;; a) echo "-a requires a DSDT parameter" @@ -199,6 +201,8 @@ while getopts :hgk:i:r:o:s:f:n:Sut:d:I:V:a: a ; do ;; d) DISTRO=$OPTARG ;; + v) DISTRO_VER=$OPTARG + ;; I) NET_IF=$OPTARG ;; a) acpi_dsdt="$OPTARG" @@ -250,10 +254,17 @@ if [ -z "${DISTRO}" ] ; then if [ -e ${ROOTDIR}/etc/SuSE-release ] ; then DISTRO=suse DISTRO_VER=`grep "VERSION" ${ROOTDIR}/etc/SuSE-release | sed "s/.*= //"` + elif [ -e ${ROOTDIR}/etc/lsb-release ] ; then + . ${ROOTDIR}/etc/lsb-release + DISTRO=${DISTRIB_ID} + DISTRO_VER=${DISTRIB_RELEASE} elif [ -e ${ROOTDIR}/etc/debian_version ] ; then DISTRO=debian DISTRO_VER=`cat ${ROOTDIR}/etc/debian_version` - fi + else + echo "Could not detect client distribution type and version. Please specify as command line argument (-d <distro-name> -v <distro-version)" + exit 1; + fi fi case "${DISTRO}" in @@ -270,6 +281,7 @@ case "${DISTRO}" in case "${DISTRO_VER}" in Breezy*|breezy*|*) DISTRO_VER=5.10 + cp ${ROOTDIR}/lib/libnss_compat.so.2 ${INSTDIR}/lib ;; esac ;; @@ -297,12 +309,12 @@ case "${DISTRO}" in ;; esac - # hotplug/udev style and stuff - cp -a ${ROOTDIR}/etc/udev ${INSTDIR}/etc #cp -a /etc/sysconfig/{hardware,network} ${INSTDIR}/etc/sysconfig ;; esac +# hotplug/udev style and stuff +cp -a ${ROOTDIR}/etc/udev ${INSTDIR}/etc # an dieser stelle sollte jetzt sichergestellt sein, dass sowohl DISTRO als auch DISTRO_VER eindeutig gesetzt sind! @@ -311,8 +323,8 @@ esac copy_distro_stuff ${DISTRO} ${DISTRO_VER} # devices needed rather early (copied from /tmp to /dev in init) -mknod ${INSTDIR}/tmp/console c 5 1 &>/dev/null -mknod ${INSTDIR}/tmp/null c 1 3 &>/dev/null +mknod ${INSTDIR}/tmp/console c 5 1 #&>/dev/null +mknod ${INSTDIR}/tmp/null c 1 3 #&>/dev/null mknod ${INSTDIR}/tmp/kmsg c 1 11 &>/dev/null #if no klibc - klibc shell seems not to have enough functionality :-( @@ -390,7 +402,7 @@ case "${DISTRO}" in esac # add needed libraries depending on choosen binaries -for lib in `ldd /tmp/dxs-instrd/bin/* 2>/dev/null | sed -e "s,tls,," \ +for lib in `ldd /tmp/dxs-instrd/bin/* 2>/dev/null | sed -e "s,tls,," -e "s,i686/cmov,," \ -ne 's:\t\(.* => \)\?\(/.*\) (0x[0-9a-f]*):\2:p' | sort -u` ; do baselib=`basename ${lib}` test -e ${INSTDIR}/lib/${baselib} || \ @@ -411,7 +423,7 @@ if [ -z "$KERNVER" ] ; then fi if [ -z "$NWMODULES" ] ; then - NWMODULES="e100 tg3 via-rhine r8169" + NWMODULES="e100 tg3 via-rhine r8169 pcnet32" fi if [ -z "$FSMODULES" ] ; then FSMODULES="nbd nfs" |