summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/bin
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-03-27 01:22:18 +0200
committerDirk von Suchodoletz2006-03-27 01:22:18 +0200
commit2c8289173525442e353a713795b44d55368fbc8f (patch)
treea710765d7ab9e78e4b26564b515f6359faca4dd9 /initrd/initrd-stuff/bin
parentensured "ash" compatibility, minor fixes and cleanups, ... (diff)
downloadcore-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/initrd-stuff/bin')
-rwxr-xr-xinitrd/initrd-stuff/bin/dhcpmkconfig33
-rwxr-xr-xinitrd/initrd-stuff/bin/hwautocfg57
-rwxr-xr-xinitrd/initrd-stuff/bin/servconfig98
3 files changed, 104 insertions, 84 deletions
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