From 96e5310fb00aeee57cb381f01aa18dafb04e4272 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 18 Jan 2006 12:22:01 +0000 Subject: Hässlichen Bug bei dhclient IP Konfig. beseitig. Etliche Services hinzugefügt. SuSE Funktionen (functions-suse...) erweitert. git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@18 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initrd/initrd-stuff/bin/dhcpmkconfig | 16 +++++++----- initrd/initrd-stuff/bin/servconfig | 48 +++++++++++++++++++++++++---------- initrd/initrd-stuff/etc/functions | 3 ++- initrd/initrd-stuff/etc/machine-setup | 16 +++++------- initrd/initrd-stuff/init | 6 +---- 5 files changed, 55 insertions(+), 34 deletions(-) (limited to 'initrd/initrd-stuff') diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig index 9d622842..d1bc3dfd 100755 --- a/initrd/initrd-stuff/bin/dhcpmkconfig +++ b/initrd/initrd-stuff/bin/dhcpmkconfig @@ -1,9 +1,10 @@ #!/bin/sh # -# Description: universal (distro independent) configuration writer for -# several dhcp clients +# Description: universal (distro independent) IP configuration writer for +# several dhcp clients. The result is written in unified form +# to the /etc/machine-setup file # -# Author(s): Dirk von Suchodoletz , 17-01-2006 +# Author(s): Dirk von Suchodoletz , 18-01-2006 # Blabla # Blub # @@ -17,7 +18,8 @@ echo -e "\n# ip configuration written by $0" \ >>/etc/machine-setup case $0 in *dhcpd*) - cat /var/lib/dhcp/dhcpcd-eth0.info | sed -e "s,',\",g" \ + cat /var/lib/dhcp/dhcpcd-eth0.info | sed -n -e '/^new/p' | sed \ + -e "s,',\",g" \ -e "s,IPADDR,clientip," -e "s,NETMASK,subnet_mask," \ -e "s,GATEWAY,gateway," -e "s,BROADCAST,broadcast_address," \ -e "s,HOSTNAME,host_name," -e "s,DOMAIN,domain_name," \ @@ -28,14 +30,16 @@ case $0 in -e "s,DHCP..ADDR.*,," -e "s,.*TIME=.*,," -e "s,CL.*,," \ -e "s,INTER.*,," -e "s,DHCPSNAME.*,," \ >>/etc/machine-setup - # empty lines should be removed somehow ;; *dhclient*) set | sed -n -e '/^new/p' | sed \ -e "s,^new_,," -e "s,fixed-address,clientip," \ -e "s,routers,gateway," -e "s,dhcp-server-identifier,serverip," \ -e "s,.*_t[iy][mp]e.*,," -e "s,.*_message_.*,," -e "/^$/d" \ - -e "s,language=,country=," \ + -e "s,language=,country=," -e "s,ip_address,clientip," \ >>/etc/machine-setup ;; + *pump*) + # + ;; esac diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index a984805e..a18576f1 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -111,28 +111,28 @@ if [ -n "$bootlocal_script" ]; then $bootlocal_script" >> /mnt/etc/${INITDIR}/boot.local fi -# setup nis configuration if needed -if [ "x$nis_domain" != "x" ] && [ "x$nis_servers" != "x" ] ; then - echo $nis_domain >/mnt/etc/defaultdomain - echo -e "# /etc/yp.conf - file generated by $0:\n\ -#\t$date\n\nypserver "$nis_servers >/mnt/etc/yp.conf - strinfile "+::::::" /mnt/etc/passwd || echo "+::::::" >>/mnt/etc/passwd -fi - ####################################################################### # basic (non network) services -# at daemon +# at daemon - calling distro specific function config_atd config_atd "14" "04" -# configuration of cron services +# configuration of cron services - calling distro specific function +# config_cron (runlevel links, directories, ...) [ "x$crontab_entries" != "x" ] && \ echo -e "$crontab_entries" >> /mnt/etc/crontab config_cron "16" "04" -# acpi and powersave -config_acpi "10" "10" +# setup system log services - distro dependent function config_syslog +config_syslog "02" "20" +# configure dbus - distro dependent function config_dreshal - handle all +# stuff regarding dependent services like dbus, resmgr, hal ... +# (check for runlevel scripts, passwd entries, directories ...) +config_dreshal "03" "18" + +# acpi and powersave - distro dependent function config_acpi +config_acpi "10" "10" ####################################################################### # network(ed) services @@ -237,15 +237,24 @@ if [ "x$start_xdmcp" != "xno" ] ; then if [ "$start_xdmcp" = "yes" ] ; then start_xdmcp=kdm fi + # just ensure lowercase + start_xdmcp=`echo $start_xdmcp|sed -e "y/'KGWXDM'/'kgwxdm'/"` case "$start_xdmcp" in wdm) # anywhere in use!? ;; + kdm) + # config is most probably not common in all distros? + # distro specific function config_kdm + config_kdm + ;; gdm) + # config is most probably not common in all distros? + # distro specific function config_gdm config_gdm ;; *) - # setup xdm + # setup xdm (should be the same over the several distros) echo -e "# /etc/X11/xdm/xdm-config - file generated by\n\ #\t$0: $date\n\nDisplayManager.errorLogFile:\t/var/log/xdm.errors\n\ DisplayManager.pidFile:\t\t/var/run/xdm.pid\n\ @@ -263,7 +272,20 @@ DisplayManager.*.session:\t/etc/X11/xdm/Xsession\n\ DisplayManager.*.reset:\t\t/etc/X11/xdm/Xreset" >/mnt/etc/X11/xdm/xdm-config [ "$xdmcp" = "false" ] && echo -e \ "DisplayManager.requestPort:\t0\n" >>/mnt/etc/X11/xdm/xdm-config + # distro specific function config_xdm (at least for runlevel links) config_xdm ;; esac fi + +####################################################################### +# NIS +# setup nis configuration if needed +if [ "x$nis_domain" != "x" ] && [ "x$nis_servers" != "x" ] ; then + echo $nis_domain >/mnt/etc/defaultdomain + echo -e "# /etc/yp.conf - file generated by $0:\n\ +#\t$date\n\nypserver "$nis_servers >/mnt/etc/yp.conf + # should be last in passwd file + strinfile "+::::::" /mnt/etc/passwd || echo "+::::::" >>/mnt/etc/passwd +fi + diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 23376161..6eca05c1 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -68,7 +68,6 @@ 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 @@ -169,6 +168,8 @@ if [ "$dhcp" = "none" ] ; then client could be found. Please check that you have some client from\n\ the following list installed: dhclient dhcpcd pump ipconfig." nonfatal else + # ensure the interface is up + ipsetup 0.0.0.0 255.255.255.255 0.0.0.0 255.255.255.255 eth0 & loadmod /lib/modules/@@@KERNVER@@@/kernel/net/packet/af_packet.ko \ "needed for dhcp"; echo "Starting $dhcp for configuration" diff --git a/initrd/initrd-stuff/etc/machine-setup b/initrd/initrd-stuff/etc/machine-setup index ff5580e6..343a558c 100644 --- a/initrd/initrd-stuff/etc/machine-setup +++ b/initrd/initrd-stuff/etc/machine-setup @@ -6,7 +6,7 @@ # New settings are simply appended, so that they might # overwrite previously defined variables # -# Author(s): Dirk von Suchodoletz , 08-01-2006 +# Author(s): Dirk von Suchodoletz , 18-01-2006 # Blabla # Blub # @@ -45,6 +45,9 @@ start_sshd="yes" # start rwhod service (lan wide login and uptime list) start_rwhod="no" +# start log server (remote log servers could be passed via dhcp option) +start_syslog="yes" + # start cron service start_cron="no" @@ -54,14 +57,9 @@ start_atd="no" # simple network management protocol for system monitoring start_snmp="no" -# resource manager (resmgr) -start_resmgr="yes" - -# hardware abstraction layer (hal) daemon, e.g. dbus is using it -start_hal="yes" - -# dbus daemon (inter application communication for kde and gnome) -start_dbus="yes" +# dbus, resource manager , hal (hardware abstraction layer) interoperate +# tighly. There might be little different solutions within each distro +start_dreshal="yes" # start alsa sound system start_alsasound="yes" diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 4d1e9138..0b7b6a11 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -211,10 +211,6 @@ fi if [ -z "${DNBDOPT}" -a -z "${NBDOPT}" ] ; then nfsmnt ${NFSROOT} ${MODPRV} fi -# Bruchstücke?? Was hat das hier verloren? -# Wer schmeisst hier hirnlos Teile aus dem Code?? Dann sind die Module wech, die -# hwautoconfig vielleicht mal laden soll!!!! Es will keiner prophylaktisch 50++MB -# Module schonmal in die Ramdisk klatschen!!! # 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\ @@ -338,7 +334,7 @@ of this client did not finish in\n time. You might check the process list \ and list the modules loaded until\n now." date -#ash +ash # IP configuration is made and should not be updated automatically killall -9 dhcpcd dhclient pump 2>/dev/null # unmount the bind mounted modules directory -- cgit v1.2.3-55-g7522