diff options
-rw-r--r-- | initrd/distro-specs/debian/functions-debian | 21 | ||||
-rw-r--r-- | initrd/distro-specs/suse-10.0/functions-suse-10.0 | 63 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/dhcpmkconfig | 16 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 48 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 3 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/machine-setup | 16 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 6 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 6 |
8 files changed, 140 insertions, 39 deletions
diff --git a/initrd/distro-specs/debian/functions-debian b/initrd/distro-specs/debian/functions-debian index 12521f33..1edb34a9 100644 --- a/initrd/distro-specs/debian/functions-debian +++ b/initrd/distro-specs/debian/functions-debian @@ -2,7 +2,7 @@ # linux diskless clients (executed within initial # ramdisk after genconfig) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 16-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 18-01-2006 # Blabla # Blub # @@ -74,6 +74,13 @@ if [ "x$start_cron" = "xyes" ] ; then fi } +# syslog service +config_syslog () { +if [ "x$start_syslog" = "xyes" ] ; then + echo >/dev/null +fi +} + # secure shell service config_sshd () { if [ "x$start_sshd" = "xyes" ] ; then @@ -180,3 +187,15 @@ config_xdm () { config_gdm () { echo >/dev/null } + +# configure kdm as display manager +config_kdm () { + echo >/dev/null +} + +# configure hal, dbus, resmgr and services like that +config_dreshal () { +if [ "x$start_dreshal" = "xyes" ]; then + echo >/dev/null +fi +} 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 2f708141..fb018b89 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 <dirk@goe.net>, 17-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 18-01-2006 # Blabla # Blub # @@ -36,8 +36,9 @@ config_ntp () { local start=$1 local stop=$2 if [ -f /mnt/etc/init.d/ntp ] ; then - echo -e "ntp:x:74:65534:NTP daemon:/var/lib/ntp:/bin/false" \ - >>/mnt/etc/passwd + strinfile "ntp:" /mnt/etc/passwd || \ + echo -e "ntp:x:74:65534:NTP daemon:/var/lib/ntp:/bin/false" \ + >>/mnt/etc/passwd testmkd /mnt/var/lib/ntp/var/run/ntp &>/dev/null if [ "x$start_ntp" = "xinitial" ] ; then echo -e "# entry added by $0: $date" \ @@ -74,6 +75,22 @@ if [ "x$start_cron" = "xyes" ] ; then fi } +# syslog service +config_syslog () { +if [ "x$start_syslog" = "xyes" ] ; then + if [ -f /mnt/etc/init.d/syslog ] ; then + # how to configure remote log server? + # logging servers might be specified in $log_servers (from e.g. dhcp) + echo -e "# File modified by $0 within initial ramdisk" \ + > /etc/syslog-ng.conf + sed -e "s,.*dhcp/dev.*,," -e "s,.*named/dev.*,," \ + /mnt/etc/syslog-ng/syslog-ng.conf >> /etc/syslog-ng.conf + cp /etc/syslog-ng.conf /mnt/etc/syslog-ng/syslog-ng.conf + rllinker syslog "$1" "$2" + fi +fi +} + # secure shell service config_sshd () { if [ "x$start_sshd" = "xyes" ] ; then @@ -283,11 +300,18 @@ else [server-Standard]\nname=Standard server\ncommand=/usr/X11R6/bin/X\n\ flexible=true\nhandled=true" >>/mnt/etc/opt/gnome/gdm/gdm.conf fi +# start the display manager as early as possible ln -sf /etc/init.d/xdm /mnt/etc/init.d/boot.d/S01boot.xdm ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/S01xdm ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/K20xdm } +# configure gdm as display manager +config_kdm () { +config_dm_entry yes + +} + # consolefont consolefont () { echo -e "setfont ${CONSOLE_FONT} >${LOGFILE} 2>&1" \ @@ -303,3 +327,36 @@ local stop_powersave=`expr $1 - 1` rllinker acpid "$start_acpi" "$stop_acpi" rllinker powersaved "$start_powersave" "$stop_powersave" } + +# configure dbus (inter application communication for kde and gnome), hal +# (hardware abstraction layer - used e.g. by powersaved) and resmgr +# (resource manager - the user gets permissions to devices when loggin on) +config_dreshal () { +local start="$1" +local stop="$2" +if [ "x$start_dreshal" = "xyes" ]; then + if [ -f /mnt/etc/init.d/dbus ] ; then + strinfile "messagebus:" /mnt/etc/passwd || \ + echo "messagebus:x:100:101:User for D-BUS:/var/run/dbus:/bin/false" \ + >> /mnt/etc/passwd + testmkd /mnt/var/run/dbus + # chown 100:101 /mnt/var/run/dbus + rllinker "dbus" "$start" "$stop" + fi + if [ -f /mnt/etc/init.d/resmgr ] ; then + testmkd /mnt/var/run/resmgr/classes + start="0"`expr $start + 1` + stop="0"`expr $start - 1` + rllinker "resmgr" "$start" "$stop" + fi + if [ -f /mnt/etc/init.d/haldaemon ] ; then + strinfile "haldaemon:" /mnt/etc/passwd || \ + echo "haldaemon:x:101:102:User for haldaemon:/var/run/hal:/bin/false" \ + >> /mnt/etc/passwd + start="0"`expr $start + 1` + stop="0"`expr $start - 1` + rllinker "haldaemon" "$start" "$stop" + fi +fi +} + 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 <dirk@goe.net>, 17-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 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 <dirk@goe.net>, 08-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 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 diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 65f941da..d1bf2e8d 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -277,6 +277,7 @@ case "${DISTRO}.${DISVER}" in DISTRO=suse-10.0 # hotplug/udev style and stuff cp -a /etc/udev /etc/hotplug ${INSTDIR}/etc + cp -a /etc/sysconfig/hardware ${INSTDIR}/etc/sysconfig ;; Debian*|debian*|Sarge*|sarge*) DISTRO=debian @@ -294,7 +295,10 @@ cp -a distro-specs/${DISTRO}/files ${INSTDIR}/etc/sysconfig #if no klibc for bbins in ash bash sh; do if cobi ${bbins} bin ; then - LRCSH=/bin/${bbins}; ln -fs /bin/${bbins} ${INSTDIR}/bin/sh; break + LRCSH=/bin/${bbins} + ln -fs /bin/${bbins} ${INSTDIR}/bin/sh + [ "${bbins}" != "bash" ] && ln -fs /bin/${bbins} ${INSTDIR}/bin/bash + break else echo "Binary not found (${bbins})"; fi done |