diff options
Diffstat (limited to 'initrd/initrd-stuff')
-rwxr-xr-x | initrd/initrd-stuff/bin/dhcpmkconfig | 15 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 60 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 41 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/messages | 3 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 10 |
5 files changed, 53 insertions, 76 deletions
diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig index 3b4a1f77..394de967 100755 --- a/initrd/initrd-stuff/bin/dhcpmkconfig +++ b/initrd/initrd-stuff/bin/dhcpmkconfig @@ -4,13 +4,15 @@ # several dhcp clients. The result is written in unified form # to the /etc/machine-setup file # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 22-05-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-06-2006 +# Lars Mueller, 23-06-2006 +# Oliver Tappe, 23-06-2006 # # Copyright: (c) 2006 - RZ Universitaet Freiburg # client variable should be exported via calling function echo -e "\n# ip configuration written by $0" \ - >>/etc/machine-setup + >>/tmp/confviadhcp 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 \ @@ -27,21 +29,22 @@ case $0 in -e "s,NETWORK,network," \ -e "s,DHCP..ADDR.*,,;s,.*TIME=.*,,;s,CL.*,,;/^$/d" \ -e "s,INTER.*,,;s,DHCPSNAME.*,," /var/lib/dhcp/dhcpcd-eth0.info \ - >>/etc/machine-setup + >>/tmp/confviadhcp ;; *dhclient*) echo -e "# --> You are using dhclient. Iy you wish to transfer other \ vendor/user\n# specific variables, you have to add them in functions and \ in\n# dhcpmkconfig script or use tftp (to be enabled via kernel \ -command\n# line)." >>/etc/machine-setup +command\n# line)." >>/tmp/confviadhcp set | sed -n -e '/^new/p' | sed \ -e "s,^new_,,;s,fixed_address,clientip," \ -e "s,routers,gateway,;s,dhcp_server_identifier,serverip," \ -e "s,.*_t[iy][mp]e.*,,;s,.*_message_.*,,;/^$/d" \ -e "s,language=,country=,;s,ip_address,clientip," \ - >>/etc/machine-setup + >>/tmp/confviadhcp ;; *pump*) - dhcl="pump"; echo -e "$infomsg" >>/etc/machine-setup + dhcl="pump"; echo -e "$infomsg" >>/tmp/confviadhcp ;; esac + diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index 42b1be77..f27c4055 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -4,8 +4,10 @@ # for linux diskless clients (executed within initial # ramdisk) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 01-06-2006 -# Michael Janczyk, 31-05-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-06-2006 +# Michael Janczyk, 31-05-2006 +# Lars Mueller, 23-06-2006 +# Oliver Tappe, 23-06-2006 # # Copyright: (c) 2006 - RZ Universitaet Freiburg # @@ -59,10 +61,14 @@ echo " # from dhcp, ldap ... # wait for the appearance of configuration via dhcp # do not wait if dhcp is not used (how?) -waitfor /tmp/dhcp-done 10000 || error " Did not get any configuration \ -data via dhcp until now ..." nonfatal -waitfor /tmp/ldap-done 10000 || error " Did not get any configuration \ -data via dhcp until now ..." nonfatal +waitfor /tmp/dhcp-done 10000 || error "$scfg_errdcfg" nonfatal +waitfor /tmp/file-done 10000 || error "$scfg_errfcfg" nonfatal +waitfor /tmp/ldap-done 10000 || error "$scfg_errlcfg" nonfatal +# concat the different files now into the central config file, order +# matters - ldap data has highest priority +for config in /tmp/confviadhcp /tmp/confviafile /tmp/confvialdap + do test -f $config && cat $config >> /etc/machine-setup +done . /etc/machine-setup # hack for replacing variables ($serverip, $clientip, $host_name) in # machine-setup @@ -128,47 +134,7 @@ test -n "$domain_name_servers" && { # initial boot scripts # delete and create runlevel links for initial booting (SuSE, Debian, # ...) -case ${DISTRO} in - suse*|debian*|ubuntu*) - for i in ${D_RCDIRS} ${D_INITBOOTD} ; do - rm -f /mnt/etc/$i/* - done - count=10 - # boot.ld is a special runlevel script generated within initial ramdisk - # which should be executed before the rest - for i in boot.ld ${D_INITSCRIPTS}; do - count=`expr $count + 1` - revcnt=`expr 41 - $count` - ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/S${count}$i - ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/K${revcnt}$i - done - ;; - gentoo*) - # rather different runlevel concept - rm /mnt/etc/runlevels/*/.critical 2>/dev/null - for i in ${D_INITSCRIPTS}; do - ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/$i - echo $i >> /mnt/etc/${D_INITBOOTD}/.critical - echo $i >> /mnt/etc/runlevels/default/.critical - done - -# ( for i in /mnt/etc/init.d/*; do -# strinstr ".sh" "$i" && continue -# script=${i#/mnt/etc/init.d/*} -# if ! strinstr "$script " "${D_INITSCRIPTS} " ; then -# for j in /mnt/etc/init.d/*; do -# strinstr ".sh" "$j" && continue -# link=${j#/mnt/etc/init.d/*} -# if ! strinstr "$script" "$link" ; then -# sed "/depend/,/}/s/$script //;/depend/,/}/s/$script$//" \ -# /mnt/etc/init.d/$link > /tmp/rlvscript -# cp /tmp/rlvscript /mnt/etc/init.d/$link -# fi -# done -# fi -# done ) & - ;; -esac +initial_boot ####################################################################### # diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 508fd35e..351a4c6f 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -2,7 +2,7 @@ # linux diskless clients (included by init, hwautocfg, # servconfig, ... within initial ramdisk) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 28-05-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-06-2006 # Felix Endres, 30-04-2006 # Tobias Maier # @@ -27,6 +27,10 @@ postinit () { config_distro () { : } +# udev/hotplug - auto device discovery service +udev_hotplug () { + : +} ####################################################################### @@ -694,27 +698,28 @@ case "$country" in ;; esac } - -######################### dummy functions - -preinit () { - : -} - -postinit () { - : +####################################################################### +# setup initial boot scripts (for most standard distributions, gentoo +# is to be handled differently) +initial_boot () { +for i in ${D_RCDIRS} ${D_INITBOOTD} ; do + rm -f /mnt/etc/$i/* +done +count=10 +# boot.ld is a special runlevel script generated within initial ramdisk +# which should be executed before the rest +for i in boot.ld ${D_INITSCRIPTS}; do + count=`expr $count + 1` + revcnt=`expr 41 - $count` + ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/S${count}$i + ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/K${revcnt}$i +done } -# distro specific function called from servconfig script -config_distro () { - : -} +####################################################################### +# dummy functions # AUS SuSE-9.3 -# udev/hotplug - auto device discovery service -udev_hotplug () { - : -} # linking runlevel scripts rllinker () { diff --git a/initrd/initrd-stuff/etc/messages b/initrd/initrd-stuff/etc/messages index a9f776bc..8e319d19 100644 --- a/initrd/initrd-stuff/etc/messages +++ b/initrd/initrd-stuff/etc/messages @@ -132,6 +132,9 @@ df_errnsc=" Name Service caching deamon $df_errserv\n This service might \ be useful to take load from a ldap user directory." # messages from servconfig +scfg_errdcfg=" Did not get any configuration data via dhcp until now ..." +scfg_errfcfg=" Did not get any configuration data via tftp until now ..." +scfg_errlcfg=" Did not get any configuration data via ldap until now ..." scfg_nfs=" Mount of some NFS source failed ..." scfg_vmdir=" For some reason the runvmware script is not available for \ copying. That\n could be the result of failed mount or simply missing \ diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 3ba3bca4..3a9e4a11 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -44,7 +44,7 @@ exec < /dev/console > /dev/console 2>&1 # run pre init script preinit -[ -x /bin/vendor_preinit ] && /bin/vendor_preinit +[ -x /bin/preinit.local ] && /bin/preinit.local # start device auto discovery service - distro specific function udev_hotplug @@ -90,7 +90,7 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup rm /tmp/ldap-done ;; # ldap configuration with host and port to contact (base) - ldap*) + ldap=*) LDAP="yes" rm /tmp/ldap-done ;; @@ -102,7 +102,7 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup rm /tmp/file-done ;; # file source with tftp server and file location on the server - file*) + file=*) FILE="yes" FILESRC=${opts#file=} rm /tmp/file-done @@ -120,7 +120,7 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup UNIONFS=1;; # if cowloop should be used, only ontop of network block device and in # combination with classical fs, like ext2 useful - cowloop*) + cowloop=*) COWLOOP=1 #COWSIZE=${opts#cowloop=} ;; @@ -456,7 +456,7 @@ cp /etc/machine-setup /mnt/etc # post init for some distro specific postinit -[ -x /bin/vendor_postinit ] && /bin/vendor_postinit +[ -x /bin/postinit.local ] && /bin/postinit.local # start a debug shell in higher debug levels [ $DEBUGLEVEL -gt 2 ] && /bin/sh |