diff options
author | Dirk von Suchodoletz | 2006-03-27 01:22:18 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-03-27 01:22:18 +0200 |
commit | 2c8289173525442e353a713795b44d55368fbc8f (patch) | |
tree | a710765d7ab9e78e4b26564b515f6359faca4dd9 /initrd | |
parent | ensured "ash" compatibility, minor fixes and cleanups, ... (diff) | |
download | core-2c8289173525442e353a713795b44d55368fbc8f.tar.gz core-2c8289173525442e353a713795b44d55368fbc8f.tar.xz core-2c8289173525442e353a713795b44d55368fbc8f.zip |
fixed ugly bug with ldd library detection, fixed bug for dhcpcd use,
started to integrate gentoo, minor fixes ...
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@129 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd')
-rw-r--r-- | initrd/distro-specs/gentoo/config-2005.1 | 2 | ||||
-rw-r--r-- | initrd/distro-specs/gentoo/functions-2005.1 | 52 | ||||
-rw-r--r-- | initrd/distro-specs/suse/functions-9.3 | 12 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/dhcpmkconfig | 33 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/hwautocfg | 57 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 98 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 6 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/machine-setup | 102 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 27 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 40 |
10 files changed, 199 insertions, 230 deletions
diff --git a/initrd/distro-specs/gentoo/config-2005.1 b/initrd/distro-specs/gentoo/config-2005.1 index 5a544e30..1e47f8ee 100644 --- a/initrd/distro-specs/gentoo/config-2005.1 +++ b/initrd/distro-specs/gentoo/config-2005.1 @@ -39,7 +39,7 @@ D_BINDMNT="# spielspass fuer splash" D_INITDIR="/init.d" D_INITBOOTD="/runlevels/boot" D_RCDIRS="/runlevels/default /runlevels/nonetwork /runlevels/single" -D_INITSCRIPTS="bootmisc clock modules urandom" +D_INITSCRIPTS="bootmisc clock urandom consolefont keymaps" D_XF86CONFFILE="/etc/X11/xorg.conf" D_XFONTPATH="/usr/share/fonts/*" D_DEFAULTCOUNTRY="de" diff --git a/initrd/distro-specs/gentoo/functions-2005.1 b/initrd/distro-specs/gentoo/functions-2005.1 index 6fa20cdd..ddc70fc9 100644 --- a/initrd/distro-specs/gentoo/functions-2005.1 +++ b/initrd/distro-specs/gentoo/functions-2005.1 @@ -1,36 +1,58 @@ +# Description: configuration script for Ubuntu V5.10 to configure +# linux diskless clients (executed within initial +# ramdisk after genconfig) +# +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 26-03-2006 +# +# Copyright: (c) 2006 - RZ Universitaet Freiburg +# +# Version: 0.0.1c + +# distro specific stuff to initialize +preinit () { + : +} + +postinit () { + : +} + # udev service - not checked! udev_hotplug () { -local result=0 echo "Starting udev" -udevstart || result=1 +ln -s /bin/udevd /bin/udevstart && udevstart & if [ -x /bin/udevd ] ; then export UDEVD_EXPECTED_SEQNUM=$(cat /sys/kernel/hotplug_seqnum) export UDEVD_EVENT_TIMEOUT=1 echo "" > /proc/sys/kernel/hotplug - udevd --daemon || result=1 + udevd & else error " udev daemon is not available. Some devices might not \ apprear." nonfatal fi -return $result } # initialize boot.ld - skript to be executed during early system startup # (before most of the normal boot init scripts) # this script should operate like a normal runlevel script -d_mkbootld () { -case "$1" in +# initialize boot.ld - skript to be executed during early system startup +# (before most of the normal boot init scripts) +# this script should operate like a normal runlevel script (fixme!!) +d_mkrlscript () { +local switch="$1" +local name="$2" +local info="$3" +case "$switch" in init) - echo -e "#!/sbin/runskript\n# skeleton of /etc/${D_INITDIR}/boot.ld \ -written from $0" >/mnt/etc/${D_INITDIR}/boot.ld - echo -e '\n\nstart() {' \ - >>/mnt/etc/${D_INITDIR}/boot.ld - echo -e '\tebegin "Running post configuration required by initrd"' \ - >>/mnt/etc/${D_INITDIR}/boot.ld - chmod u+x /mnt/etc/${D_INITDIR}/boot.ld + echo -e "#!/sbin/runskript\n# skeleton of /etc/${D_INITDIR}/$name \ +generated by $0" >/mnt/etc/${D_INITDIR}/$name + echo -e "\n\nstart() {\tebegin \"$info\"" \ + >>/mnt/etc/${D_INITDIR}/$name + chmod u+x /mnt/etc/${D_INITDIR}/$name ;; close) - echo -e "\teend ${?}\n}" \ - >>/mnt/etc/${D_INITDIR}/boot.ld + echo -e "\t;;\n stop)\n\t;;\nesac\nexit 0" \ + >>/mnt/etc/${D_INITDIR}/$name ;; esac } + diff --git a/initrd/distro-specs/suse/functions-9.3 b/initrd/distro-specs/suse/functions-9.3 index fbd74586..bd988d52 100644 --- a/initrd/distro-specs/suse/functions-9.3 +++ b/initrd/distro-specs/suse/functions-9.3 @@ -58,8 +58,8 @@ if [ -f /mnt/etc/init.d/ntp ] ; then fi testmkd /mnt/var/lib/ntp/var/run/ntp &>/dev/null if [ "x$start_ntp" = "xinitial" ] ; then - echo -e "\t# entry added by $0: $date\n\t( ntpdate -s -b $ntp_servers\ - >${LOGFILE} 2>&1 && \\n\t which hwclock &>/dev/null && hwclock -w ) &" \ + echo -e "\t# entries added by $0: $date\n\t( ntpdate -s -b $ntp_servers\ + >${LOGFILE} 2>&1 && {\n\t which hwclock &>/dev/null && hwclock -w;} ) &" \ >>/mnt/etc/${D_INITDIR}/boot.ld elif [ "x$start_ntp" = "xyes" ] ; then rllinker "ntp" "$start" "$stop" @@ -145,8 +145,8 @@ cp /etc/displaymanager /mnt/etc/sysconfig/displaymanager # started twice during bootup - quickhack ... #ln -sf /etc/${D_INITDIR}/xdm /mnt/etc/${D_INITDIR}/rc5.d/S01xdm ln -sf ../xdm /mnt/etc/${D_INITDIR}/rc5.d/K20xdm -echo -e "\t/etc/init.d/xdm start >${LOGFILE} 2>&1\n\t( sleep 60; \ -ln -sf ../xdm /etc/${D_INITDIR}/rc5.d/S01xdm \ +echo -e "\t/etc/init.d/xdm start >${LOGFILE} 2>&1\n\ +\t( sleep 120; ln -sf ../xdm /etc/${D_INITDIR}/rc5.d/S01xdm \ >${LOGFILE} 2>&1) &\n" >>/mnt/etc/${D_INITDIR}/boot.ld } @@ -416,8 +416,8 @@ local name="$2" local info="$3" case "$1" in init) - echo -e "#!/bin/sh\n# skeleton of /etc/${D_INITDIR}/$name written \ -from $0\n. /etc/rc.status\n. /etc/sysconfig/logfile\nrc_reset\ncase \ + echo -e "#!/bin/sh\n# skeleton of /etc/${D_INITDIR}/$name created \ +by $0\n. /etc/rc.status\n. /etc/sysconfig/logfile\nrc_reset\ncase \ \"\$1\" in\n start)\n\techo -n \"$info\"" >>/mnt/etc/${D_INITDIR}/$name chmod u+x /mnt/etc/${D_INITDIR}/$name ;; diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig index b7dd3cbd..b6c436a6 100755 --- a/initrd/initrd-stuff/bin/dhcpmkconfig +++ b/initrd/initrd-stuff/bin/dhcpmkconfig @@ -4,39 +4,32 @@ # several dhcp clients. The result is written in unified form # to the /etc/machine-setup file # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 18-01-2006 -# Blabla -# Blub +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 26-03-2006 # # Copyright: (c) 2006 - RZ Universitaet Freiburg -# functions common for all distros -. /etc/functions - # client variable should be exported via calling function echo -e "\n# ip configuration written by $0" \ >>/etc/machine-setup case $0 in - *dhcpd*) - 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," \ - -e "s,ROOTPATH,root_path," -e "s,DNS,domain_name_servers," \ - -e "s,NTPSERVERS,ntp_servers," -e "s,DHCPSID,serverip," \ + *dhcpcd*) + sed -e "s,',\",g;s,IPADDR,clientip,;s,NETMASK,subnet_mask," \ + -e "s,GATEWAY,gateway,;s,BROADCAST,broadcast_address," \ + -e "s,HOSTNAME,host_name,;s,DOMAIN,domain_name," \ + -e "s,ROOTPATH,root_path,;s,DNS,domain_name_servers," \ + -e "s,NTPSERVERS,ntp_servers,;s,DHCPSID,serverip," \ -e "s,WINSSERVERS,netbios_name_servers," \ -e "s,NETWORK,network," \ - -e "s,DHCP..ADDR.*,," -e "s,.*TIME=.*,," -e "s,CL.*,," \ - -e "s,INTER.*,," -e "s,DHCPSNAME.*,," \ + -e "s,DHCP..ADDR.*,,;s,.*TIME=.*,,;s,CL.*,,;/^$/d" \ + -e "s,INTER.*,,;s,DHCPSNAME.*,," /var/lib/dhcp/dhcpcd-eth0.info \ >>/etc/machine-setup ;; *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,ip_address,clientip," \ + -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 ;; *pump*) diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg index bc9ffd11..cfd2c74a 100755 --- a/initrd/initrd-stuff/bin/hwautocfg +++ b/initrd/initrd-stuff/bin/hwautocfg @@ -240,14 +240,6 @@ pci/agp bus needed for acceleration." ; } esac echo -e "EndSection\n" >>$xfc done -# only if X is link itself (normally to /var/X11R6/bin/X) check!! -link=`ls -l /mnt/usr/X11R6/bin/X 2>/dev/null` -if strinstr "/var/X11R6" "$link" ; then - testmkd /mnt/var/X11R6/bin - for i in /usr/X11R6/bin/Xorg /usr/X11R6/bin/XFree86 ; do - [ -e "/mnt/$i" ] && { ln -sf $i /mnt/var/X11R6/bin/X; break; } - done -fi } ####################################################################### @@ -412,12 +404,31 @@ data via dhcp until now ..." nonfatal waitfor /tmp/ldap-done 10000 || error " Did not get any configuration \ data via ldap until now ..." nonfatal . /etc/machine-setup + +# postpone some commands into normal bootup environment +echo -e "\t# entries added by $0: $date" >> /etc/boot.ld +# run localizator and configure keyboard and console fonts +DEFKEYTABLE="de-latin1-nodeadkeys" +localization $country +if [ -z "${KEYTABLE}" ] ; then + msg "Keyboard setup" "No settings found for keyboard, using default of \ +'${DEFKEYTABLE}' defined\nin $0." + KEYTABLE=${DEFKEYTABLE} +fi +echo -e "\tloadkeys -q ${KEYTABLE}" >> /etc/boot.ld + +# run X11 / Xorg configurator +. /etc/sysconfig/xserver >/dev/null 2>&1 || error " The xserver \ +configuration file generated by hwsetup could not\n be found." nonfatal +( displaysetup /etc/xorg.conf; echo "ready" > /tmp/xready ) & + # wait for completion of clients root filesystem in /mnt waitfor /tmp/fscmpl 40000 -# postpone some commands into normal bootup environment -echo -e "\t# entry added by $0: $date" \ - >>/mnt/etc/${D_INITDIR}/boot.ld +# add entries to boot.ld +cat /etc/boot.ld >> /mnt/etc/${D_INITDIR}/boot.ld +[ -n "${CONSOLE_FONT}" ] && consolefont + # get idea of availabe harddisk partitions, put swap partitions into # (/mnt)/etc/fstab and format and mount partitions of type 44 (unknown) for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ @@ -448,19 +459,17 @@ done # determine if tmp preparation should wait for format/mount or not [ -z "$part44" ] && echo "finished" > /tmp/tmpready -# run localizator and configure keyboard and console fonts -DEFKEYTABLE="de-latin1-nodeadkeys" -localization $country -if [ -z "${KEYTABLE}" ] ; then - msg "Keyboard setup" "No settings found for keyboard, using default of \ -'${DEFKEYTABLE}' defined\nin $0." - KEYTABLE=${DEFKEYTABLE} +# finalize X configuration +# only if X is link itself (normally to /var/X11R6/bin/X) check!! +link=`ls -l /mnt/usr/X11R6/bin/X 2>/dev/null` +if strinstr "/var/X11R6" "$link" ; then + testmkd /mnt/var/X11R6/bin + for i in /usr/X11R6/bin/Xorg /usr/X11R6/bin/XFree86 ; do + [ -e "/mnt/$i" ] && { ln -sf $i /mnt/var/X11R6/bin/X; break; } + done fi -echo -e "\tloadkeys -q ${KEYTABLE}\n" >>/mnt/etc/${D_INITDIR}/boot.ld -[ -n "${CONSOLE_FONT}" ] && consolefont -# run X11 / Xorg configurator -. /etc/sysconfig/xserver >/dev/null 2>&1 || error " The xserver \ -configuration file generated by hwsetup could not\n be found." nonfatal -displaysetup ${D_XF86CONFFILE} +# wait for completion of Xorg configuration +waitfor /tmp/xready 1000 +cp /etc/xorg.conf ${D_XF86CONFFILE} echo "finished" > /tmp/hwcfg diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index 2be55ba7..5799e5f7 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -116,9 +116,28 @@ case ${DISTRO} in done ;; gentoo*) + rm /mnt/etc/*/.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/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 @@ -204,7 +223,7 @@ if [ "x$vmware" != "x" ] || [ "x$vmware" != "xno" ] ; then ${imgsrv} /mnt/var/lib/vmware & fi # generate a runlevel script - d_mkrlscript init vmware-prep 'Starting preparation of vmware environment' + d_mkrlscript init vmware-prep "Starting preparation of vmware environment" sed "s,^#.*,,;/^$/d;s,^,\t," /etc/vmware-prep >> \ /mnt/etc/${D_INITDIR}/vmware-prep d_mkrlscript close vmware-prep "" @@ -217,6 +236,39 @@ if [ "x$vmware" != "x" ] || [ "x$vmware" != "xno" ] ; then 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 + +####################################################################### +# name service caching daemon if networked user database +config_nscd + +####################################################################### +# preparation of /tmp directory (partition 44, nfs scratch, ramdisk) +waitfor /tmp/tmpready 10000 +# create some directories and correct permissions +tmpisdisk=`sed -n '/\/tmp/p' /mnt/etc/fstab` +# if there is no local disk partition for /tmp then try to mount a rw +# NFS scratch space (if defined in $scratch) and prepared on server +if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then + mkdir -p /tmp/scratch >/dev/null 2>&1 + mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid ${scratch} \ + /tmp/scratch >/dev/null 2>&1 && { + mkdir -p /tmp/scratch/${clientip} >/dev/null 2>&1 + umount /tmp/scratch + mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid \ + ${scratch}/${clientip} /mnt/tmp >/dev/null 2>&1; } +fi +chmod 1777 /mnt/tmp + +####################################################################### # X11/GUI stuff if [ "x$start_x" != "xno" ] ; then # creating directories commonly needed for X11 in all distros @@ -225,7 +277,11 @@ if [ "x$start_x" != "xno" ] ; then /etc/X11/xdm \ /etc/X11/sessions \ /var/X11R6/bin \ - /var/run/xdmctl; do testmkd /mnt/$i; done + /var/run/xdmctl \ + /tmp/.ICE-unix \ + /tmp/.X11-unix ; do testmkd /mnt/$i; done + chmod a+rwxt /mnt/tmp/.ICE-unix + chmod a+rwxt /mnt/tmp/.X11-unix echo "" > /mnt/etc/X11/xdm/Xservers # define additional sessions offered to the user (via dhcp/ldap config) # descsession -> deprecated by new vmware integration concept @@ -333,43 +389,5 @@ DisplayManager.*.reset:\t\t/etc/X11/xdm/Xreset" >/mnt/etc/X11/xdm/xdm-config 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 - -####################################################################### -# name service caching daemon if networked user database -config_nscd - -####################################################################### -# preparation of /tmp directory (partition 44, nfs scratch, ramdisk) -waitfor /tmp/tmpready 10000 -# create some directories and correct permissions -tmpisdisk=`sed -n '/\/tmp/p' /mnt/etc/fstab` -# if there is no local disk partition for /tmp then try to mount a rw -# NFS scratch space (if defined in $scratch) and prepared on server -if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then - mkdir -p /tmp/scratch >/dev/null 2>&1 - mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid ${scratch} \ - /tmp/scratch >/dev/null 2>&1 && { - mkdir -p /tmp/scratch/${clientip} >/dev/null 2>&1 - umount /tmp/scratch - mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid \ - ${scratch}/${clientip} /mnt/tmp >/dev/null 2>&1; } -fi -chmod 1777 /mnt/tmp -for i in \ - /tmp/.ICE-unix \ - /tmp/.X11-unix; do testmkd /mnt/$i; done -chmod a+rwxt /mnt/tmp/.ICE-unix -chmod a+rwxt /mnt/tmp/.X11-unix - # servconfig finished successfully echo "finished" > /tmp/svcfg diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 65a811ca..0dc48254 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -237,8 +237,8 @@ case $dhcp in error " Fatal error occured while trying to run dhclient.\n$commonerr" ;; dhcpcd) - ln -s /bin/dhcpmkconfig /bin/dhcpd.exe - dhcpcd -L /var/lib/dhcp -c /bin/dhcpd.exe -T -t 30 eth0 2>&1 >/dev/null || \ + ln -s /bin/dhcpmkconfig /bin/dhcpcd.exe + dhcpcd -L /var/lib/dhcp -c /bin/dhcpcd.exe -T -t 30 eth0 2>&1 >/dev/null || \ error " Fatal error occured while trying to run dhcpcd.\n$commonerr" ;; pump) @@ -390,7 +390,7 @@ sed -n -e '/nobody/p' /mnt/etc/passwd >> /tmp/newpasswd cp /tmp/newpasswd /mnt/etc/passwd # create the shadow from passwd file echo -e "root:"$root_pw":12958:0:10000::::" > /mnt/etc/shadow -sed 's/:.*/:!:13078:0:99999:7:::/' /tmp/newpasswd >> /mnt/etc/shadow +sed 's/:.*/:!:13078:0:99999:7:::/;/^root.*/d' /tmp/newpasswd >> /mnt/etc/shadow } ####################################################################### diff --git a/initrd/initrd-stuff/etc/machine-setup b/initrd/initrd-stuff/etc/machine-setup deleted file mode 100644 index 24e754c5..00000000 --- a/initrd/initrd-stuff/etc/machine-setup +++ /dev/null @@ -1,102 +0,0 @@ -# machine-setup -# Description: universal (distro independent) configuration file for -# linux diskless clients v4.0. It defines default values -# for several configuration variables. These settings might -# be overwritten through various processes in initial ramdisk. -# New settings are simply appended, so that they might -# overwrite previously defined variables -# -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 09-03-2006 -# Blabla -# Blub -# -# Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg -# -## format variable="static_value" or variable="$serverip:123" ## -## it is possible to use the variables $serverip (the IP of the ## -## providing DHCP server - not neccessarily NFS server), $clientip ## -## (the IP of the client itself) and $host_name ## -# -# -# password of system administrator (root) as crypt -> 'dxs-root' -root_pw='$2a$10$MoEYhIPZGCtR62R8UvBl3emNn2qMOuQpLQpfmNnhya4bGLhyF0pbu' - -## name service configuration defaults -# -# host and domain name -host_name="dxs" -domain_name="test.ldc" - -# define country for all localization stuff - see functions how country -# is translated to LANGUAGE, COUNTRY, LANG, KEYTABLE, XKEYBOARD, -# KDEKEYBOARD, CHARSET, KDEKEYBOARDS, TZ and CONSOLEFONT -country="de" - -## set some default variables -# -# enable setup of TeX environment -tex_enable="no" - -## services to start (yes) or configure (may) or disable (no) -# -# network time protocol daemon ("yes" for normal daemon operation, -# "initial" just for setting during startup with ntpdate) -start_ntp="initial" -# set timezone if not to be derived from language setting -# timezone="Europe/Berlin" - -# start sshd (hostkeys should be pregenerated by install script) -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" - -# start at daemon -start_atd="no" - -# simple network management protocol for system monitoring -start_snmp="no" - -# 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" - -# start ssh server -start_sshd="yes" - -# AFS network filesystem -start_afs="no" -this_cell="uni-freiburg.de" -cell_server="132.230.6.237 132.230.6.236 132.230.6.235" - -# smb protocol service (provide windows file service) -start_samba="may" -netbios_workgroup="dxs-network" - -# automounter home (/local_dir - top level directories only) and source -# (server:/path) -automnt_dir="/home" -automnt_src="$serverip:/home" - -# scratch space on server -scratch="$serverip:/dxs/tmp" - -# configure and start vmware services -vmware="no" -imgsrv="$serverip:/dxs/vmware" - -# kind of X11 display manager to run -start_xdmcp="xdm" - -# should Xorg/XFree server be started or some special windowmanager be run -# in kiosk mode e.g. start_x="kde" -start_x="yes" diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 7ac6c087..f0882aea 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -164,6 +164,7 @@ if [ "${DEBUGLEVEL}" -gt 0 ] ; then # if LOGFILE should be used within initial ramdisk add '/mnt' in front # of the variable LOGFILE="/var/log/dxs-boot.log" + echo "1 4 1 7" >/proc/sys/kernel/printk [ "${DEBUGLEVEL}" -eq 2 ] && MODPRV="-v" [ "${DEBUGLEVEL}" -gt 2 ] && { set -x @@ -223,17 +224,18 @@ if [ -n "${NBD}" ] ; then nbdhost=${NBDOPT%:*} nbdopt=${NBDOPT#*:} nbdport=${nbdopt%,*} - nbdfs=${nbdopt#*,} - echo "Diskless client using ${NBD} on $nbdhost:$nbdport with $nbdfs" + nbdfs=${nbdopt#$nbdport*} if [ -z "$nbdfs" ]; then RFST=ext2; else - RFST=$nbdfs; - # fixme: check for fs in /proc/filesystems before trying to load the module - modprobe ${MODPRV} ${RFST} || error " Failed to load the requested \ -filesystem module for the client root\n filesystem ontop of the (D)NBD." \ - nonfatal + RFST=${nbdfs#*,}; fi + echo "Diskless client using ${NBD} on $nbdhost:$nbdport with $RFST" + # fixme: check for fs in /proc/filesystems before trying to load the module + modprobe ${MODPRV} ${RFST} || error " Failed to load the requested \ +filesystem module for the client root\n filesystem ontop of the (D)NBD." \ + nonfatal + errmsg=" For some reason the network block device /dev/${NBD}0 never \ appeared.\n You might want to check udev or your list of static device \ files." @@ -259,11 +261,11 @@ the network block device client. Unable to mount root\n filesystem." while ! dnbd-client -b $nbdhost -d /dev/dnbd0 $clientopt ; do usleep 10 done - echo $? + #echo $? RDEV=/dev/dnbd0 - usleep 20 - ;; + ;; esac + usleep 20 mount -n -t $RFST -o ro $RDEV /mnt fi # if no type of root filesystem is passed via kernel command line try @@ -361,14 +363,13 @@ else mount -n --bind ${RWDIR}/var /mnt/var # get the "covered" mounts back into filesystem structure for i in ${LIST}; do - #rm -rf /* >/dev/null 2>&1 mount -n --move /root/$i /mnt/$i #>>$LOGFILE 2>&1 done - rm -rf /root/* >/dev/null 2>&1 + #rm -rf /root/* >/dev/null 2>&1 # run some specific stuff !? fi # script for stuff to execute during early bootup -d_mkrlscript init boot.ld "Running post configuration required by init" +d_mkrlscript init boot.ld "Running configuration postponed from InitRD" echo "fs complete" >/tmp/fscmpl # write debug file information after filesystem setup completed diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 430dd79d..e8c44915 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -5,7 +5,6 @@ # # Author(s): Dirk von Suchodoletz <dirk@goe.net>, 24-03-2006 # Nico Dietrich -# Blub # # Version: 0.3.1e # @@ -93,6 +92,8 @@ elif [ -L ${FPTB} ] ; then else cp ${FPTB} ${INSTDIR}/${DEST} fi +# get an idea which libraries are needed +chroot ${ROOTDIR} ldd.server ${FPTB#${ROOTDIR}*} >> ${INSTDIR}/tmp/libraries } # replace copy @@ -114,7 +115,7 @@ else -e "s,@@@NWMODULES@@@,${NWMODULES},g" \ -e "s,@@@COMDIRINDXS@@@,${COMDIRINDXS},g" \ -e "s,@@@COMETCEXCL@@@,${COMETCEXCL},g" \ - -e "/^# .*/d" \ + -e "/^#[^!].*/d" \ initrd-stuff/${FILENAME} >> ${INSTDIR}/${FILENAME} fi fi @@ -215,6 +216,9 @@ mkdir -p ${INSTDIR}/usr/share # needed for KNOPPIX hwsetup not to confuse with ${D_SYSCONFDIR} mkdir -p ${INSTDIR}/etc/sysconfig +# temporary ldd for getting library information out of initrd binaries +cp `which ldd` ${ROOTDIR}/usr/bin/ldd.server + # if still no distro name set, try to find it using significant files if [ -z "${DISTRO}" ] ; then if [ -e ${ROOTDIR}/etc/SuSE-release ] ; then @@ -227,9 +231,13 @@ if [ -z "${DISTRO}" ] ; then elif [ -e ${ROOTDIR}/etc/debian_version ] ; then DISTRO=debian DISTRO_VER=`cat ${ROOTDIR}/etc/debian_version` + elif [ -e ${ROOTDIR}/etc/gentoo-release ] ; then + DISTRO=gentoo + # any idea on the versioning scheme?? + DISTRO_VER="" else - echo "Could not detect client distribution type and version. Please \ -specify\nas command line argument (-d <distro-name> -v <distro-version)" + echo -e "Could not detect client distribution type and version. Please \ +specify\nas command line argument (-d <distro-name> -v <distro-version>)" exit 1; fi fi @@ -368,14 +376,17 @@ case "${DISTRO}" in cp ${ROOTDIR}/lib/libnss_compat.so.2 ${INSTDIR}/lib;; esac -# add needed libraries depending on choosen binaries -for lib in `ldd /tmp/dxs-instrd/bin/* 2>/dev/null | \ +# add needed libraries depending on choosen binaries. use chroot +# on ldd, otherwise the detection does not work properly. ldd has to be +# static linked binary +for lib in `cat ${INSTDIR}/tmp/libraries 2>/dev/null | \ sed -e "s,tls,,;s,i686/cmov,," \ -ne 's:\t\(.* => \)\?\(/.*\) (0x[0-9a-f]*):\2:p' | sort -u` ; do baselib=`basename ${lib}` test -e ${INSTDIR}/lib/${baselib} || \ cp /${ROOTDIR}/${lib} ${INSTDIR}/lib done +rm ${ROOTDIR}/usr/bin/ldd.server ${INSTDIR}/tmp/libraries # add kernel modules and dependency files if [ -z "$KERNVER" ] ; then @@ -439,6 +450,11 @@ for module in af_packet unix ${NWMODULES} ${FSMODULES} ${DEBUGMODULES}; do cp ${rdirprefix}/fs/nfs_common/nfs_acl.ko \ ${ddirprefix}/fs/nfs_common &>/dev/null ;; + ext3) + mkdir -p ${ddirprefix}/fs/jbd + cp ${rdirprefix}/fs/jbd/jbd.ko \ + ${ddirprefix}/fs/jbd + ;; esac fi done @@ -453,6 +469,18 @@ done chmod 755 ${INSTDIR}/init \ ${INSTDIR}/bin/{servconfig,hwautocfg,screenres,dhcpmkconfig} +# finally add the common client configuration file +if [ -f /etc/dxs/client.cfg/machine-setup.default ] ; then + cp /etc/dxs/client.cfg/machine-setup.default \ + ${INSTDIR}/etc/machine-setup +elif [ -f ../installer/default_files/machine-setup_default ] ; then + cp ../installer/default_files/machine-setup_default \ + ${INSTDIR}/etc/machine-setup +else + echo -e "# default for machine-setup does not exist\nroot logins are \ +disabled\nroot_pw='!'" > ${INSTDIR}/etc/machine-setup +fi + ######################################################################### # End of file copy procedures |