diff options
Diffstat (limited to 'initramfs/initrd-stuff/bin')
-rwxr-xr-x | initramfs/initrd-stuff/bin/dhcpmkconfig | 72 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/bin/hwautocfg | 330 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/bin/hwsetup | bin | 123832 -> 0 bytes | |||
-rwxr-xr-x | initramfs/initrd-stuff/bin/servconfig | 425 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/bin/xconfig | 240 |
5 files changed, 0 insertions, 1067 deletions
diff --git a/initramfs/initrd-stuff/bin/dhcpmkconfig b/initramfs/initrd-stuff/bin/dhcpmkconfig deleted file mode 100755 index 9726d51b..00000000 --- a/initramfs/initrd-stuff/bin/dhcpmkconfig +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003 - 2006 - RZ Uni Freiburg -# Copyright (c) 2006, 2007 - OpenSLX GmbH -# -# This program is free software distributed under the GPL version 2. -# See http://openslx.org/COPYING -# -# If you have any feedback please consult http://openslx.org/feedback and -# send your feedback to feedback@openslx.org -# -# General information about OpenSLX can be found under http://openslx.org -# -# Universal (distro independent) IP configuration writer for several dhcp -# clients used within OpenSLX initramfs. The result is written in unified -# form to the /etc/machine-setup file - -# client variable should be exported via calling function -cfgfile="/tmp/confviadhcp" -cfgmsg="\n## Configuration written by $0" -infomsg="# --> You are using $dhcl. With this client you are not \ -able to\n# transfer any vendor specific, self defined dhcp options. If \ -this is\n# intended, use dhclient instead or get them via tftp (to be \ -enabled\n# via kernel command line)." -# heavy debugging output in level 3 and above ... and on 13 -#FIXME: DEBUGLEVEL is not propagated to this file (at least for Ubuntu) -[ -z "$DEBUGLEVEL" ] && DEBUGLEVEL=0 -[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 13 ] && \ - set -x -case $0 in - *dhcpcd*) - dhcl="dhcpcd"; echo -e "$cfgmsg\n$infomsg" >>/tmp/confviadhcp - 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/=\(.*\)/='\1'/;/DNS/s/,/ /;/NTPSERVERS/s/,/ /" \ - -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.*,,;s,.*TIME=.*,,;s,CL.*,,;/^$/d" \ - -e "s,INTER.*,,;s,DHCPSNAME.*,," /var/lib/dhcp/dhcpcd-eth0.info \ - >>$cfgfile - ;; - *dhclient*) - if [ $reason = "BOUND" ] ; then - echo -e "$cfgmsg\n# --> You are using dhclient. If you wish to \ -transfer other vendor/user\n# specific variables, you have to add \ -them in functions and in\n# dhcpmkconfig script or use tftp (to be \ -enabled via kernel command\n# line)." >>$cfgfile - set | sed -n -e '/^new/p' | sed \ - -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," \ - >>$cfgfile - fi - ;; - *udhcpc*) - dhcl="udhcpc"; echo -e "$cfgmsg\n$infomsg" >>$cfgfile - # if $cfgfile is changed change target for set output accordingly - unset infomsg HOME IFS mask lease interface cfgmsg cfgfile - unset DEBUGLEVEL - set | sed \ - -e "s,^P.*,,;s,ntpsrv,ntp_servers,;s,ip,clientip," \ - -e "s,serverid,serverip,;s,subnet,subnet_mask," \ - -e "s,router,gateway,;s,hostname,host_name," \ - -e "s,domain,domain_name,;s,dns,domain_name_servers," \ - -e "s,broadcast,broadcast_address,;s,dhc.*,,;/^$/d" \ - -e "/OPTIND.*/d" \ - >>/tmp/confviadhcp - ;; -esac diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg deleted file mode 100755 index 37ce3980..00000000 --- a/initramfs/initrd-stuff/bin/hwautocfg +++ /dev/null @@ -1,330 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003 - 2006 - RZ Uni Freiburg -# Copyright (c) 2006, 2007 - OpenSLX GmbH -# -# This program is free software distributed under the GPL version 2. -# See http://openslx.org/COPYING -# -# If you have any feedback please consult http://openslx.org/feedback and -# send your feedback to feedback@openslx.org -# -# General information about OpenSLX can be found under http://openslx.org -# -# Universal (distro independent) hardware autoconfiguration script for -# OpenSLX linux stateless clients, using hwconfig from knoppix as base tool - -############################################################################# -# pre part, load USB modules and start hardware detection pci and monitor -hwpre () { -echo "0 0 0 0" >/proc/sys/kernel/printk -# start the knoppix hardware autodetection tool -driverlist="parport parport_pc " -# hack for pseudo modules (not to load) hopefully "usbcore" is present -# as a module, might be exchanged with any other existing ... -for i in $driverlist ; do - echo -e "alias\t$i\tusbcore" >> /etc/modprobe.conf -done -( hwsetup -n -v > /tmp/hwsetup.info && echo "hwsetup" > /tmp/hwrun1 ) & -( usleep 8000; xconfig ) & -( for mod in usbcore uhci-hcd ohci-hcd usbhid; do - modprobe -q $mod 2>/dev/null - usleep 10000 -done; ) & -return 0 -} - -############################################################################# -# network module part -nwmod () { -[ $DEBUGLEVEL -eq 20 ] && \ - echo "** loading all defined network adaptor modules at $(sysup)" -for mod in ${NWMODULES}; do - modprobe ${MODPRV} $mod || error "$init_errnwad" - usleep 50000 -done -return 0 -} - -############################################################################# -# main part -hwmain () { -# "drivers" (pseudo, placeholder strings, ...) to exclude from loading -# depending on distro more hw modules have to be excluded too. use the -# D_HWMODTOIGNORE for that purpose -driverlist=" disabled unknown ignore pcspkr synaptics keybdev kanotix \ - slamr {D_HWMODTOIGNORE} " -# driver blacklist (real modules which fail to load) -driverlist=${driverlist}"hw_random genericwheelusb " -# hack for pseudo modules (not to load) hopefully "usbcore" is present -# as a module, might be exchanged with any other existing ... -for i in $driverlist ; do - echo -e "alias\t$i\tusbcore" >> /etc/modprobe.conf -done - -# load kernel module for ps2 mice -[ -f /lib/modules/${KERNEL}/kernel/drivers/input/mouse/psmouse.ko ] && \ - modprobe ${MODPRV} psmouse - -# and map the mousehandler to /dev/input/mice -[ -f /lib/modules/${KERNEL}/kernel/drivers/input/mousedev.ko ] && \ - modprobe ${MODPRV} mousedev - -# wait for /tmp/hwsetup.info to appear -waitfor /tmp/hwrun1 50000 || \ - error "$hcfg_hwsetup" -# in some cases the time to wait for module load is to be increased -if [ -n "${SLOWHWSETUP}" ] ; then - modwaittime=${SLOWHWSETUP} - [ $DEBUGLEVEL -eq 21 ] && echo "** set modwaittime to ${SLOWHWSETUP}ms" -else - modwaittime=5000 -fi -[ $DEBUGLEVEL -eq 21 ] && echo "** 1st hwdetection finished at $(sysup)" -# load ide drivers first, takes a while to initialize -for driver in cmd64x hpt366 piix slc90e66 cs5520 it821x rz1000 \ - ahci triflex aec62xx cs5530 cs5535 ns87415 sc1200 trm290 alim15x3 \ - cy82c693 opti621 serverworks via82cxxx amd74xx pata_amd \ - pdc202xx_new siimage atiixp hpt34x pdc202xx_old sis5513; do - strinfile " ${driver}" /tmp/hwsetup.info && { - ide="yes" - #modwaittime=$((10 + ${modwaittime})) - modprobe ${MODPRV} ${driver} & - driverlist="${driverlist} ${driver}"; usleep ${modwaittime}; } -done -# check for IDE/SCSI (SATA); changes in newer kernels prefix pata/sata -for driver in ata_piix sata_via sata_mv sata_nv sata_sil sata_sis sata_svw \ - sata_sx4 sata_uli sata_vsc sata_qstor sata_promise ahci; do - strinfile " ${driver}" /tmp/hwsetup.info && { - #SCSIIDE="yes" - modprobe ${MODPRV} ${driver} & - driverlist="${driverlist} ${driver}"; usleep ${modwaittime}; } -done -# check for USB2.0 and ieee1394 hardware drivers -for driver in ehci-hcd ohci1394; do - strinfile " ${driver}" /tmp/hwsetup.info && { - USB="yes" - modprobe ${MODPRV} ${driver} - driverlist="${driverlist} ${driver}"; } -done -[ -x /bin/mdev ] && mdev -s & -# check for pcmcia / cardbus stuff -for driver in yenta_socket i82365 pd6729 tcic; do - strinfile " ${driver}" /tmp/hwsetup.info && { - modprobe ${MODPRV} ${driver} - driverlist="${driverlist} ${driver}" - pcmcia="yes"; } -done -# should we check for card reader modules too? -# newer kernels support some of the major multicard readers which could -# be found in some barebone systems like Pundits or in many laptops -if [ -n "${pcmcia}" ] ; then - modprobe ${MODPRV} ds -fi - -[ $DEBUGLEVEL -eq 21 ] && echo "** module loading finished at $(sysup)" -# rerun the knoppix hardware autodetection tool for USB and ide devices -# like dvd or harddisk - wait a few seconds so hopefully the ide driver -# is initialized -[ -x /bin/mdev ] && mdev -s -test -f /proc/bus/usb/devices || \ - mount -n -t usbfs usbfs /proc/bus/usb 2>/dev/null -[ $DEBUGLEVEL -eq 21 ] && echo "** started 2nd hwdetection at $(sysup)" -# remove unneeded network card and USB 1.1 modules -for driver in ${NWMODULES} ohci-hcd uhci-hcd ; do - strinfile " ${driver}" /tmp/hwsetup.info || { - rmmod ${driver} - driverlist="${driverlist} ${driver}"; } -done -# wait depending on time of modules to load a little bit before the next -# round of hardware detection -usleep ${modwaittime} && hwsetup -v > /tmp/hwsetup.info -[ $DEBUGLEVEL -eq 21 ] && echo "** finished 2nd hwdetection at $(sysup)" - -# load IDE high level drivers -if [ -n "$ide" ] ; then - # you might want to check /etc/sysconfig/floppy for more info - strinfile "ZIP" /tmp/hwsetup.info && modprobe ${MODPRV} ide-floppy - strinfile "CDROM" /tmp/hwsetup.info && modprobe ${MODPRV} ide-cd - strinfile "HD" /tmp/hwsetup.info && { - modprobe ${MODPRV} ide-disk - disk=yes; } -fi - -# not rather precise ... -if strinfile "SCSI" /tmp/hwsetup.info ; then - strinfile "CDROM" /tmp/hwsetup.info && { modprobe ${MODPRV} sr_mod; - modprobe ${MODPRV} sg; - # just for compatibility to hwsetup (which generates links to scd*) - ( waitfor /dev/sr0 1000 && for i in /dev/sr* ; do - [ -e /dev/scd${i#/dev/sr} ] || cp -a -f $i /dev/scd${i#/dev/sr} ; done; ) & - } - strinfile "HD" /tmp/hwsetup.info && { - modprobe ${MODPRV} sd_mod - disk=yes; } - # check if a (scsi) scanner was detected - strinfile "SCANNER" /tmp/hwsetup.info && \ - echo -e 'KERNEL=="sg*",\t\tNAME="%k", GROUP="disk", MODE="666"' \ - >> /tmp/scanner-udev -fi -[ -x /bin/mdev ] && mdev -s -# sound card setup (alsa and oss compatibility drivers) -( if [ -f /etc/sysconfig/sound ] ; then - . /etc/sysconfig/sound - driver=${DRIVER} -else driver="snd-dummy" -fi -# problem with a specific module not disabled (via above trick) when -# busybox is used -# rmmod snd_atiixp_modem snd_atiixp -modprobe ${MODPRV} ${driver} -driverlist="${driverlist} ${driver}" -modprobe ${MODPRV} snd-pcm-oss -modprobe ${MODPRV} snd-mixer-oss -# 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 5000; } - driverlist="${driverlist} ${driver}" - fi - fi -done ) & -[ $DEBUGLEVEL -eq 21 ] && echo "** finished most of module loading at $(sysup)" - -# get idea of availabe harddisk partitions, put swap partitions into -# (/mnt)/etc/fstab and format and mount partitions of type 44 (unknown) -[ $DEBUGLEVEL -eq 21 ] && echo "** starting hdd stuff at $(sysup)" -if [ "${disk}" = "yes" ] ; then -for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ - sed -n -e '/device:/p'|sed -e 's/device: //') ; do - /mnt/sbin/fdisk -l /dev/$hd|sed -n "/^\/dev\//p" > /tmp/hd_part - for hdpartnr in $(cat /tmp/hd_part | \ - sed -n -e "/ 82 /p"|sed -e "s/[[:space:]].*//") ; do - echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >> /tmp/fstab - done - # we use special non assigned partition type (id44) for harddisk scratch - # space, thus no normal filesystem will be incidentally deleted or - # corrupted - for hdpartnr in $(cat /tmp/hd_part | \ - sed -n -e "/ 44 /p"|sed -e "s/[[:space:]].*//") ; do - # check for supported filesystem and formatter - ( if diskfm $hdpartnr ; then - echo "$hdpartnr is mounted to /mnt/tmp at $(sysup)" > /tmp/tmpready - echo -e "$hdpartnr\t/tmp\t\tauto\t\tdefaults\t 0 0" >> /tmp/fstab - else - echo "formatting failed for some reason ($(sysup))" > /tmp/tmpready - fi ) & - part44=yes - break - done - # put detected linux partitions into /etc/fstab with "noauto" - for hdpartnr in $(cat /tmp/hd_part | \ - sed -n -e "/ 83 /p"|sed -e "s/[[:space:]].*//") ; do - mkdir -p /mnt/media/${hdpartnr#/dev/*} 2>/dev/null - echo -e "$hdpartnr\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto,\ -noexec\t 0 0" >> /tmp/fstab - done -done -# determine if tmp preparation should wait for format/mount or not -[ -z "$part44" ] && echo "finished at $(sysup)" > /tmp/tmpready -else - echo "no disk found ( $(sysup) )" > /tmp/tmpready -fi -[ $DEBUGLEVEL -eq 21 ] && echo "** finished hdd stuff at $(sysup)" - -# configure some variables from configuration file - wait for dhcp or ldap -# confiurator to complete -cfgcomplete -. /etc/machine-setup -[ $DEBUGLEVEL -eq 21 ] && echo "** finished waiting for config at $(sysup)" - -# set X11 configuration file -if [ -n "${D_XF86CONFFILE}" ] ; then - D_XF86CONFFILE="/mnt/${D_XF86CONFFILE}" -else - D_XF86CONFFILE="/mnt/etc/X11/xorg.conf" - error "$hcfg_xcfg" nonfatal -fi -# finish Xorg configuration if no xorg.conf file was provided by ConfigTGZ -# (check for /rootfs/${D_XF86CONFFILE#/mnt}) -if [ ! -f /rootfs${D_XF86CONFFILE#/mnt} ] ; then - xfc="/tmp/xorg.conf" - . /etc/sysconfig/xserver >/dev/null 2>&1 || error "${hcfg_hwsetup}" nonfatal - # replace OSS 3D server with proprietary one - checkgraphix - sed -e "s/\"vesa\"/\"${XMODULE}\"/" -i $xfc - # check for 64bit CPU/installation (fixme!!) - [ -d "/mnt/usr/X11R6/lib64/modules" ] && \ - sed -e "/Section \"Files\"/a\ \ ModulePath \"/usr/X11R6/lib64/modules\"" \ - -i $xfc - # run localizator and configure X11 keyboard - localization "${country}" - if [ -z "${XKEYBOARD}" ] ; then - XKEYBOARD="us" - error "${xcfg_keyb}" nonfatal - fi - sed "s/XKEYBOARD/${XKEYBOARD}/" -i $xfc - # check for kind of xorg module used and patch the i8,9XX VGA BIOS if needed - if strinfile '"i810"' $xfc && [ -f /tmp/res ] ; then - highres=$(sort -run /tmp/res|grep -i x -m 1) - 915resolution -l|sed -n "s/Mode //;/32 bits/p" > /tmp/915res - strinfile ${highres} /tmp/915res || { - 915resolution $(grep -i x -m 1 /tmp/915res|sed "s/\ :.*//") $(echo \ - $highres|sed "s/x/\ /") 2>&1 >/dev/null; - # for some reason the above does not work for a Dell laptop with Intel - # 855 chipset, so add another mode too - 915resolution 3c $(echo $highres|sed "s/x/\ /") 2>&1 >/dev/null; } - fi -fi - -# if any new device appeared up to now -if [ -x /bin/mdev ] ; then - mdev -s & - testmkd /dev/input - mknod /dev/input/mice c 13 63 2>/dev/null -fi -return 0 -} - -############################################################################# -# main script starts here - -# functions common for all distros -. /etc/functions -# functions common for all distros, messages contains all error and -# info output -. /etc/messages -# load distro specific configuration variables and functions. distro -# specific functions may overwrite functions defined in /etc/functions -. /etc/sysconfig/config -. /etc/distro-functions - -# script run timer -[ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \ - echo "** HW $1 setup started at $(sysup)" - -# heavy debugging output in level 3 and above and specific for 11 -[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 11 ] && \ - set -x - -case $1 in - # pre initializsation: loading USB base modules, starting hwsetup - pre) - hwpre - ;; - # loading network modules - nwmod) - nwmod - ;; - # main part of hardware setup including Xorg - main) - hwmain - # main script run timer or debug information - [ $DEBUGLEVEL -eq 8 -o $DEBUGLEVEL -eq 21 ] && \ - echo "** HW setup finished at $(sysup)" - echo "hwsetup finished at $(sysup)" > /tmp/hwcfg - ;; -esac diff --git a/initramfs/initrd-stuff/bin/hwsetup b/initramfs/initrd-stuff/bin/hwsetup Binary files differdeleted file mode 100755 index 1b6ab300..00000000 --- a/initramfs/initrd-stuff/bin/hwsetup +++ /dev/null diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig deleted file mode 100755 index 824f9870..00000000 --- a/initramfs/initrd-stuff/bin/servconfig +++ /dev/null @@ -1,425 +0,0 @@ -# Copyright (c) 2003 - 2006 - RZ Uni Freiburg -# Copyright (c) 2006, 2007 - OpenSLX GmbH -# -# This program is free software distributed under the GPL version 2. -# See http://openslx.org/COPYING -# -# If you have any feedback please consult http://openslx.org/feedback and -# send your feedback to feedback@openslx.org -# -# General information about OpenSLX can be found under http://openslx.org -# -# universal (distro independent) configuration script for OpenSLX linux -# diskless clients (executed in stage3 within initial ramfs). The file- -# system setup is completed when servconfig starts - -############################################################################# -# check for configuration files to source - -# functions common for all distros, messages contains all error and -# info output -. /etc/messages -. /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 -. /etc/sysconfig/slxsystem.conf -# get location of logfile definition -. /mnt/etc/${D_SYSCONFDIR}/logfile - -# script run timer -[ $DEBUGLEVEL -eq 8 ] && echo "** SW setup started at $(sysup)" - -# heavy debugging output in level 3 and below 8 ... -[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 12 ] && \ - set -x - -############################################################################# -# copy distro specific scripts, programs, libraries and configs -cp -a /etc/sysconfig/files/* /mnt 2>/dev/null & -# boot.local file (different for several distros) -[ -f "/etc/boot.local" -a -n "${D_BOOTLOCAL}" ] && { - echo "# added by $0 (initramfs from $date)" >> /mnt/etc/${D_BOOTLOCAL} - cat /etc/boot.local >> /mnt/etc/${D_BOOTLOCAL} -} - -############################################################################# -# read and unify configuration options - default configuration file, from -# dhcp, ldap ... -# wait for the appearance of configuration from several sources -cfgcomplete -. /etc/machine-setup -[ $DEBUGLEVEL -eq 8 ] && echo "** Config info is complete at $(sysup)" - -# copy additional configuration and var files and directories -# admins can place there files in /var/lib/openslx/config/... -# to be packed during stage2 into (/srv/dxs)/tftpboot/client-config...) -# ... in the near future ... -cp -a /rootfs/* /mnt 2>/dev/null - -# set greeting and add information on booted system -len=$(expr length ${SLXVERSION}${SYSTEM_NAME}) -if [ $len -le 28 ] ; then - vdstr="Stateless Workstation (V${SLXVERSION}/${SYSTEM_NAME})" - smax=28 -else - vdstr="V${SLXVERSION}/${SYSTEM_NAME}" - smax=52 -fi -while [ $len -le $smax ] ; do - vdstr="$vdstr " - len=$(($len + 1)) -done -len=$(expr length $host_name) -while [ $len -le 30 ] ; do - space="$space " - len=$(($len + 1)) -done -echo " - WELCOME TO $space \n (\l) - _____ ______ ______ __ __ _______ __ __ __ - / _ | _ | ___| | | | | ____| | | | | | - | | | | |_| | |_ | | | | |___ | | / / - | | | | ___/| _| | | ____ | | | | - | |_| | | | |___| | | | ____| | |___ / / - _____/|__| |______|__| |__| |_______|______|__| |__| - - $vdstr (c) <OpenSLX.ORG> -">/mnt/etc/issue - -############################################################################# -# set localization and add entries to initialize keytable and consolefont to -# boot.slx -DEFKEYTABLE="de-latin1-nodeadkeys" -if [ -z "$country" ] ; then - error "$scfg_country" nonfatal - country="${D_DEFAULTCOUNTRY}" -fi -localization "${country}" -if [ -z "${KEYTABLE}" ] ; then - error "$hcfg_keyb" nonfatal - KEYTABLE=${DEFKEYTABLE} -fi -echo -e "\t# entries added by $0: $date" >> /mnt/etc/${D_INITDIR}/boot.slx -[ -n "${KEYTABLE}" ] && keytable -[ -n "${CONSOLE_FONT}" ] && consolefont - -############################################################################# -# setup passwd and shadow for local system users like root, bin, daemon and -# nobody if no user/admin provided passwd exists ... -# the root password provided by machine-setup is used only if no passwd file -# is provided (default case) -if [ ! -f /rootfs/etc/passwd ] ; then - basepasswd -fi - -############################################################################# -# 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 -if [ -n "$domain_name" ]; then - echo -en "$clientip\t" >>/mnt/etc/hosts - for name in $domain_name; do - echo -en "$host_name.$name " >>/mnt/etc/hosts - done - echo -e "$host_name" >>/mnt/etc/hosts -else - echo -e "$clientip\t$host_name" >>/mnt/etc/hosts -fi -# set up domainname and resolving -rm -rf /mnt/etc/resolv.conf -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 name in $domain_name_servers; do - echo nameserver $name >>/mnt/etc/resolv.conf; - done; } - -############################################################################# -# run distro specific configuration function -config_distro - -############################################################################# -# boot.local (fixme: deprecated) -if [ -n "$bootlocal_script" ]; then - echo -e "# Option is deprecated and will be removed soon. Please put the \ -file to the ConfTGZ (rootfs/etc/${D_INITDIR}/boot.local)" >> \ - /mnt/etc/${D_INITDIR}/boot.local -fi - -############################################################################# -# basic (non network) services - -# at daemon - calling distro specific function config_atd -config_atd - -# configuration of cron services - calling distro specific function -# config_cron (runlevel links, directories, ...) -config_cron -[ "x$crontab_entries" != "x" ] && \ - echo -e "$crontab_entries" >> /mnt/etc/crontab - -# setup system log services - distro dependent function config_syslog -config_syslog - -# acpi and powersave - distro dependent function config_acpi, these daemons -# might require dbus -config_acpi - -# 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 - -# configure automounter -if [ "x$automnt" != "xno" ] ; then - # check if there is some user provided configuration (only auto.master is - # important) and skip automatic setup - if [ ! -f /rootfs/etc/auto.master ] ; then - if [ -d /mnt/misc ] ; then - echo -e "# /etc/auto.master - file generated by $0:\n\ -/misc\t/etc/auto.misc" >/mnt/etc/auto.master - echo -e "# /etc/auto.misc - file generated by $0:" >/mnt/etc/auto.misc - else - echo -e "# /etc/auto.master - file generated by $0:\n\ -/misc\t#/etc/auto.misc" >/mnt/etc/auto.master - echo -e "# /etc/auto.misc - file generated by $0:\nautomount for \ -removable devices is mostly deprecated, so /misc is not\nactivated in \ -auto.master." >/mnt/etc/auto.misc - fi - if [ -n "${automnt_src}" ] ; then - # local directory and home directory server from machine-setup - [ -z "${automnt_dir}" ] && automnt_dir="/home" - # remove leading and trailing slash - automnt_dir=${automnt_dir#/} - automnt_dir=${automnt_dir%/} - test -d /${automnt_dir} || error "$scfg_erradir" nonfatal - strinstr "/" ${automnt_dir} && error "$scfg_erratpld" nonfatal - amserv=$(uri_token $automnt_src server) - ampath=$(uri_token $automnt_src path) - echo -e "/${automnt_dir}\t/etc/auto.${automnt_dir}\n" \ - >> /mnt/etc/auto.master - echo -e "# /etc/auto.${automnt_dir} created by $0:\n" \ - > /mnt/etc/auto.${automnt_dir} - echo -e "*\t-rsize=32768,wsize=32768,rw\t${amserv}:${ampath}/&" \ - >> /mnt/etc/auto.${automnt_dir} - # no tempfs needed if automounter operates on /home - [ "${automnt_dir}" = "home" ] && umount -t tmpfs /mnt/home 2>/dev/null - # portmapper is needed for remote NFS sources and local nfs directories - testmkd /mnt/var/lib/nfs/state - config_portmap - fi - fi - config_automount -fi - -# configure print services / start requested printer daemon -config_printer - -# configure bluetooth services -config_bt - -############################################################################# -# network(ed) services - -# network time service (ntp) configuration file -if [ -n "$ntp_servers" -a ! -f /rootfs/etc/ntp.conf ]; then - echo -e "# /etc/ntp.conf - file generated by $0: \ -$date\n" >/mnt/etc/ntp.conf - for name in $ntp_servers; do - echo server $name >>/mnt/etc/ntp.conf - done -fi -# copy timezone file defined with language settings -[ -z "$TZ" ] && TZ="$timezone" -ln -snf /usr/share/zoneinfo/${TZ} /mnt/etc/localtime || \ - error "$scfg_ntptz" nonfatal -config_ntp - -# secure shell server - at the moment all clients share one "secret" -# key or the key has to be regenerated on every bootup or fetched on -# every bootup from somewhere -config_sshd - -# simple network management protocol agent -config_snmp - -# setup afs client stuff -config_afs - -# setup nfsv4/krb stuff -config_nfsv4 - -# configure samba service -config_samba - -############################################################################# -# 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 - config_nis -fi - -############################################################################# -# name service caching daemon if networked user database -config_nscd - -############################################################################# -# preparation of /tmp directory (partition 44, nfs scratch, ramdisk). there -# might be the chance that we have a disk partition available, so wait for -# completion of detection, setup process -[ $DEBUGLEVEL -eq 8 ] && echo "** Waiting for /tmp completion at $(sysup)" -waitfor /tmp/tmpready 40000 -[ $DEBUGLEVEL -eq 8 ] && echo "** Setup of /tmp completed at $(sysup)" -# create some directories and correct permissions -tmpisdisk=$(sed -n '/\/tmp/p' /tmp/fstab 2>/dev/null) -# if there is no local disk partition for /tmp then try to mount a rw -# scratch space (if defined in $scratch) and prepared on server -if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then - scrproto=$(uri_token $FILESRC prot) - scrpath=$(uri_token $FILESRC path) - testmkd /tmp/scratch - # exports have to be per client!! - case "$scrproto" in - nbd) - : - ;; - *) - tmpserv=$(uri_token $scratch server) - tmppath=$(uri_token $scratch path) - # hanging mount processes might stop further setup - timeout - # should be configured ... it is possible to mount "nolock" only - mount -t nfs -o rw,tcp,nolock,intr,nodev,soft,timeo=2,nosuid \ - ${tmpserv}:${tmppath} /tmp/scratch >/dev/null 2>&1 && { - testmkd /tmp/scratch/${clientip} - umount /tmp/scratch - # no need for tempfs there ... - umount /mnt/tmp >/dev/null 2>&1 - mount -t nfs -o rw,tcp,nolock,intr,nodev,soft,timeo=2,nosuid \ - ${tmpserv}:${tmppath}/${clientip} /mnt/tmp >/dev/null 2>&1 - # somehow we need to move it to the vmware plugin. Any ideas - # how to handle the dependencies? - # create an empty container file for vmware *.vmem, it does not - # like to live on NFS exports - if [ "x$vmware" != "x" -a "x$vmware" != "xno" ] ; then - dd if=/dev/zero of=/mnt/tmp/vm-container count=1 seek=2048000 - diskfm /mnt/tmp/vm-container /mnt/tmp/vmware - chmod a+rwxt /mnt/tmp/vmware - fi; } - ;; - esac -fi - -############################################################################# -# 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/compiled \ - /etc/X11/xdm \ - /etc/X11/sessions \ - /var/X11R6/bin \ - /var/run/xdmctl \ - /tmp/.ICE-unix \ - /tmp/.X11-unix ; do testmkd /mnt/$i; done - chmod 1777 /mnt/tmp/.ICE-unix /mnt/tmp/.X11-unix - chown 0:0 /mnt/tmp/.ICE-unix /mnt/tmp/.X11-unix - echo "# file emtied by $0 during initramfs" > /mnt/etc/X11/xdm/Xservers - # define additional sessions offered to the user (via dhcp/ldap config) - # descsession -> deprecated by new vmware integration concept - # 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"\ - >/mnt/etc/X11/xdm/Xaccess - - # define type of X session - dsx="no" - 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 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="7:5:respawn:${D_XORGBIN} vt7 -quiet -broadcast" - ;; - indirect|INDIRECT) - # the client will try to XDMCP connect list of X11 servers - if [ "x$start_xdmcp" = "xgdm" ] ; then - init="" - else - init="7:5:respawn:${D_XORGBIN} vt7 -quiet -indirect $host_name" - fi - [ "x$start_xdmcp" = "xno" ] && start_xdmcp="yes" - xdmcp="true" - ;; - *) - # 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" - # nobody can halt pc - echo 'nobody ALL=NOPASSWD:/sbin/halt, /sbin/shutdown' >>/mnt/etc/sudoers - echo -e "#!/bin/sh\n# /var/X11R6/bin/kiosk - file generated by $0: $date - while ps aux|grep -i kiosk|grep -v \"grep\" &>/dev/null; do - test -f /var/run/kiosk || break; sleep 3; - done - touch /var/run/kiosk - for((i=0;\$i<=120;i=\$((\$i+1)))); do - [ -e /var/run/resmgr.pid ] && break - [ \$i = 120 ] && exit 1 - sleep 1 - done - resmgr login nobody tty8 \\ - && resmgr grant nobody desktop \\ - && chown -R nobody:nogroup /var/lib/nobody \\ - && (su -c '(sleep 10; amixer -q sset Master 28 unmute; \\ - amixer -q sset PCM 28 unmute) & - xinit /var/X11R6/bin/startgui $start_x \\ - -- vt7 -quiet' -l nobody &>/dev/null) - rm /var/run/kiosk - resmgr revoke nobody - resmgr logout tty7 - killall X" >/mnt/var/X11R6/bin/kiosk - # early start of kiosk session - echo -e "\t# kiosk start added by $0\n\t\ -/var/X11R6/bin/kiosk &>/dev/null &" >>/mnt/etc/${D_INITDIR}/boot.slx - cp /etc/startgui /mnt/var/X11R6/bin - chmod a+x /mnt/var/X11R6/bin/kiosk /mnt/var/X11R6/bin/startgui - rm /mnt/var/run/kiosk 2>/dev/null - ;; - esac - echo -e "# entry made by $0 $date\n$init" >> /mnt/etc/inittab - # most probably not needed any longer - if [ -n ${D_XORGBIN} ] ; then - testmkd /mnt/var/X11R6/bin - ln -sf ${D_XORGBIN} /mnt/var/X11R6/bin/X - fi -fi - -# script run timer -[ $DEBUGLEVEL -eq 8 ] && echo "** SW setup finished at $(sysup)" - -# servconfig finished successfully -echo "servconfig finished at $(sysup)" > /tmp/svcfg diff --git a/initramfs/initrd-stuff/bin/xconfig b/initramfs/initrd-stuff/bin/xconfig deleted file mode 100755 index 7f465746..00000000 --- a/initramfs/initrd-stuff/bin/xconfig +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh -# Copyright (c) 2007 - RZ Uni Freiburg -# Copyright (c) 2007 - OpenSLX GmbH -# -# This program is free software distributed under the GPL version 2. -# See http://openslx.org/COPYING -# -# If you have any feedback please consult http://openslx.org/feedback and -# send your feedback to feedback@openslx.org -# -# General information about OpenSLX can be found under http://openslx.org -# -# Universal (distro independent) xorg.conf preparation script for OpenSLX -# linux stateless clients, depending on ddcprobe -# -# this tool produces a 1024x768 standard resolution if no monitor was -# detected (problems on some older i8XX, newer NVidia, and ATI adaptors) - -############################################################################# -# local functions used within - check if the monitor might be an older crt -iscrt () { -local dim=$1 -local year=$2 -# first three characters (CRT/TFT) are interpreted later -local crt="CRT Generic" -# sub 17" displays -if [ $dim -lt 750 ] ; then - # modern crt should have a size of 17"+ - if [ $year -gt 1998 ] ; then crt="TFT 4:3 <17inch" ; fi -# 17" crt displays, little bit smaller than tfts -elif [ $dim -lt 900 ] ; then - crt="CRT 17inch" - echo -e "1280x1024\n1152x864" > /tmp/res -# 19" crt / sub 19" tft -elif [ $dim -lt 1000 ] ; then - if [ $year -lt 2001 ] ; then - crt="CRT 19inch" - echo -e "1400x1050\n1280x1024\n1152x864" > /tmp/res - else - crt="TFT 4:3 17''" - fi -# 18/19" tft displays (available after 2001) -elif [ $dim -lt 1200 ] ; then - if [ $year -ge 2002 ] ; then - crt="TFT 4:3 18(+)''" - else - crt="CRT 20''" - echo -e "1400x1050\n1280x1024\n1152x864" > /tmp/res - fi -# sub 22" displays are crts if older than 2004 :) -elif [ $dim -lt 1300 ] ; then - if [ $year -ge 2004 ] ; then - crt="TFT 4:3 19(+)''" - else - crt="CRT 20(+)''" - echo -e "1600x1200\n1400x1050\n1280x1024\n1152x864" > /tmp/res - fi -# any bigger display is most probably a tft (and nobody should have bought -# a big crt after 2003 :)) -elif [ $year -ge 2004 ] ; then - crt="TFT 4:3 22+''" -fi -echo "$crt" -} - -############################################################################# -# main script - -# functions common for all distros -. /etc/functions -# functions common for all distros, messages contains all error and -# info output -. /etc/messages -# load distro specific configuration variables and functions. distro -# specific functions may overwrite functions defined in /etc/functions -. /etc/sysconfig/config -. /etc/distro-functions - -xfc="/tmp/xorg.conf" -echo -e "# ${D_XF86CONFFILE}\n# autogenerated X hardware configuration by \ -xconfig in OpenSLX stage3\n# DO NOT EDIT THIS FILE BUT 'xconfig' INSTEAD" \ - > $xfc -echo ' -Section "Files" -EndSection -Section "ServerFlags" - Option "AllowMouseOpenFail" - Option "blank time" "5" - Option "standby time" "10" - Option "suspend time" "15" - Option "off time" "20" -EndSection -Section "Module" - Load "i2c" - Load "bitmap" - Load "ddc" - Load "extmod" - Load "freetype" - Load "int10" - Load "vbe" - Load "glx" - Load "dri" -EndSection -Section "InputDevice" - Identifier "Generic Keyboard" - Driver "kbd" - Option "CoreKeyboard" - Option "XkbRules" "xorg" - Option "XkbModel" "pc105" - Option "XkbLayout" "XKEYBOARD" - Option "XkbVariant" "nodeadkeys" -EndSection -Section "InputDevice" - Identifier "Generic Mouse" - Driver "mouse" - Option "CorePointer" - Option "Device" "/dev/input/mice" - Option "Protocol" "ImPS/2" - Option "ZAxisMapping" "4 5" - Option "Emulate3Buttons" "true" -EndSection -Section "InputDevice" - Driver "wacom" - Identifier "stylus" - Option "Device" "/dev/input/wacom" - Option "Type" "stylus" - Option "ForceDevice" "ISDV4" # Tablet PC ONLY -EndSection -Section "InputDevice" - Driver "wacom" - Identifier "eraser" - Option "Device" "/dev/input/wacom" - Option "Type" "eraser" - Option "ForceDevice" "ISDV4" # Tablet PC ONLY -EndSection -Section "InputDevice" - Driver "wacom" - Identifier "cursor" - Option "Device" "/dev/input/wacom" - Option "Type" "cursor" - Option "ForceDevice" "ISDV4" # Tablet PC ONLY -EndSection -Section "Device" - Identifier "Generic Video Card" - Driver "vesa" -EndSection -Section "Monitor" - Identifier "Generic Display" - Option "DPMS" -EndSection -Section "Screen" - Identifier "Default Screen" - Device "Generic Video Card" - Monitor "Generic Display" - DefaultDepth 24 - SubSection "Display" - Depth 24 - Modes "1024x768" "800x600" - EndSubSection -EndSection -Section "ServerLayout" - Identifier "Default Layout" - Screen "Default Screen" - InputDevice "Generic Keyboard" - InputDevice "Generic Mouse" - InputDevice "stylus" "SendCoreEvents" - InputDevice "cursor" "SendCoreEvents" - InputDevice "eraser" "SendCoreEvents" -EndSection -Section "DRI" - Mode 0666 -EndSection -' >> $xfc -# read ddcprobe output (the adaptor VESA capabilities are of no interest) -ddcprobe|sed "/mode: /d"|while read line ; do - case $line in - ctiming*|dtiming*) - Res=$(echo $line|sed "s/.*:\ //;s/@.*//") - Width=${Res%%x*} - Height=${Res##*x} - # we need exact resolutions for tft displays only and we want to filter - # quadratic resolutions (bug of ddcprobe??) - [ "${IsCrt%% *}" = "TFT" -a $((${Width}00 / ${Height})) -ge 125 ] && \ - echo $Res >> /tmp/res - # add information on grafic adaptor and monitor (no practical use - # nevertheless) - [ "x${VendorName}" = "x" ] && VendorName="No vendor string detected" - grep ModelName $xfc 2>&1 > /dev/null || \ - sed -e "/Section \"Monitor\"/a\ \ ModelName \"Display - ${IsCrt}\"" \ - -e "/Section \"Device\"/a\ \ VendorName \"${VendorName}\"" \ - -i $xfc - ;; - monitorname*|monitorid*) - [ "x${line##monitor*:}" = "x" ] || sed "s/Display - /${line##monitor*: } - /" -i $xfc - ;; - product*) - [ "$line" != "product:" ] && \ - sed "/Section \"Device\"/a\ \ BoardName \"${line##product: }\"" \ - -i $xfc - ;; - oem*|vendor*) - [ "x${line##?e*:}" = "x" ] || VendorName="${line##?e*: }" - ;; - manufacture*) - Year=${line##* } - ;; - screensize*) - Dim=${line##screensize: } - Width=${Dim%% *} - Height=${Dim##* } - Dim=$(($Width * $Height)) - # check for geometry - no crt if no 4:3 pixel ratio - if [ $((${Width}00 / $((${Height} + 1 )))) -lt 140 ] ; then - IsCrt="$(iscrt $Dim $Year)" - else - IsCrt="TFT WideScreen" - fi - ;; - esac -done - -# if predefined value is present otherwise use computed/detected stuff -if [ -n "${hw_monitor}" ] ; then - # just cut all starting from k(Hz), do we need the option to set maximum - # monitor capabilities? - #HS=${hw_monitor%k*} - #VS=${hw_monitor%Hz*} - Modes="\"${hw_monitor##* }\"" -else - # to be checked if correct - if [ -f /tmp/res ] ; then - for line in $(sort -run /tmp/res) ; do Modes="$Modes \"$line\""; done - else - error "$hcfg_res" nonfatal - fi -fi -sed "s/Modes \"/Modes ${Modes} \"/" -i $xfc -# displayvars -#displayvars -#sed "/Section \"Device\"/a\ \ ${Files}" -i $xfc |