summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/bin
diff options
context:
space:
mode:
authorNico Dietrich2006-01-12 18:44:55 +0100
committerNico Dietrich2006-01-12 18:44:55 +0100
commit6e7ef11152c910101d66d10b418d1b27f566ec3a (patch)
treead5e4b53e28ddf8bb8b5015b60e9f3f41a8783f3 /initrd/initrd-stuff/bin
downloadcore-6e7ef11152c910101d66d10b418d1b27f566ec3a.tar.gz
core-6e7ef11152c910101d66d10b418d1b27f566ec3a.tar.xz
core-6e7ef11152c910101d66d10b418d1b27f566ec3a.zip
Ersteinstellung von ld v4 ins SVN
git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@11 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/initrd-stuff/bin')
-rw-r--r--initrd/initrd-stuff/bin/.hwautocfg.swpbin0 -> 32768 bytes
-rwxr-xr-xinitrd/initrd-stuff/bin/ddcprobebin0 -> 28376 bytes
-rwxr-xr-xinitrd/initrd-stuff/bin/dhcpmkconfig41
-rwxr-xr-xinitrd/initrd-stuff/bin/hwautocfg371
-rwxr-xr-xinitrd/initrd-stuff/bin/hwsetupbin0 -> 123832 bytes
-rwxr-xr-xinitrd/initrd-stuff/bin/servconfig260
6 files changed, 672 insertions, 0 deletions
diff --git a/initrd/initrd-stuff/bin/.hwautocfg.swp b/initrd/initrd-stuff/bin/.hwautocfg.swp
new file mode 100644
index 00000000..2a4776d5
--- /dev/null
+++ b/initrd/initrd-stuff/bin/.hwautocfg.swp
Binary files differ
diff --git a/initrd/initrd-stuff/bin/ddcprobe b/initrd/initrd-stuff/bin/ddcprobe
new file mode 100755
index 00000000..132a1671
--- /dev/null
+++ b/initrd/initrd-stuff/bin/ddcprobe
Binary files differ
diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig
new file mode 100755
index 00000000..a7cbda19
--- /dev/null
+++ b/initrd/initrd-stuff/bin/dhcpmkconfig
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Description: universal (distro independent) configuration writer for
+# several dhcp clients
+#
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 07-01-2006
+# Blabla
+# Blub
+#
+# 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 $client in
+ dhcpcd)
+ 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," \
+ -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," \
+ -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.*,," \
+ >>/etc/machine-setup
+ # empty lines should be removed somehow
+ ;;
+ dhclient)
+ set | grep "new_" | 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
+ ;;
+esac
+
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg
new file mode 100755
index 00000000..637ba247
--- /dev/null
+++ b/initrd/initrd-stuff/bin/hwautocfg
@@ -0,0 +1,371 @@
+#!/bin/sh
+#
+# Description: universal (distro independent) hardware autoconfiguration
+# script for linux diskless clients, using hwconfig from
+# knoppix as base tool
+#
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 06-01-2006
+# Blabla
+# Blub
+#
+# Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg
+
+# local functions
+displaysetup () {
+local xfc=$1
+# define some defaults
+local HSYNCRANGE="31.5-63.5"
+local VSYNCRANGE="60-90"
+local MAXRES="1024x768"
+local DEFAULTCOLORDPT=24
+# set variables representing the xorg.conf sections (version 6.8.x)
+local Module='\tLoad\t\t"dbe"\n
+\tLoad\t\t"extmod"\n
+\tLoad\t\t"type1"\n
+\tLoad\t\t"speedo"\n
+\tLoad\t\t"freetype"\n
+\tLoad\t\t"v4l"'
+local ServerFlags='\tOption\t\t"AllowMouseOpenFail"\n
+\tOption\t\t"blank time"\t\t"5"\n
+\tOption\t\t"standby time"\t\t"10"\n
+\tOption\t\t"suspend time"\t\t"15"\n
+\tOption\t\t"off time"\t\t"20"'
+local Files='\tRgbPath\t\t"/usr/X11R6/lib/X11/rgb"\n
+\tModulePath\t"/etc/X11/modules"\n
+\tModulePath\t"/usr/X11R6/lib/modules"\n
+\tFontPath\t"/usr/X11R6/lib/X11/fonts/misc/:unscaled"\n
+\tFontPath\t"/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"\n
+\tFontPath\t"/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"'
+local InputDevice='\tIdentifier\t"Keyboard1"\n
+\tDriver\t\t"keyboard"\n
+\tOption\t\t"XkbRules"\t\t"xfree86"\n
+\tOption\t\t"XkbLayout"\t\t"XKEYBOARD"\n
+\tOption\t\t"XkbModel"\t\t"pc105"'
+local InputMouseDef='\tIdentifier "Mouse1"\n
+\tDriver\t\t"mouse"\n
+\tOption\t\t"Protocol"\t\t"imps/2"\n
+\tOption\t\t"Device"\t\t"/dev/input/mice"\n
+\tOption\t\t"Emulate3Buttons"\n
+\tOption\t\t"ZAxisMapping"\t\t"4 5"\n
+\tOption\t\t"Buttons"\t\t"3"'
+local Monitor='\tIdentifier "Default"\n
+\tModelName\t"MODEL"\n
+\tOption\t"CalcAlgorithm"\t"CheckDesktopGeometry"\n
+\tHorizSync\tHS\n
+\tVertRefresh\tVS\n
+\tUseModes\t"Default"\n
+\tOption\t"DPMS"\t"true"'
+local Modes='\tIdentifier "Default"'
+local Modelines='
+\t# crt modelines (refreshrates should be above 72Hz or enable uncommented lines)\n
+\tModeline "640x400" 25.175 640 664 760 800 400 409 411 450\n
+\tModeline "640x400" 31.5 640 672 736 832 400 401 404 445\n
+\tModeline "640x480" 31.50 640 680 720 864 480 488 491 521\n
+\tModeline "640x480" 45.80 640 672 768 864 480 488 494 530\n
+\tModeline "800x600" 50.00 800 856 976 1040 600 637 643 666\n
+\tModeline "800x600" 69.65 800 864 928 1088 600 604 610 640\n
+\t#Modeline "1024x768" 44.90 1024 1048 1208 1264 768 776 784 817 interlace\n
+\tModeline "1024x768" 80.00 1024 1052 1164 1360 768 784 787 823\n
+\tModeline "1024x768" 86.00 1024 1040 1152 1360 768 784 787 823\n
+\tModeline "1024x768" 98.90 1024 1056 1216 1408 768 782 788 822\n
+\tModeline "1024x768" 115.50 1024 1056 1248 1440 768 771 781 802\n
+\tModeline "1152x864" 92.00 1152 1208 1368 1474 864 865 875 895\n
+\tModeline "1152x864" 110.00 1152 1240 1324 1552 864 864 876 908\n
+\tModeline "1280x960" 112.00 1280 1312 1456 1704 960 963 970 1064\n
+\tModeline "1280x960" 142.00 1280 1312 1456 1712 960 963 970 1064\n
+\tModeline "1280x1024" 145.00 1280 1312 1456 1712 1024 1027 1030 1064\n
+\tModeline "1280x1024" 157.50 1280 1344 1504 1728 1024 1025 1028 1072\n
+\tModeline "1400x1050" 180.00 1400 1472 1672 1880 1050 1052 1055 1100\n
+\tModeline "1600x1200" 202.50 1600 1664 1856 2160 1200 1201 1204 1250\n
+\t# tft modlines (refreshrates of 60Hz schould be ok)\n
+\tModeline "lcd1024x768" 67.90 1024 1052 1164 1360 768 784 787 823\n
+\tModeline "lcd1280x1024" 108.00 1280 1328 1440 1688 1024 1025 1028 1066\n
+\tModeline "lcd1400x1050" 160.00 1400 1472 1672 1880 1050 1052 1055 1100'
+local Device='\tIdentifier\t"StdGraphics"\n
+\tVendorName\t\t"XDESC"\n
+\tDriver\t\t"XMODULE"'
+local Screen='\tIdentifier\t"Screen 1"\n
+\tDevice\t"StdGraphics"\n
+\tMonitor\t"Default"\n
+\tDefaultColorDepth CDP'
+local ServerLayout='\tIdentifier\t"Simple Layout"\n
+\tScreen\t"Screen 1"\n
+\tInputDevice "Keyboard1"\t"CoreKeyboard"\n
+\tInputDevice "Mouse1"\t"CorePointer"\n
+\tOption\t"BlankTime"\t"5"\n
+\tOption\t"StandbyTime"\t"10"\n
+\tOption\t"SuspendTime"\t"20"\n
+\tOption\t"OffTime"\t"30"'
+local DRI='\tGroup\t\t"video"\n
+\tMode\t\t0666'
+
+if [ -n "$hw_graphic" ] ; then
+ DRV=${hw_graphic% *}
+ CDP=${hw_graphic##* }
+ msg="Please check your graphic adaptor settings ($hw_graphic)."
+ if [ -z "$DRV" ] ; then error " Manual configuration of your graphic \
+hardware module to set failed.\n $msg" nonfatal
+ XMODULE=DRV
+ else
+ [ -z "${XMODULE}" ] && XMODULE=vesa
+ fi
+fi
+if [ -z "$CDP" ] ; then error " Manual configuration of your graphic \
+systems color depth failed.\n $msg" nonfatal
+ CDP=${DEFAULTCOLORDPT}
+fi
+
+if [ -n "$hw_monitor" ] ; then
+ # just cut all starting from k(Hz) ...
+ HS=${hw_monitor%k*}
+ VS=${hw_monitor%Hz*}
+ [ -z "$VS" ] && VS=${hw_monitor%hz*}
+ VS=${VS##* }
+ MR=${hw_monitor##* }
+ msg="Please check your predefined monitor settings ($hw_monitor): Manual\n\
+ configurtion of display"
+else
+ # gather monitor information automatically
+ ddcprobe > /tmp/ddcprobe
+ msg="Please check the output of ddcprobe. The settings where not \
+complete\n or non existant. The $0 script tried for a fully automatic\n\
+ configuration of display"
+fi
+if [ -z "$HS" ] ; then error " $msg timings requested but could not \
+establish horizontal\n frequency in kHz." nonfatal
+ HS=${HSYNCRANGE}
+fi
+if [ -z "$VS" ] ; then error " $msg timings but could not establish \
+vertical\n frequency in Hz." nonfatal
+ VS=${VSYNCRANGE}
+fi
+if [ -z "$MR" ] ; then error " $msg resolution requested but not \
+established." nonfatal
+ MR=${MAXRES}
+fi
+
+
+monmanual=yes
+
+# compute max resolution
+for res in 640x400 640x480 800x600 1024x768 1280x1024 1400x1050 1600x1200
+ do MODES="\"$res\" \"lcd$res\" $MODES"
+ [ "$res" = "$MR" ] && break
+done
+
+# finally write config file
+echo -e "#\n# autogenerated X hardware configuration by $0\n# \
+Dirk von Suchodoletz <dirk@goe.net>, $date" >$xfc
+echo -e "# DO NOT EDIT THIS FILE BUT '$0' INSTEAD!\n#" \
+ >>$xfc
+for section in Files ServerFlags Module InputDevice Monitor \
+ Modes Screen Device ServerLayout DRI ; do
+ echo "Section \"$section\"" >>$xfc
+ case "$section" in
+ Files)
+ echo -e ${Files} >>$xfc
+ # check for 64bit CPU/installation (fixme!!)
+ [ -n "$amd64" ] && \
+ echo '"\tModulePath\t"/usr/X11R6/lib64/modules"\n' >>$xfc
+ for i in ${XFONTPATH} ; do
+ echo -e "\tFontPath\t\"$i/\"" >>$xfc ; done
+ ;;
+ ServerFlags)
+ echo -e ${ServerFlags} >>$xfc
+ ;;
+ Device)
+ echo -e ${Device} | sed -e "s,XMODULE,${XMODULE},g" \
+ -e "s,XDESC,${XDESC}," >>$xfc
+ # special options may be needed for some drivers
+ [ $DEBUGLEVEL -gt 1 ] && msg "X setup" \
+"adding for some Xfree86 modules \
+(radeon, s3virge, nvidia) special options to\nthe 'Device' section. Consult \
+hwsetup if you like to add more or remove some."
+ [ x$DRV = "xs3virge" ] && {
+ echo -e "\tOption\t\t\"XVideo\" \"Off\"\n" >>$xfc
+ [ $DEBUGLEVEL -gt 1 ] && msg "X setup" \
+"added special option for \
+the s3virge module -> 'XVideo Off'. remove the\nappropriate line in hwsetup \
+if you like not to use it." ; }
+ [ x$DRV = "xnvidia" ] && {
+ echo -e "\tOption\t\t\"NvAGP\" \"3\"" >>$xfc
+ echo -e "\tOption\t\t\"NoLogo\" \"1\"" >>$xfc
+ [ $DEBUGLEVEL -gt 1 ] && msg "X setup" \
+"added special option for \
+the nvidia module -> 'NvAGP '. it sets the use\nof internal or external \
+agpgart support." ; }
+ [ "$busid" ] && {
+ echo -e "\tOption\t\t\"BusID\" \"$busid\"" >>$xfc
+ [ $DEBUGLEVEL -gt 1 ] && msg "X setup" \
+"added special option for \
+the 'BusID' information - it\ndefines the npostion of graphics adaptor in \
+pci/agp bus needed for acceleration." ; }
+ ;;
+ Module)
+ echo -e ${Module} >>$xfc
+ [ x$DRM = "xyes" ] && \
+ echo -e "\tLoad\t\t\"dri\"" >>$xfc
+ [ x$GLX != "xno" ] && \
+ echo -e "\tLoad\t\t\"glx\"" >>$xfc
+ ;;
+ Monitor)
+ echo -e ${Monitor} | \
+ sed -e "s,HS,${HS},g" -e "s,VS,${VS},g" >>$xfc
+ ;;
+ InputDevice)
+ echo -e ${InputDevice} | sed -e "s,XKEYBOARD,${XKEYBOARD},g" \
+ >>$xfc
+ [ "${XKEYBOARD}" = "de" ] && \
+ echo -e '\tOption\t\t"XkbVariant"\t\t"nodeadkeys"' >>$xfc
+ echo -e "EndSection\n\nSection \"$section\"" >>$xfc
+ echo -e $InputMouseDef >>$xfc
+ ;;
+ Modes)
+ echo -e ${Modes} >>$xfc
+ echo -e ${Modelines} >>$xfc
+ ;;
+ Screen)
+ echo -e ${Screen} | sed -e "s,CDP,${CDP}," >>$xfc
+ for BPP in 15 16 24 32
+ do echo -e '\tSubSection "Display"\n\t\tDepth\t'\
+ $BPP'\n\t\tModes\t'$MODES'\n\tEndSubSection' >>$xfc
+ [ $BPP = "$CDP" ] && break
+ done
+ ;;
+ ServerLayout)
+ echo -e ${ServerLayout} >>$xfc
+ ;;
+ 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
+}
+
+#######################################################################
+# script starts here
+
+# functions common for all distros
+. /etc/functions
+# load distro specific configuration variables and functions. distro
+# specific functions may overwrite functions defined in /etc/functions
+. /etc/sysconfig/config
+. /etc/distro-functions
+
+( hwsetup -v > /tmp/hwsetup.info && echo "hwsetup" > /tmp/completed ) &
+
+# ACPI configuration
+#if [ -d /proc/acpi ]; then
+# if ! inkernelcmdline "noacpi" || ! inkernelcmdline "acpi=off"; then
+# echo ACPIbla
+# found=""
+# for acpi in /lib/modules/$KERNEL/kernel/drivers/acpi/*; do
+# acpi=`basename acpi`
+# case "$acpi" in *_acpi)
+# egrep -qi "${basename%%_acpi}" /proc/acpi/dsdt 2>/dev/null || continue ;;
+# esac
+# 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)
+modprobe ${MODPRV} agpgart || \
+ modprobe ${MODPRV} agpgart agp_try_unsupported=1
+
+# wait for /tmp/hwsetup.info to appear
+waitfor /tmp/completed 50000 || \
+ error " Expected information from hwsetup to appear in \
+/tmp/hwsetup.info.\n Unable to configure parts of the systems hardware. \
+Please check that\n hwsetup is properly installed and executable."
+
+# "drivers" (pseudo, placeholder strings, ...) to exclude from loading
+DRIVERLIST="disabled unknown ignore pcspkr synaptics"
+# driver blacklist (real modules which fail to load)
+DRIVERLIST=" "${DRIVERLIST}
+# check for USB, pcmcia and ieee1394 hardware drivers
+for DRIVER in ohci-hcd uhci-hcd ehci-hcd \
+ ohci1394; do
+ strinfile ${DRIVER} /tmp/hwsetup.info && {
+ modprobe ${MODPRV} ${DRIVER}
+ DRIVERLIST="${DRIVERLIST} ${DRIVER}"; }
+done
+for DRIVER in yenta_socket i82365 pd6729 tcic; do
+ strinfile ${DRIVER} /tmp/hwsetup.info && {
+ modprobe ${MODPRV} ${DRIVER}
+ DRIVERLIST="${DRIVERLIST} ${DRIVER}"
+ PCMCIA="yes"; }
+done
+if [ -n "PCMCIA" ] ; then
+ #echo "pcmcia=\"yes\"" > config
+ modprobe ${MODPRV} ds
+fi
+# remove unneeded network card modules
+for DRIVER in ${NWMODULES}; do
+ strinfile ${DRIVER} /tmp/hwsetup.info || {
+ rmmod ${DRIVER}
+ DRIVERLIST="${DRIVERLIST} ${DRIVER}"; }
+done
+
+# sound card setup
+. /etc/sysconfig/sound || DRIVER="snd-dummy"
+modprobe ${MODPRV} ${DRIVER}
+DRIVERLIST="${DRIVERLIST} ${DRIVER}"
+
+# remaining drivers listed in /tmp/hwsetup.info
+cat /tmp/hwsetup.info| while read LINE ; do
+ if strinstr "driver:" "${LINE}"; then
+ DRIVER=${LINE##driver: }
+ if ! strinstr "${DRIVER}" "${DRIVERLIST}"; then
+ strinstr "Card:" "${DRIVER}" || strinstr "ps/2" "${DRIVER}" || {
+ modprobe ${MODPRV} ${DRIVER} &
+ usleep 10; }
+ DRIVERLIST="${DRIVERLIST} ${DRIVER}"
+ fi
+ fi
+done
+
+# configure some variables from configuration file - wait for dhcp or ldap
+# confiurator to complete
+waitfor /tmp/dhcp-done 10000 || error " Did not get any configuration \
+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
+waitfor /tmp/fscmpl 20000
+# 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 "#!/bin/sh\n# entry added by $0: $date" \
+ >>/mnt/etc/${INITDIR}/boot.ld
+echo -e "loadkeys -q ${KEYTABLE}\n" >>/mnt/etc/${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 "/mnt/${XF86CONFFILE}"
+
+echo "finished" > /tmp/hwcfg
+
diff --git a/initrd/initrd-stuff/bin/hwsetup b/initrd/initrd-stuff/bin/hwsetup
new file mode 100755
index 00000000..1b6ab300
--- /dev/null
+++ b/initrd/initrd-stuff/bin/hwsetup
Binary files differ
diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig
new file mode 100755
index 00000000..0fda5df9
--- /dev/null
+++ b/initrd/initrd-stuff/bin/servconfig
@@ -0,0 +1,260 @@
+#!/bin/sh
+#
+# Description: universal (distro independent) configuration script
+# for linux diskless clients (executed within initial
+# ramdisk)
+#
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 08-01-2006
+# Blabla
+# Blub
+#
+# Copyright: (c) 2006 - RZ Universitaet Freiburg
+#
+# Version: 0.0.1b
+
+# check for configuration files to source
+
+# functions common for all distros
+. /etc/functions
+# load distro specific configuration variables and functions. distro
+# specific functions may overwrite functions defined in /etc/functions
+. /etc/sysconfig/config
+. /etc/distro-functions
+# get location of logfile definition
+. /mnt/etc/${SYSCONFDIR}/logfile
+
+#######################################################################
+# copy distro specific scripts, programs, libraries and configs
+cp -a /etc/sysconfig/files/* /mnt &
+
+# set greeting
+echo "
+ WELCOME TO \n (\l)
+ __ __ ___ __ __ __ __ __ __
+ | | | || | || | | || |_| | | |
+ | | | || || | | | / |__|
+ | |___ | || | || |_| | / _ __
+ |______||__||__| |__| _____/ |__| |__| |__|
+
+ Diskless Workstation (v4.0) (c) <dirk@goe.net>
+">/mnt/etc/issue
+
+#######################################################################
+# read and unify configuration options - default configuration file,
+# from dhcp, ldap ...
+# wait for the appearance of configuration via dhcp
+# do not wait if dhcp is not used (how?)
+waitfor /tmp/dhcp-done 10000 || error " Did not get any configuration \
+data via dhcp until now ..." nonfatal
+waitfor /tmp/ldap-done 10000 || error " Did not get any configuration \
+data via dhcp until now ..." nonfatal
+. /etc/machine-setup
+
+#######################################################################
+# set localization
+if [ -z "$country" ] ; then
+ msg "servconfig" "No configuration for localization found in config file. \
+Using default\ncountry setting '${DEFAULTCOUNTRY}' defined in $0."
+ country=${DEFAULTCOUNTRY}
+fi
+localization $country
+
+#######################################################################
+# dns and ip configuration
+# hostname of the machine
+echo "$host_name" >/proc/sys/kernel/hostname
+echo -e "# /etc/hosts - file generated by\n#\t$0:\n#\t$date\
+\n#\n# IP-Address Full-Qualified-Hostname Short-Hostname\n#\n\
+127.0.0.1\tlocalhost\n::1\t\tlocalhost ipv6-localhost ipv6-loopback\n\
+fe00::0\t\tipv6-localnet\nff00::0\t\tipv6-mcastprefix\nff02::1\
+\t\tipv6-allnodes\nff02::2\t\tipv6-allrouters\nff02::3\t\t\
+ipv6-allhosts\n" >/mnt/etc/hosts
+echo -e "$clientip\t$host_name.$domain $host_name\n" >>/mnt/etc/hosts
+
+# set up domainname and resolving
+test -n "$domain_name" && \
+ echo -e "# /etc/resolv.conf - file generated by\n#\t$0:\n\
+#\t$date\n#options timeout:1 attempts:1 rotate\n\
+search "$domain_name >/mnt/etc/resolv.conf
+test -n "$domain_name_servers" && {
+ for nameserver in $domain_name_servers; do
+ echo nameserver $nameserver >>/mnt/etc/resolv.conf;
+ done; }
+
+#######################################################################
+# initial boot scripts
+# delete and create runlevel links for initial booting (SuSE, Debian,
+# ...)
+case ${DISTRO} in
+ suse*|debian*|ubuntu*)
+ for i in ${RCDIRS} ${INITBOOTD} ; do
+ rm -f /mnt/etc/$i/*
+ done
+ count=10
+ for i in ${INITSCRIPTS}; do
+ count=`expr $count + 1`
+ revcnt=`expr 41 - $count`
+ ln -sf /etc${INITDIR}/$i /mnt/etc/init.d/boot.d/S${count}$i
+ ln -sf /etc${INITDIR}/$i /mnt/etc/init.d/boot.d/K${revcnt}$i
+ done
+ ;;
+ gentoo*)
+ ;;
+esac
+
+
+#######################################################################
+#
+# boot.local
+if [ -n "$bootlocal_script" ]; then
+ echo -e "# entries added by $0:\n#\t$date\n\n\
+$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
+config_atd "14" "04"
+
+# configuration of cron services
+[ "x$crontab_entries" != "x" ] && \
+ echo -e "$crontab_entries" >> /mnt/etc/crontab
+config_cron "16" "04"
+
+#######################################################################
+# network(ed) services
+
+# network time service (ntp) configuration file
+if [ -n "$ntp_servers" ]; then
+ echo -e "# /etc/ntp.conf - file generated by $0: \
+$date\n" >/mnt/etc/ntp.conf;
+ for ntpserver in $ntp_servers; do
+ echo server $ntpserver >>/mnt/etc/ntp.conf;
+ done
+fi
+# copy timezone file defined with language settings
+[ -z "$TZ" ] && TZ="$timezone"
+cp /mnt/usr/share/zoneinfo/${TZ} /mnt/etc/localtime 2>/dev/null || \
+ error " No such timezone data file (needed for ntp time service \
+configuration)." nonfatal
+config_ntp 07 14
+
+# secure shell server
+config_sshd 12 10
+
+# simple network management protocol agent
+config_snmp 24 02
+
+#######################################################################
+# X11/GUI stuff
+if [ "x$start_x" != "xno" ] ; then
+ # creating directories commonly needed for X11 in all distros
+ # rest should be done via config_x11 function (distro specific)
+ for i in /var/lib/xkb/ \
+ /etc/X11/xdm \
+ /etc/X11/sessions \
+ /var/X11R6/bin \
+ /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
+ # write available X display manager to /etc/X11/xdm/Xaccess
+ [ -n "$x_display_manager" ] && \
+ echo -e "# /etc/X11/xdm/Xaccess - file generated by $0: \
+$date\n*\n%hostlist\t$x_display_manager\n*\t\tCHOOSER %hostlist"\
+ >/etc/X11/xdm/Xaccess
+
+ # define type of X session
+ dsx="no"
+ init="#7:5:respawn:/usr/X11R6/bin/X vt7 -quiet"
+ case "$start_x" in
+ yes|YES|direct|DIRECT|query|QUERY)
+ # direct connection onto the own displaymanager, which
+ # should be enabled then
+ [ "x$start_xdmcp" = "xno" ] && $start_xdmcp="yes"
+ init=""
+ dsx="yes"
+ xdmcp="false"
+ echo -e "# /etc/X11/Xservers - file generated by \
+$0: $date\n:0 local /usr/X11R6/bin/X :0 vt07\n" >/mnt/etc/X11/xdm/Xservers
+ ;;
+ broadcast|BROADCAST)
+ # the client will XDMCP broadcast and choose first available
+ # X11 server
+ [ "x$start_xdmcp" = "xgdm" ] || init="$init -broadcast"
+ ;;
+ indirect|INDIRECT)
+ # the client will try to XDMCP connect list of X11 servers
+ if [ "x$start_xdmcp" = "xgdm" ] ; then
+ init=""
+ else
+ init="$init -indirect $host_name"
+ fi
+ [ "x$start_xdmcp" = "xno" ] && start_xdmcp="yes"
+ xdmcp="true"
+ ;;
+ *)
+ # fixme!! not optimal for fast start
+ # no display manager needed in kiosk mode
+ # in this mode you have to provide the type of X session to start
+ [ x$start_xdmcp != "x" ] || start_xdmcp="no";
+ init="#7:5:respawn:/var/X11R6/bin/kiosk /dev/tty7"
+ echo -e "#!/bin/sh\n# /var/X11R6/bin/kiosk - file generated by $0: \
+$date\nresmgr login nobody tty7\nresmgr grant nobody desktop\n\
+chown nobody /dev/dsp*\n\
+su -c 'xinit /etc/init.d/startgui $start_x -- vt7 -quiet' -l nobody &>/dev/null\n\
+resmgr revoke nobody\nresmgr logout tty7\nkillall X\nsleep 2" \
+ >/mnt/var/X11R6/bin/kiosk
+ chmod a+x /mnt/var/X11R6/bin/kiosk &
+ ;;
+ esac
+ # enable runlevel 5 (X11 gui under SuSE linux)
+ # grep -v -e "7:[35]" /etc/inittab > /etc/inittab.new
+ # [ -z "$init" ] || {
+ echo -e "# entry made by $0 $date\n$init" >> /mnt/etc/inittab
+fi
+
+# setup requested display manager
+if [ "x$start_xdmcp" != "xno" ] ; then
+ testmkd /mnt/var/lib/xdm/authdir/authfiles
+ testmkd /mnt/var/run/xdmctl
+ if [ "$start_xdmcp" = "yes" ] ; then
+ start_xdmcp=kdm
+ fi
+ case "$start_xdmcp" in
+ wdm|WDM)
+ # anywhere in use!?
+ ;;
+ esac
+ # setup xdm (as fallback) in any case
+ 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\
+DisplayManager.authDir:\t\t/var/lib/xdm\n\
+DisplayManager.keyFile:\t\t/etc/X11/xdm/xdm-keys\n\
+DisplayManager.servers:\t\t/etc/X11/xdm/Xservers\n\
+DisplayManager.accessFile:\t/etc/X11/xdm/Xaccess\n\
+DisplayManager.willing:\t\tsu nobody -c /etc/X11/xdm/Xwilling\n\
+DisplayManager.*.authName:\tMIT-MAGIC-COOKIE-1\n\
+DisplayManager.*.authComplain:\tfalse\n\
+DisplayManager.*.setup:\t\t/etc/X11/xdm/Xsetup\n\
+DisplayManager.*.chooser:\t/etc/X11/xdm/RunChooser\n\
+DisplayManager.*.startup:\t/etc/X11/xdm/Xstartup\n\
+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
+ config_dm
+fi