summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-05-01 20:01:03 +0200
committerDirk von Suchodoletz2006-05-01 20:01:03 +0200
commit383692f6329ff246bf1b639bdb32f0cd97c1f2ff (patch)
treea44d0d7ba698e5230a3392167f7d58073ce85f74
parentDebians udev is working now. (diff)
downloadcore-383692f6329ff246bf1b639bdb32f0cd97c1f2ff.tar.gz
core-383692f6329ff246bf1b639bdb32f0cd97c1f2ff.tar.xz
core-383692f6329ff246bf1b639bdb32f0cd97c1f2ff.zip
added synaptics mouse support, temp. bugfix in init ($DEBUGLEVEL),
cleanups ... git-svn-id: http://svn.openslx.org/svn/openslx/ld4@207 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--initrd/distro-specs/debian/config-3.18
-rw-r--r--initrd/distro-specs/gentoo/functions-2005.138
-rw-r--r--initrd/distro-specs/suse/functions-10.08
-rw-r--r--initrd/distro-specs/suse/functions-9.314
-rwxr-xr-xinitrd/initrd-stuff/bin/hwautocfg68
-rw-r--r--initrd/initrd-stuff/etc/messages9
-rwxr-xr-xinitrd/initrd-stuff/init42
7 files changed, 114 insertions, 73 deletions
diff --git a/initrd/distro-specs/debian/config-3.1 b/initrd/distro-specs/debian/config-3.1
index 2fd7a7b9..6492ed1c 100644
--- a/initrd/distro-specs/debian/config-3.1
+++ b/initrd/distro-specs/debian/config-3.1
@@ -1,9 +1,9 @@
# Description: distro specific settings for Debian/Sarge
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 24-03-2006
-# Blablub
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 01-05-2006
+# Felix Endres
#
-# Copyright: (c) 2003, 2005 - RZ Universitaet Freiburg
+# Copyright: (c) 2003, 2006 - RZ Universitaet Freiburg
# D_SYSCONFDIR - system wide configuration settings - /etc/sysconfig in SuSE
# and RedHat, /etc/default in Debian and Ubuntu
@@ -44,6 +44,8 @@ D_INITDIR="/init.d"
D_INITBOOTD="/rcS.d"
D_RCDIRS="/rc0.d /rc1.d /rc2.d /rc3.d /rc4.d /rc5.d /rc6.d"
D_INITDEFAULT="3"
+# fixme: is keymap.sh really needed? Should be handled in a simpler fashion
+# via boot.ld (see hwautocfg)
D_INITSCRIPTS="mountvirtfs udev procps.sh bootlogd keymap.sh hwclock.sh sudo dbus-1"
D_XF86CONFFILE="/etc/X11/xorg.conf"
D_XFONTPATH="/usr/X11R6/lib/X11/fonts/*"
diff --git a/initrd/distro-specs/gentoo/functions-2005.1 b/initrd/distro-specs/gentoo/functions-2005.1
index 284fd046..a28019ef 100644
--- a/initrd/distro-specs/gentoo/functions-2005.1
+++ b/initrd/distro-specs/gentoo/functions-2005.1
@@ -2,20 +2,20 @@
# linux diskless clients (executed within initial
# ramdisk after genconfig)
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 13-04-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 30-04-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
-# Version: 0.0.2a
+# Version: 0.0.2b
# distro specific stuff to initialize
preinit () {
- :
+ :
}
postinit () {
# rm -rf /mnt/etc/runlevels/default/*
-:
+ :
}
# distro specific general function called from servconfig script
@@ -157,9 +157,7 @@ if [ "x$start_snmp" = "xyes" ] ; then
# configure X display manager (runlevel links and kind of manager)
config_xdm () {
if [ -f /mnt/etc/${D_INITDIR}/xdm ] ; then
- sed -e "s,DISPLAYMANAGER=.*,DISPLAYMANAGER=\"xdm\"," /mnt/etc/rc.conf \
- > /etc/rc.conf
- cp /etc/rc.conf /mnt/etc/rc.conf
+ sed -e "s,DISPLAYMANAGER=.*,DISPLAYMANAGER=\"xdm\"," -i /mnt/etc/rc.conf
ln -s /etc/${D_INITDIR}/xdm /mnt/etc/runlevels/boot/xdm
ln -s /etc/${D_INITDIR}/xdm /mnt/etc/runlevels/default/xdm
echo "xdm" >> /mnt/etc/runlevels/boot/.critical
@@ -170,15 +168,13 @@ fi
config_rc_entry () {
local var=$1
local value=$2
-sed -e "s,$var=.*,$var=\"$value\"," /mnt/etc/rc.conf \
- > /etc/rc.conf
-cp /etc/rc.conf /mnt/etc/rc.conf
+sed -e "s,$var=.*,$var=\"$value\"," -i /mnt/etc/rc.conf
}
# configure gdm
config_gdm () {
config_rc_entry "DISPLAYMANAGER" "gdm"
-# fixmee!! check for needed directories and permissions
+# fixme!! check for needed directories and permissions
#testmkd /mnt/var/lib/gdm
#testmkd /mnt/var/log/gdm
#strinfile "gdm:" /mnt/etc/passwd || echo "gdm:x:50:15:Gnome Display Manager \
@@ -210,8 +206,7 @@ config_rc_entry "CONSOLEFONT" "${CONSOLE_FONT}"
config_acpi () {
rllinker acpid
# remove dependencies (runs unneeded services ...)
-sed "/depend/,/}/d" /mnt/etc/${D_INITDIR}/acpid > /etc/rls
-cp /etc/rls /mnt/etc/${D_INITDIR}/acpid
+sed "/depend/,/}/d" -i /mnt/etc/${D_INITDIR}/acpid
}
# configure dbus (inter application communication for kde and gnome), hal
@@ -265,5 +260,22 @@ rllinker "ypbind"
config_vmware () {
rllinker "vmware-prep"
rllinker "vmware"
+# during vmware sessions linux should not handle usb events/devices
+testmkd /mnt/var/X11R6/bin
+echo '#!/bin/sh'>> /mnt/etc/udev/rules.d/01-udev-vm.rules
+echo -e "# Script for blocking linux from handling usb \
+devices\n# during vmware sessions. If you like to remove certain modules \
+add them\n# to the list below - Dirk von Suchodoletz, <dirk@goe.net>\n\
+STATE=1\nps aux|grep -i vmware|grep -v \"grep\" &>/dev/null && { STATE=0; \
+/sbin/rmmod usb-storage &>/tmp/null; }\n\
+[ x$ACTION = xremove ] && { [ $STATE = 0 ] && /sbin/rmmod usb-storage \
+&>/dev/null; }\nexit \$STATE" > /mnt/var/X11R6/bin/vm-udev
+chmod u+x /mnt/var/X11R6/bin/vm-udev
+echo -e "# special entry to block linux from reacting to usb events during \
+running\n# vmware sessions, generated by $0 during initramfs\n# Dirk von \
+Suchodoletz, <dirk@goe.net>\nSUBSYSTEM==\"usb\", ACTION==\"add\", \
+PROGRAM=\"/var/X11R6/bin/vm-udev\", OPTIONS=\"ignore_device\"\n\
+SUBSYSTEM==\"usb\", ACTION==\"remove\", PROGRAM=\"/var/X11R6/bin/vm-udev\"" \
+ >> /mnt/etc/udev/rules.d/01-udev-vm.rules
}
diff --git a/initrd/distro-specs/suse/functions-10.0 b/initrd/distro-specs/suse/functions-10.0
index 5dc40141..1d53cda6 100644
--- a/initrd/distro-specs/suse/functions-10.0
+++ b/initrd/distro-specs/suse/functions-10.0
@@ -34,12 +34,8 @@ return $result
# acpi and powersave have changed
config_acpi () {
-local start_acpi=10
-local stop_acpi=12
-local start_powersave=11
-local stop_powersave=11
-rllinker acpid "$start_acpi" "$stop_acpi"
-rllinker powersaved "$start_powersave" "$stop_powersave"
+rllinker acpid "10" "12"
+rllinker powersaved "11" "11"
}
# configure dbus (inter application communication for kde and gnome), hal
diff --git a/initrd/distro-specs/suse/functions-9.3 b/initrd/distro-specs/suse/functions-9.3
index d3573ce0..1fd2ab6d 100644
--- a/initrd/distro-specs/suse/functions-9.3
+++ b/initrd/distro-specs/suse/functions-9.3
@@ -4,7 +4,7 @@
# functions file). This file is the main base for the
# following SuSE distributions
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, /28-04-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 30-04-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
@@ -70,8 +70,6 @@ done
# second stop
# function for ntp configuration
config_ntp () {
-local start="07"
-local stop="14"
if [ -f /mnt/etc/${D_INITDIR}/ntp ] ; then
if ! strinfile "ntp:" /mnt/etc/passwd ; then
echo -e "ntp:x:74:65534:NTP daemon:/var/lib/ntp:/bin/false" \
@@ -85,7 +83,7 @@ if [ -f /mnt/etc/${D_INITDIR}/ntp ] ; then
hwclock &>/dev/null && hwclock -w;} ) &" \
>>/mnt/etc/${D_INITDIR}/boot.ld
elif [ "x$start_ntp" = "xyes" ] ; then
- rllinker "ntp" "$start" "$stop"
+ rllinker "ntp" "07" "14"
fi
fi
}
@@ -190,9 +188,9 @@ chown 50:15 /mnt/var/lib/gdm /mnt/var/log/gdm
chmod 0750 /mnt/var/lib/gdm /mnt/var/log/gdm
xdmcp_hosts=`echo $x_display_manager|sed -e "s; ;,;"`
if [ "${DEBUGLEVEL}" -gt 0 ] ; then
- debug="true"
+ local debug="true"
else
- debug="false"
+ local debug="false"
fi
echo -e "# /etc/opt/gnome/gdm/gdm.conf - file generated by $0\n\
[daemon]
@@ -322,9 +320,7 @@ sed -e "s,RC_LANG=.*,RC_LANG=\"${LANG}\" # added in initrd," \
# acpi and powersave
config_acpi () {
- local start_powersave=10
- local stop_powersave=12
- rllinker powersaved "$start_powersave" "$stop_powersave"
+ rllinker powersaved "10" "12"
}
# configure dbus (inter application communication for kde and gnome), hal
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg
index 75470349..14e40345 100755
--- a/initrd/initrd-stuff/bin/hwautocfg
+++ b/initrd/initrd-stuff/bin/hwautocfg
@@ -4,12 +4,12 @@
# script for linux diskless clients, using hwconfig from
# knoppix as base tool
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 09-04-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 01-05-2006
# Felix Endres
#
# Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg
#
-# Version: 0.3.2a
+# Version: 0.3.2b
# local functions used within hwautocfg
displaysetup () {
@@ -49,12 +49,28 @@ local InputMouseDef='\tIdentifier "Mouse1"\n
\tOption\t\t"Emulate3Buttons"\n
\tOption\t\t"ZAxisMapping"\t\t"4 5"\n
\tOption\t\t"Buttons"\t\t"3"'
+local InputMouseSyn='\tIdentifier "Mouse1"\n
+\tDriver\t\t"synaptics"\n
+\tOption\t\t"Protocol"\t\t"auto-dev"\n
+\tOption\t\t"Device"\t\t"/dev/psaux"\n
+\tOption\t\t"LeftEdge"\t\t"1700"\n
+\tOption\t\t"RightEdge"\t\t"5300"\n
+\tOption\t\t"TopEdge"\t\t"1700"\n
+\tOption\t\t"BottomEdge"\t\t"4200"\n
+\tOption\t\t"FingerLow"\t\t"25"\n
+\tOption\t\t"FingerHigh"\t\t"30"\n
+\tOption\t\t"MaxTapTime"\t\t"180"\n
+\tOption\t\t"MaxTapMove"\t\t"220"\n
+\tOption\t\t"VertScrollDelta"\t"100"\n
+\tOption\t\t"MinSpeed"\t\t"0.06"\n
+\tOption\t\t"MaxSpeed"\t\t"0.12"\n
+\tOption\t\t"AccelFactor"\t\t"0.0010"'
local Monitor='\tIdentifier "Default"\n
\tModelName\t"MODEL"\n
-\tOption\t"CalcAlgorithm"\t"CheckDesktopGeometry"\n
+\tOption\t\t"CalcAlgorithm"\t"CheckDesktopGeometry"\n
\tHorizSync\tHS\n
\tVertRefresh\tVS\n
-\tOption\t"DPMS"\t"true"'
+\tOption\t"DPMS"\t\t"true"'
local Device='\tIdentifier\t"StdGraphics"\n
\tVendorName\t"XDESC"\n
\tDriver\t\t"XMODULE"'
@@ -63,13 +79,13 @@ local Screen='\tIdentifier\t"Screen 1"\n
\tMonitor\t\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"'
+\tScreen\t\t"Screen 1"\n
+\tInputDevice\t"Keyboard1"\t"CoreKeyboard"\n
+\tInputDevice\t"Mouse1"\t"CorePointer"\n
+\tOption\t\t"BlankTime"\t"5"\n
+\tOption\t\t"StandbyTime"\t"10"\n
+\tOption\t\t"SuspendTime"\t"20"\n
+\tOption\t\t"OffTime"\t"30"'
local DRI='\tGroup\t\t"video"\n
\tMode\t\t0666'
@@ -89,8 +105,6 @@ 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*}
@@ -132,7 +146,6 @@ established. Using default resolutions (${DEFAULTMODES})" nonfatal
fi
monmanual=yes
-
# finally write config file
echo -e "#\n# autogenerated X hardware configuration by $0\n# \
Dirk von Suchodoletz <dirk@goe.net>, $date" >$xfc
@@ -199,9 +212,12 @@ pci/agp bus needed for acceleration." ; }
echo -e "EndSection\n\nSection \"$section\"" >>$xfc
# if special synaptics touchpad was detected and specific driver
# is present
- # strinfile " synaptics " /tmp/hwsetup.info
- # synaptics_drv.o
- echo -e $InputMouseDef >>$xfc
+ if strinfile "synaptics" /tmp/hwsetup.info && \
+ test -e /mnt/usr/X11R6/lib/modules/input/synaptics_drv.o ; then
+ echo -e $InputMouseSyn >>$xfc
+ else
+ echo -e $InputMouseDef >>$xfc
+ fi
;;
Screen)
echo -e ${Screen} | sed -e "s,CDP,${CDP}," >>$xfc
@@ -224,6 +240,9 @@ done
# functions common for all distros
. /etc/functions
+# functions common for all distros, messages contains all error and
+# info output (fixme!! put messages output into that file)
+. /etc/messages
# load distro specific configuration variables and functions. distro
# specific functions may overwrite functions defined in /etc/functions
. /etc/sysconfig/config
@@ -237,8 +256,7 @@ if [ -n "${D_XF86CONFFILE}" ] ; then
D_XF86CONFFILE="/mnt/${D_XF86CONFFILE}"
else
D_XF86CONFFILE="/mnt/etc/X11/xorg.conf"
- error " You should define the variable D_XF86CONFFILE in yours distro \
-configuration\n file" nonfatal
+ error "$hcfg_xcfg" nonfatal
fi
# USB core is needed for presence of /proc/bus/usb
@@ -251,7 +269,8 @@ DRIVERLIST=" disabled unknown ignore pcspkr synaptics keybdev kanotix\
${D_HWMODTOIGNORE} "
# driver blacklist (real modules which fail to load)
DRIVERLIST=${DRIVERLIST}"hw_random genericwheelusb "
-# hack for pseudo modules (not to load)
+# 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
@@ -290,8 +309,9 @@ for DRIVER in cmd64x hpt366 piix slc90e66 cs5520 it821x rz1000 \
modprobe ${MODPRV} ${DRIVER} &
DRIVERLIST="${DRIVERLIST} ${DRIVER}"; }
done
-# check for IDE/SCSI (SATA) - incomplete list
-for DRIVER in ata_piix sata_via sata_nv sata_sil sata_sis; do
+# check for IDE/SCSI (SATA)
+for DRIVER in ata_piix sata_via sata_nv sata_sil sata_sis sata_svw \
+ sata_sx4 sata_uli sata_vsc sata_qstor sata_promise sata_mv; do
strinfile " ${DRIVER}" /tmp/hwsetup.info && {
#SCSIIDE="yes"
modprobe ${MODPRV} ${DRIVER} &
@@ -392,11 +412,11 @@ if [ -z "${KEYTABLE}" ] ; then
'${DEFKEYTABLE}' defined\nin $0."
KEYTABLE=${DEFKEYTABLE}
fi
+# keytable will be loaded during early init process
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
+. /etc/sysconfig/xserver >/dev/null 2>&1 || error "$hcfg_hwsetup" nonfatal
( displaysetup /etc/xorg.conf; echo "ready" > /tmp/xready ) &
# wait for completion of clients root filesystem in /mnt
diff --git a/initrd/initrd-stuff/etc/messages b/initrd/initrd-stuff/etc/messages
index d504d806..17d0c53a 100644
--- a/initrd/initrd-stuff/etc/messages
+++ b/initrd/initrd-stuff/etc/messages
@@ -3,11 +3,11 @@
# version 4
# this file could be used for localization of error messages
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 05-04-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 01-05-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
-# Version: 0.0.3c
+# Version: 0.0.3d
# messages from init
init_errmsg="functions file contains a lot of script \
@@ -133,3 +133,8 @@ variable \${automnt_dir} appropriately in\n machine-setup file."
# messages from servconfig
scfg_nfs=" Mount of some NFS source failed ..."
+# messages from hwautocfg
+hcfg_xcfg=" You should define the variable D_XF86CONFFILE in yours distro \
+configuration\n file"
+hcfg_hwsetup=" The xserver configuration file generated by hwsetup could \
+not\n be found."
diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init
index 92bc253d..fabda00f 100755
--- a/initrd/initrd-stuff/init
+++ b/initrd/initrd-stuff/init
@@ -2,11 +2,11 @@
# Description: main script for new type of initial ramdisk for
# linux diskless clients version 4
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 12-04-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 01-05-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
-# Version: 0.2.4e
+# Version: 0.2.4f
# functions common for all distros, messages contains all error and info
# output
@@ -53,6 +53,8 @@ udev_hotplug
TMPFSSIZE="50%"
COWSIZE="50%"
RWDIR=/dev/shm
+# switch off the several configuration methods, will be switched on
+# according to kernel commandline settings
echo "noldap" > /tmp/ldap-done
echo "nodhcp" > /tmp/dhcp-done
echo "nofile" > /tmp/file-done
@@ -67,46 +69,52 @@ for opts in ${KCMDLINE} ; do
echo -e "\n# localization information gotten via kernel command line \
in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup
;;
- # single token for debugging
+ # single token for debugging ...
debug)
DEBUGLEVEL=1;;
- # debug level
+ # ... or a specified debug level
debug=*)
DEBUGLEVEL=${opts#debug=}
# Handle empty, extremly large or non-numeric input
[ -z "$DEBUGLEVEL" ] && DEBUGLEVEL=0
- [[ "101" < "$DEBUGLEVEL" ]]; DEBUGLEVEL=100
- ;;
+ #[[ "101" < "$DEBUGLEVEL" ]] && DEBUGLEVEL=100
+ ;;
# if configuration should be gathered by dhcp client
dhcp)
DHCP="yes"
- rm /tmp/dhcp-done;;
+ rm /tmp/dhcp-done
+ ;;
# if ldap configuration should be triggered
ldap)
LDAP="yes"
- rm /tmp/ldap-done;;
+ rm /tmp/ldap-done
+ ;;
# ldap configuration with host and port to contact (base)
ldap*)
LDAP="yes"
- rm /tmp/ldap-done;;
+ rm /tmp/ldap-done
+ ;;
# if (external, via tftp) configuration file retrieval should
# be triggered, if no source is given try dhcp server and
# predefined standard path
file)
FILE="yes"
- rm /tmp/file-done;;
+ rm /tmp/file-done
+ ;;
# file source with tftp server and file location on the server
file*)
FILE="yes"
FILESRC=${opts#file=}
- rm /tmp/file-done;;
+ rm /tmp/file-done
+ ;;
# if ld.so.cache should not be generated
noldsc)
NOLDSC=yes;;
# additional source to unify root filesystem with
union=*)
UNIONFS=1
- UNIONDIRS=${opts#union=};;
+ UNIONDIRS=${opts#union=}
+ ;;
# if unionfs should be used
unionfs)
UNIONFS=1;;
@@ -115,18 +123,20 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup
cowloop*)
COWLOOP=1
#COWSIZE=${opts#cowloop=}
- ;;
+ ;;
# dnbd server:port
dnbdroot=*)
NBD=dnbd # name of kernel module
- NBDOPT=${opts#dnbdroot=};;
+ NBDOPT=${opts#dnbdroot=}
+ ;;
+ # size of cache dnbd should use within ram
dcsize=*)
- # size of cache dnbd should use within ram
DNBDCACHESIZE=${opts#dcsize=};;
# nbd server:port,filesystem (filesystem is optional)
nbdroot=*)
NBD=nbd # name of kernel module
- NBDOPT=${opts#nbdroot=};;
+ NBDOPT=${opts#nbdroot=}
+ ;;
# ip configuration client-ip:server-ip:gateway:netmask
ip=*)
IPINFO=${opts#ip=};;