From 07be2c0ecf404f9c30ee42544539b39343f40a14 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Tue, 17 Jan 2006 11:15:39 +0000 Subject: dhclient schreibt jetzt Konfiguration sauber nach machine-setup. Laden von Modulen durch hwautocfg geht wieder (bind-mount des Modulverz. wieder aktiv). servconfig leicht erweitert (acpi und powersave) ... git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@16 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initrd/distro-specs/suse-10.0/functions-suse-10.0 | 12 +++++++- initrd/initrd-stuff/bin/dhcpmkconfig | 16 +++++------ initrd/initrd-stuff/bin/hwautocfg | 15 ++-------- initrd/initrd-stuff/bin/servconfig | 6 +++- initrd/initrd-stuff/etc/functions | 10 +++---- initrd/initrd-stuff/init | 35 +++++++++++++++-------- initrd/mkdxsinitrd | 12 ++++---- 7 files changed, 62 insertions(+), 44 deletions(-) (limited to 'initrd') 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 475a8b94..ef867be6 100644 --- a/initrd/distro-specs/suse-10.0/functions-suse-10.0 +++ b/initrd/distro-specs/suse-10.0/functions-suse-10.0 @@ -2,7 +2,7 @@ # linux diskless clients (executed within initial # ramdisk after genconfig) # -# Author(s): Dirk von Suchodoletz , 08-01-2006 +# Author(s): Dirk von Suchodoletz , 17-01-2006 # Blabla # Blub # @@ -163,3 +163,13 @@ consolefont () { echo -e "setfont ${CONSOLE_FONT} >${LOGFILE} 2>&1" \ >>/mnt/etc/${INITDIR}/boot.ld } + +# acpi and powersave +config_acpi () { +local start_acpi=$1 +local stop_acpi=$2 +local start_powersave=`expr $1 + 5` +local stop_powersave=`expr $1 - 1` +rllinker acpid "$start_acpi" "$stop_acpi" +rllinker powersaved "$start_powersave" "$stop_powersave" +} diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig index a7cbda19..9d622842 100755 --- a/initrd/initrd-stuff/bin/dhcpmkconfig +++ b/initrd/initrd-stuff/bin/dhcpmkconfig @@ -3,7 +3,7 @@ # Description: universal (distro independent) configuration writer for # several dhcp clients # -# Author(s): Dirk von Suchodoletz , 07-01-2006 +# Author(s): Dirk von Suchodoletz , 17-01-2006 # Blabla # Blub # @@ -15,8 +15,8 @@ # client variable should be exported via calling function echo -e "\n# ip configuration written by $0" \ >>/etc/machine-setup -case $client in - dhcpcd) +case $0 in + *dhcpd*) cat /var/lib/dhcp/dhcpcd-eth0.info | sed -e "s,',\",g" \ -e "s,IPADDR,clientip," -e "s,NETMASK,subnet_mask," \ -e "s,GATEWAY,gateway," -e "s,BROADCAST,broadcast_address," \ @@ -30,12 +30,12 @@ case $client in >>/etc/machine-setup # empty lines should be removed somehow ;; - dhclient) - set | grep "new_" | sed \ + *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,.*-time.*,," -e "s,language=,country=," \ - >>/etc/machine-setup + -e "s,.*_t[iy][mp]e.*,," -e "s,.*_message_.*,," -e "/^$/d" \ + -e "s,language=,country=," \ + >>/etc/machine-setup ;; esac - diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg index ae9c691c..1f8ac180 100755 --- a/initrd/initrd-stuff/bin/hwautocfg +++ b/initrd/initrd-stuff/bin/hwautocfg @@ -4,7 +4,7 @@ # script for linux diskless clients, using hwconfig from # knoppix as base tool # -# Author(s): Dirk von Suchodoletz , 06-01-2006 +# Author(s): Dirk von Suchodoletz , 16-01-2006 # Blabla # Blub # @@ -262,8 +262,8 @@ fi # ACPI configuration #if [ -d /proc/acpi ]; then -# if ! inkernelcmdline "noacpi" || ! inkernelcmdline "acpi=off"; then -# echo ACPIbla +# if ! strinstr "noacpi" ${KCMDLINE} || \ +# ! strinstr "acpi=off" ${KCMDLINE} ; then # found="" # for acpi in /lib/modules/$KERNEL/kernel/drivers/acpi/*; do # acpi=`basename acpi` @@ -273,16 +273,7 @@ fi # modprobe $basename >/dev/null 2>&1 && echo -n " ${YELLOW}$basename${GREEN}" && found="yes" # done # fi -#else -# APM -#if checkbootparam "noapm"; then -#echo " ${BLUE}Skipping APM Bios detection as requested on boot commandline.${NORMAL}" -#else -#modprobe apm power_off=1 >/dev/null 2>&1 && test -x /etc/init.d/apmd && /etc/init.d/apmd start && echo "${GREEN}APM Bios found, power management functions enabled.${NORMAL}" #fi -#fi - - # AGP configuration (agpgart and chipset specific driver) diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index 0fda5df9..952c7521 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -4,7 +4,7 @@ # for linux diskless clients (executed within initial # ramdisk) # -# Author(s): Dirk von Suchodoletz , 08-01-2006 +# Author(s): Dirk von Suchodoletz , 17-01-2006 # Blabla # Blub # @@ -130,6 +130,10 @@ config_atd "14" "04" echo -e "$crontab_entries" >> /mnt/etc/crontab config_cron "16" "04" +# acpi and powersave +config_acpi "10" "10" + + ####################################################################### # network(ed) services diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index b431e40e..30a142cf 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -138,7 +138,7 @@ option start-cron code 227\t\t= string;\n\ option crontab-entries code 228\t\t= string;\n\ option start-rwhod code 229\t\t= string;\n\ option start-printdaemon code 230\t= string;\n\ -option desktop-session code 231\t= string;\n\ +option desktop-session code 231\t\t= string;\n\ option tex-enable code 232\t\t= string;\n\ option netbios-workgroup code 233\t= string;\n\ option vmware code 234\t\t\t= string;\n\ @@ -146,7 +146,7 @@ option hw-mouse code 252\t\t= string;\n\ option hw-graphic code 253\t\t= string;\n\ option hw-monitor code 254\t\t= string;\n\n\ send dhcp-lease-time 86400;\nsend dhcp-max-message-size 1400;\n\ -request;\nscript \"/bin/dhclient-script\";" >> /etc/dhclient.conf +request;\nscript \"/sbin/dhclient-script\";" >> /etc/dhclient.conf if [ -n "$vci" ] ; then echo "send vendor-class-identifier \"$vci\";" >> /etc/dhclient.conf fi @@ -172,19 +172,19 @@ else loadmod /lib/modules/@@@KERNVER@@@/kernel/net/packet/af_packet.ko \ "needed for dhcp"; echo "Starting $dhcp for configuration" - mkdir /var/lib/dhcp 2&>1 >/dev/null + mkdir /var/lib/dhcp 2>&1 >/dev/null fi export client="$dhcp" case $dhcp in dhclient) mkdhclconf $vci ln -s /bin/dhcpmkconfig /sbin/dhclient-script - dhclient -lf /var/lib/dhcp/dhclient.leases eth0 || \ + dhclient -lf /var/lib/dhcp/dhclient.leases eth0 2>&1 >/dev/null || \ error " Fatal error occured while trying to run dhclient.\n$commonerr" ;; dhcpcd) ln -s /bin/dhcpmkconfig /sbin/dhcpd.exe - dhcpcd -L /var/lib/dhcp -c /sbin/dhcpd.exe -T -t 30 eth0 || \ + dhcpcd -L /var/lib/dhcp -c /sbin/dhcpd.exe -T -t 30 eth0 2>&1 >/dev/null || \ error " Fatal error occured while trying to run dhcpcd.\n$commonerr" ;; pump) diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index f3317a07..86cc3384 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -7,7 +7,7 @@ specific configuration file could not be found" date export PATH=/bin:/sbin:/usr/bin/:/usr/sbin -export date="07-01-2006" +export date="17-01-2006" exec < /dev/console > /dev/console 2>&1 export KERNEL="@@@KERNVER@@@" @@ -20,9 +20,9 @@ mkdir -p ${DEVDIR}/pts mkdir -p ${DEVDIR}/shm mkdir -p ${DEVDIR}/.udevdb -[ ! -f /proc/cpuinfo ] && mount -n -tproc proc /proc +[ ! -f /proc/cpuinfo ] && mount -n -t proc proc /proc echo 256 > /proc/sys/kernel/real-root-dev -[ ! -d /sys/class ] && mount -n -tsysfs sysfs /sys +[ ! -d /sys/class ] && mount -n -t sysfs sysfs /sys # start device auto discovery (just the first case is tested yet) if [ -x /bin/udev -a -x /bin/udevstart ] ; then @@ -65,6 +65,10 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup ldap) LDAP="yes" rm /tmp/ldap-done;; + # ldap configuration with host and port to contact (base) + ldap*) + LDAP="yes" + rm /tmp/ldap-done;; # if ld.so.cache should not be generated noldsc) NOLDSC=yes;; @@ -83,7 +87,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}\"\n" >> /etc/machine-setup ;; # size of tempfs if not max. 50% of RAM should be used tmpfssize=*) @@ -107,12 +111,8 @@ might pass that information via kernel command line\n through setting of \ 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 +# for ldap configuration at least basic IP setup is needed to contact the +# server [ -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 \ @@ -159,7 +159,8 @@ sub_netmask=$NM\ngateway=$GW\nserverip=$SERVER" \ else noipyet="yes" fi -# get configuration data via dhcp or ldap if available (in background) +# get configuration data via dhcp (with vendor code identifier if present in +# ${VCI} or ldap if available (in background) [ -n "$DHCP" ] && rundhcp ${VCI} & if [ -n "$noipyet" ] ; then waitfor /tmp/dhcp-done 20000 @@ -211,6 +212,16 @@ 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\ + * 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." # 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 @@ -327,7 +338,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 diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 8c1403c2..ce214728 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -3,7 +3,7 @@ # Description: universal (distro independent) generator for initial # ramdisks for linux diskless clients # -# Author(s): Dirk von Suchodoletz , 06-01-2006 +# Author(s): Dirk von Suchodoletz , 16-01-2006 # Blabla # Blub # @@ -15,7 +15,6 @@ DEBUG=1 LINRC=${INSTDIR}/init COMETCEXCL="XF86Config*\nissue*\nmtab*\nfstab*\n" COMDIRINDXS="/tmp/scratch /var/lib/nobody" -set +x # distro specific settings read from configuration file # SYSCONFDIR - system wide configuration settings in /etc - sysconfig in @@ -43,6 +42,9 @@ INITBOOTD="" RCDIRS="" RCDIRSINRW="" INITSCRIPTS="" +XF86CONFFILE="" +XFONTPATH="" +DEFAULTCOUNTRY="" ######################################################################### # End of global variable declaration, nothing needed to be changed at @@ -269,7 +271,7 @@ mkdir -p ${INSTDIR}/usr/share mkdir -p ${INSTDIR}/etc/sysconfig # source configuration file for the distribution used -DISTRO=debian +DISTRO=suse case "${DISTRO}.${DISVER}" in SuSE*|suse*|Suse*|SuSe*) DISTRO=suse-10.0 @@ -360,8 +362,8 @@ for lib in `shared_object_files ${INSTDIR}/bin/*` ; do done # add kernel modules and dependency files -#KERNVER=2.6.13-15-default -KERNVER=2.6.12-10-386 +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