From a0403a95ef0509aee974dfe50d00ef084b6b315e Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Sat, 24 Jun 2006 20:20:56 +0000 Subject: Massive changes for distro specific configurations (mkdxsinitrd, distro-specs/*) ... git-svn-id: http://svn.openslx.org/svn/openslx/ld4@249 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initrd/initrd-stuff/bin/dhcpmkconfig | 15 +++++---- initrd/initrd-stuff/bin/servconfig | 60 ++++++++---------------------------- 2 files changed, 22 insertions(+), 53 deletions(-) (limited to 'initrd/initrd-stuff/bin') 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 , 22-05-2006 +# Author(s): Dirk von Suchodoletz , 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 , 01-06-2006 -# Michael Janczyk, 31-05-2006 +# Author(s): Dirk von Suchodoletz , 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 ####################################################################### # -- cgit v1.2.3-55-g7522