diff options
author | Dirk von Suchodoletz | 2006-02-06 22:24:10 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-02-06 22:24:10 +0100 |
commit | 44c51a1730d9304f5f5754e3b63419040aa78729 (patch) | |
tree | b713c0829292b9572022e284a6aeba9597f0e4fd /initrd | |
parent | Fixed small bug in mkdxsinitrd/repco (link copying) and moved the (diff) | |
download | core-44c51a1730d9304f5f5754e3b63419040aa78729.tar.gz core-44c51a1730d9304f5f5754e3b63419040aa78729.tar.xz core-44c51a1730d9304f5f5754e3b63419040aa78729.zip |
Some tests with SuSE 10.1 revealed bugs in mkdxsinitrd. Added
configuration and functions ...
git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@63 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd')
-rw-r--r-- | initrd/distro-specs/suse/config-10.1 | 0 | ||||
-rw-r--r-- | initrd/distro-specs/suse/functions-10.1 | 71 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 27 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 3 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 108 |
5 files changed, 129 insertions, 80 deletions
diff --git a/initrd/distro-specs/suse/config-10.1 b/initrd/distro-specs/suse/config-10.1 new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/initrd/distro-specs/suse/config-10.1 diff --git a/initrd/distro-specs/suse/functions-10.1 b/initrd/distro-specs/suse/functions-10.1 new file mode 100644 index 00000000..19b41e79 --- /dev/null +++ b/initrd/distro-specs/suse/functions-10.1 @@ -0,0 +1,71 @@ +# Description: configuration functions for SuSE 10.0 which differ from +# functions defined for SuSE 9.3 which is base ... General +# changes should be done there, version specific changes for +# the 10.0 here. +# +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 06-02-2006 +# Blabla +# Blub +# +# Copyright: (c) 2006 - RZ Universitaet Freiburg +# +# Version: 0.2.1c + +# udev service +udev_hotplug () { +local result=0 +echo "Starting udev" +if [ -x /bin/udevd ] ; then + echo "" > /proc/sys/kernel/hotplug + udevd --daemon || result=1 + trigger_device_events + usleep 50 +else error " udev daemon is not available. Some devices might not \ +apprear." nonfatal +fi +return $result +} + +# acpi and powersave have changed +config_acpi () { +local start_acpi=10 +local stop_acpi=12 +local start_powersave=11 +local stop_powersave=11 +rllinker acpid "$start_acpi" "$stop_acpi" +rllinker powersaved "$start_powersave" "$stop_powersave" +} + +# configure dbus (inter application communication for kde and gnome), hal +# (hardware abstraction layer - used e.g. by powersaved) and resmgr +# (resource manager - the user gets permissions to devices when loggin on) +# runlevel script for haldaemon is now haldaemon instead of hal +config_dreshal () { +local start="05" +local stop="18" +if [ "x$start_dreshal" = "xyes" ]; then + if [ -f /mnt/etc/init.d/dbus ] ; then + strinfile "messagebus:" /mnt/etc/passwd || \ + echo "messagebus:x:100:101:User for D-BUS:/var/run/dbus:/bin/false" \ + >> /mnt/etc/passwd + testmkd /mnt/var/run/dbus + # chown 100:101 /mnt/var/run/dbus + rllinker "dbus" "$start" "$stop" + fi + if [ -f /mnt/etc/init.d/resmgr ] ; then + testmkd /mnt/var/run/resmgr/classes + start="0"`expr $start + 1` + stop="0"`expr $start - 1` + rllinker "resmgr" "$start" "$stop" + fi + if [ -f /mnt/etc/init.d/haldaemon ] ; then + strinfile "haldaemon:" /mnt/etc/passwd || \ + echo "haldaemon:x:105:103:User for haldaemon:/var/run/hal:/bin/false" \ + >> /mnt/etc/passwd + start="0"`expr $start + 1` + stop="0"`expr $start - 1` + rllinker "haldaemon" "$start" "$stop" + fi +fi +} + diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 4125acf5..bb834756 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -10,7 +10,34 @@ # # Version: 0.4.1b +####################################################################### +# generate events with the sysfs trigger +function trigger_device_events() { + list=$(echo /sys/bus/*/devices/*/uevent) + list="$list $(echo /sys/class/*/*/uevent)" + list="$list $(echo /sys/block/*/uevent /sys/block/*/*/uevent)" + for i in $list; do + case "$i" in + */device/uevent|*\**) + continue + ;; + */class/mem/*|*/class/tty/*) + first="$first $i" + ;; + */block/md*) + last="$last $i" + ;; + */*) + default="$default $i" + ;; + esac + done + # trigger the sorted events + for i in \$first \$default \$last; do + echo "add" > "\$i" + done +} ####################################################################### # produce error message and if $2 is empty run (debug) shell diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index bcb42c52..112c1539 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -39,6 +39,7 @@ echo 256 > /proc/sys/kernel/real-root-dev [ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys # start device auto discovery service - distro specific function +bash udev_hotplug # read kernel commandline TMPFSSIZE="50%" @@ -245,7 +246,6 @@ if [ -z "${DNBDOPT}" -a -z "${NBDOPT}" -a -z "${NFSROOT}" ] ; then . /etc/machine-setup NFSROOT=${serverip}:${root_path} fi - # call function for nfs mounts if [ -z "${DNBDOPT}" -a -z "${NBDOPT}" ] ; then nfsmnt ${NFSROOT} ${MODPRV} @@ -382,6 +382,7 @@ of this client did not finish in\n time. You might check the process list \ and list the modules loaded until\n now." # close runlevel script for stuff to execute during early bootup d_mkbootld close +bash # IP configuration is made and should not be updated automatically, udevd # should be killed if started within init killall -9 dhcpcd dhclient pump 2>/dev/null diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 5d78633a..98a63510 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -108,67 +108,6 @@ else fi } -# Resolve dynamic library dependencies. Returns a list of symbolic links -# to shared objects and shared object files for the binaries in $*. -# stolen from SuSE mkinitrd -shared_object_files() { - local LDD initrd_libs lib_files lib_links lib link - - LDD=`which ldd` - if [ ! -x $LDD ]; then - error 2 "I need execution permission on ldd ($LDD)." - fi - - initrd_libs=( $( - $LDD "$@" \ - | sed -ne 's:\t\(.* => \)\?\(/.*\) (0x[0-9a-f]*):\2:p' - ) ) - - # Evil hack: On some systems we have generic as well as optimized - # libraries, but the optimized libraries may not work with all - # kernel versions (e.g., the NPTL glibc libraries don't work with - # a 2.4 kernel). Use the generic versions of the libraries in the - # initrd (and guess the name). - local n optimized - for ((n=0; $n<${#initrd_libs[@]}; n++)); do - lib=${initrd_libs[$n]} - optimized="$(echo "$lib" | sed -e 's:.*/\([^/]\+/\)[^/]\+$:\1:')" - lib=${lib/$optimized/} - if [ "${optimized:0:3}" != "lib" -a -f "$lib" ]; then - #echo "[Using $lib instead of ${initrd_libs[$n]}]" >&2 - initrd_libs[$n]="${lib/$optimized/}" - fi - done - - for lib in "${initrd_libs[@]}"; do - case "$lib" in - linux-gate*) - # This library is mapped into the process by the kernel - # for vsyscalls (i.e., syscalls that don't need a user/ - # kernel address space transition) in 2.6 kernels. - continue ;; - /*) - lib="${lib:1}" ;; - *) - # Library could not be found. - echo "Dynamic library $lib not found" - continue ;; - esac - - while [ -L "/$lib" ]; do - echo $lib - link="$(readlink "/$lib")" - if [ x"${link:0:1}" == x"/" ]; then - lib=${link#/} - else - lib="${lib%/*}/$link" - fi - done - echo $lib - done \ - | sort -u -} - # this function incrementally concats and copies distro-specific functions, # configuration variables and files copy_distro_stuff() { @@ -182,6 +121,9 @@ copy_distro_stuff() { 10.0) copy_distro_stuff suse 9.3 ;; + 10.1) + copy_distro_stuff suse 10.0 + ;; esac ;; debian) @@ -284,18 +226,18 @@ mkdir -p ${INSTDIR}/usr/share # needed for KNOPPIX hwsetup not to confuse with ${D_SYSCONFDIR} mkdir -p ${INSTDIR}/etc/sysconfig - +# fixme!! Funktion ermittelt die Distro des Servers NICHT des Clients!! # if no distro name is set, try to find the correct one via lsb_release -if [ -z "${DISTRO}" ] ; then - for i in ${ROOTDIR}/bin/lsb_release ${ROOTDIR}/usr/bin/lsb_release; do - if [ -e $i ] ; then - $i > /dev/null 2>&1 || break - DISTRO=`. $i -i | sed "s/.*\t//"` - DISTRO_VER=`. $i -r | sed "s/.*\t//"` - break - fi - done -fi +#if [ -z "${DISTRO}" ] ; then +# for i in ${ROOTDIR}/bin/lsb_release ${ROOTDIR}/usr/bin/lsb_release; do +# if [ -e $i ] ; then +# $i > /dev/null 2>&1 || break +# DISTRO=`. $i -i | sed "s/.*\t//"` +# DISTRO_VER=`. $i -r | sed "s/.*\t//"` +# break +# fi +# done +#fi # if still no distro name set, try to find it using significant files if [ -z "${DISTRO}" ] ; then @@ -341,9 +283,13 @@ case "${DISTRO}" in # might be needed for older udev/hotplug # cp -a ${ROOTDIR}/etc/hotplug* ${INSTDIR}/etc ;; - 10*|*) + 10.0) DISTRO_VER=10.0 ;; + 10*) + DISTRO_VER=10.1 + cobi mknod bin + ;; esac # hotplug/udev style and stuff @@ -362,7 +308,7 @@ copy_distro_stuff ${DISTRO} ${DISTRO_VER} #if no klibc -for bbins in ash bash sh; do +for bbins in bash ash sh; do if cobi ${bbins} bin ; then ln -fs ${bbins} ${INSTDIR}/bin/sh [ "${bbins}" != "bash" ] && ln -fs ${bbins} ${INSTDIR}/bin/bash @@ -403,7 +349,7 @@ done # style of hotplug/udev/dev (for etc directories see above!!) for bbins in udev udevd udevstart do - cobi ${bbins} bin || echo "Program ${bbins} not found" + cobi ${bbins} bin &>/dev/null || echo "Program ${bbins} not found" done # in suse 9.3 it could be better to use udev.static etc @@ -436,10 +382,11 @@ case "${DISTRO}" in esac # add needed libraries depending on choosen binaries -for lib in `shared_object_files ${INSTDIR}/bin/*` ; do +for lib in `ldd /tmp/dxs-instrd/bin/* 2>/dev/null | sed -e "s,tls,," \ + -ne 's:\t\(.* => \)\?\(/.*\) (0x[0-9a-f]*):\2:p' | sort -u` ; do baselib=`basename ${lib}` test -e ${INSTDIR}/lib/${baselib} || \ - cp -a /${ROOTDIR}/${lib} ${INSTDIR}/lib + cp /${ROOTDIR}/${lib} ${INSTDIR}/lib done # add kernel modules and dependency files @@ -488,10 +435,13 @@ for module in af_packet ${NWMODULES} ${FSMODULES} ${DEBUGMODULES}; do nfs) mkdir -p ${INSTDIR}/lib/modules/${KERNVER}/kernel/net/sunrpc/ mkdir -p ${INSTDIR}/lib/modules/${KERNVER}/kernel/fs/lockd + mkdir -p ${INSTDIR}/lib/modules/${KERNVER}/kernel/fs/nfs_common cp ${ROOTDIR}/lib/modules/${KERNVER}/kernel/net/sunrpc/sunrpc.ko \ - ${INSTDIR}/lib/modules/${KERNVER}/kernel/net/sunrpc &>/dev/null + ${INSTDIR}/lib/modules/${KERNVER}/kernel/net/sunrpc &>/dev/null cp ${ROOTDIR}/lib/modules/${KERNVER}/kernel/fs/lockd/lockd.ko \ - ${INSTDIR}/lib/modules/${KERNVER}/kernel/fs/lockd &>/dev/null + ${INSTDIR}/lib/modules/${KERNVER}/kernel/fs/lockd &>/dev/null + cp ${ROOTDIR}/lib/modules/${KERNVER}/kernel/fs/nfs_common/nfs_acl.ko \ + ${INSTDIR}/lib/modules/${KERNVER}/kernel/fs/nfs_common &>/dev/null ;; esac fi |