From 75d2cd36dc36ab2dd67fdf443001b29b4478f826 Mon Sep 17 00:00:00 2001 From: Nico Dietrich Date: Thu, 12 Jan 2006 22:04:32 +0000 Subject: erste anpassungen an ubuntu git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@12 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initrd/distro-specs/debian/config | 10 +++++----- initrd/distro-specs/suse-10.0/functions-suse-10.0 | 4 ++++ initrd/initrd-stuff/etc/functions | 3 ++- initrd/initrd-stuff/init | 18 ++++++++---------- initrd/mkdxsinitrd | 19 ++++++++++++++----- 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/initrd/distro-specs/debian/config b/initrd/distro-specs/debian/config index ca2bb2aa..2f7eee71 100644 --- a/initrd/distro-specs/debian/config +++ b/initrd/distro-specs/debian/config @@ -19,14 +19,14 @@ SYSCONFDIR=/default -DISETCEXCL="opt/gnome/gconf/*\n*.old\n*-\n\ +DISETCEXCL="etc/gconf/*\n*.old\n*-\n\ *.YaST2save\netc/autoinstall\nlogrotate*\nbootloader\n*~\n\ *.SuSEconfig.saved\npptp.d\nisdn\nyouservers\nhardware/hwcfg*\n\ X11/xdm/pixmaps\n*.rpmsave\ndhclient.script\ninit.d/boot.d/*\n\ -init.d/rc3.d/*\ninit.d/rc5.d/*" +rc2.d/*\nrc5.d/*" BINDMPTS="tmp root home" DIRINBINDMNT="/var/run /var/log /var/tmp" -RODIRSINRW="/etc/opt/gnome/gconf /etc/X11/xkb /var/adm /var/lib/texmf /var/lib/rpm" +RODIRSINRW="etc/gconf etc/X11/xkb /var/adm /var/lib/texmf /var/lib/rpm" DISDIRINDXS="/var/X11R6/compose-cache \ /var/run/sysconfig/tmp /var/adm /var/lib/rpm /var/lib/nobody \ /var/lib/pam_devperm /var/lib/bluetooth \ @@ -35,6 +35,6 @@ DISDIRINDXS="/var/X11R6/compose-cache \ /var/lock/subsys/sysconfig" DISBINDMNT="# " INITDIR="/init.d" -INITBOOTD="/rc.boot" -RCDIRS="/rc0.d /rc1.d /rc2.d /rc3.d /rc4.d /rc5.d /rc6.d /rcS.d" +INITBOOTD="/rcS.d" +RCDIRS="/rc0.d /rc1.d /rc2.d /rc3.d /rc4.d /rc5.d /rc6.d" INITSCRIPTS="boot.udev boot.proc boot.shm boot.klog boot.loadmodules boot.clock boot.localnet boot.sysctl boot.ipconfig" diff --git a/initrd/distro-specs/suse-10.0/functions-suse-10.0 b/initrd/distro-specs/suse-10.0/functions-suse-10.0 index f6523a53..475a8b94 100644 --- a/initrd/distro-specs/suse-10.0/functions-suse-10.0 +++ b/initrd/distro-specs/suse-10.0/functions-suse-10.0 @@ -10,6 +10,10 @@ # # Version: 0.2.1a +# distro specific stuff to initialize +preinit () { +} + # linking runlevel scripts rllinker () { local script="$1" diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 7e189917..feb43937 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -23,7 +23,7 @@ return 0 # load a certain module loadmod() { local modpath=$1 -local module=`echo $modpath|sed -e "s,.*/,,` +local module=`echo $modpath|sed -e "s,.*/,,"` local msg=$2 if [ -f $modpath ] ; then module=${module%.*} @@ -64,6 +64,7 @@ done case $ipcfg in ip) ip link set dev $if up + echo "test" ip addr add $ip/`nm2pref $nm` broadcast $bc dev $if if [ "$gw" != "0.0.0.0" ] ; then ip route add default via $gw diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 68d921f2..3c4a34f0 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -83,8 +83,7 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup # nfs server and path nfsroot=*) NFSROOT=${opts#nfsroot=} - echo -e "\n# nfs root information gotten via kernel command line \ -in $0\nnfsroot=\"${NFSROOT}\"" >> /etc/machine-setup + echo -e "\n# nfs root information gotten via kernel command line \ in $0\nnfsroot=\"${NFSROOT}\"" >> /etc/machine-setup ;; # size of tempfs if not max. 50% of RAM should be used tmpfssize=*) @@ -109,6 +108,12 @@ enabled via tokens ('ldap' or 'dhcp') in kernel\n command line." fi fi [ -z "$DHCP" -a -n "$LDAP" -a -z "$IPINFO" ] && error " Unable to setup at \ +might pass that information via kernel command line\n through setting of \ +'ipappend 1' in pxelinux.cfg/* or just enable dhcp\n or ldap. They are \ +enabled via tokens ('ldap' or 'dhcp') in kernel\n command line." + fi +fi +[ -z "$DHCP" -a -n "$LDAP" -a -z "$IPINFO" ] && error " Unable to setup at \ least basic functionality, because no IP configuration\n available. Please \ beware - ldap works only in combination of either\n ipappend or similar or \ with dhcp!" @@ -131,14 +136,12 @@ else MODPRV="-q" LOGFILE="/dev/null" fi - # load network adaptor modules modprobe ${MODPRV} -a ${NWMODULES} || error " Failed to load the network \ adaptor modules defined via mkdxsinitrd\n run. Please rerun and list the \ appropriate modules (without .ko)." # set up loopback networking (ipsetup - function defined in /etc/functions) ipsetup 127.0.0.1 255.0.0.0 0.0.0.0 127.255.255.255 lo - # analyze ip information from the kernel command line and put parts # of it into several variables if [ -n "$IPINFO" ] ; then @@ -208,11 +211,6 @@ if [ -z "${DNBDOPT}" -a -z "${NBDOPT}" ] ; then nfsmnt ${NFSROOT} ${MODPRV} fi -# get the complete collection of kernel modules available -mount -n --bind /mnt/lib/modules/${KERNEL} /lib/modules/${KERNEL} || \ - error " The requested modules directory does not exist. That could mean:\n\ - * The kernel was updated but mkdxsinitrd was not run afterwards.\n\ - * The mounted filesystem does not contain the modules directory at all.\n\ You might want to check the list of mounted filesystems and if /mnt is\n\ not empty run 'ls /mnt/lib/modules' to check." # start hardware configuration as background process @@ -267,7 +265,7 @@ else # for tar exclude lists might be used, more difficult for cp cd /mnt tar -X /tmp/etc.exclude -cp etc/* 2>/dev/null| \ - tar -xp -C ${RWDIR}>/dev/null 2>&1; + tar -xp -C ${RWDIR}>/dev/null ; cd / mount -n --bind ${RWDIR}/etc /mnt/etc mount -n --bind ${RWDIR}/var /mnt/var diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index ed608885..8c1403c2 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -41,6 +41,7 @@ DISBINDMNT="" INITDIR="" INITBOOTD="" RCDIRS="" +RCDIRSINRW="" INITSCRIPTS="" ######################################################################### @@ -93,7 +94,7 @@ shared_object_files() { LDD=`which ldd` if [ ! -x $LDD ]; then - error 2 "I need $LDD." + error 2 "I need execution permission on ldd ($LDD)." fi initrd_libs=( $( @@ -268,7 +269,7 @@ mkdir -p ${INSTDIR}/usr/share mkdir -p ${INSTDIR}/etc/sysconfig # source configuration file for the distribution used -DISTRO=suse +DISTRO=debian case "${DISTRO}.${DISVER}" in SuSE*|suse*|Suse*|SuSe*) DISTRO=suse-10.0 @@ -290,7 +291,7 @@ cp -a distro-specs/${DISTRO}/files ${INSTDIR}/etc/sysconfig for bbins in ash bash sh; do if cobi ${bbins} bin ; then LRCSH=/bin/${bbins}; ln -fs /bin/${bbins} ${INSTDIR}/bin/sh; break - else echo "Binary not found (1)"; fi + else echo "Binary not found (${bbins})"; fi done # if no klibc @@ -318,7 +319,10 @@ for bbins in \ done # one of the dhcp clients -cobi dhcpcd bin +for dhcp in dhclient dhcpcd pump ipconfig ; do + which $dhcp && break; +done +cobi $dhcp bin mkdir -p ${INSTDIR}/var/{lib,run} # debug binaries @@ -343,6 +347,11 @@ mkdir -p ${INSTDIR}/var/lib/nfs/state #if nfs - dann modul suchen, kopieren +case "${DISTRO}" in + debian*) + cp /lib/libnss_compat.so.2 ${INSTDIR}/lib;; +esac + # add needed libraries depending on choosen binaries for lib in `shared_object_files ${INSTDIR}/bin/*` ; do baselib=`basename ${lib}` @@ -352,7 +361,7 @@ done # add kernel modules and dependency files #KERNVER=2.6.13-15-default -KERNVER=2.6.13-15.7-default +KERNVER=2.6.12-10-386 NWMODULES="e100 tg3 via-rhine" FSMODULES="nbd nfs" -- cgit v1.2.3-55-g7522