# Description: configuration functions for SuSE 10.1 which differ from # functions defined in general SuSE base definitions ... # General changes should be done there, version specific # changes for the 10.1 here. # # Author(s): Dirk von Suchodoletz , 08-07-2006 # # Copyright: (c) 2006 - RZ Universitaet Freiburg # # Version: 0.3.0b # some specific stuff to initialize preinit () { # fake the existence of some helper binaries (which are not of any use # within initialramfs) for i in usb_id scsi_id vol_id edd_id ata_id path_id hwup ifup ; do echo -e "#!/bin/sh\n:" >/sbin/$i done mkdir /lib/udev /usr/sbin for i in idedma.sh mount.sh rename_netiface create_floppy_devices ; do echo -e "#!/bin/sh\n:" >/lib/udev/$i done echo -e "#!/bin/sh\n:" >/usr/sbin/alsactl chmod u+x /sbin/* /lib/udev/* /usr/sbin/* } # udev service udev_hotplug () { local result=0 echo "Starting udev" # might be used if busybox is available #mknod /dev/console c 5 1 #mknod /dev/null c 1 3 #mknod /dev/kmsg c 1 11 if [ -x /bin/udevd ] ; then echo "" > /proc/sys/kernel/hotplug udevd --daemon || result=1 trigger_device_events usleep 50 else error "$df_errudev" nonfatal fi return $result } # acpi and powersave config_acpi () { rllinker acpid "10" "12" rllinker powersaved "11" "11" } # prepare virtual machine environment (vmware, vmplayer) config_vmware () { rllinker "vmware-prep" "18" "02" rllinker "vmware" "20" "02" sed -e "s,TARGETS =,TARGETS = vmware-prep," \ /mnt/etc/${D_INITDIR}/.depend.start >> /etc/.depend.start echo "vmware-prep: " >> /etc/.depend.start cp /etc/.depend.start /mnt/etc/${D_INITDIR}/.depend.start # during vmware sessions linux should not handle usb events/devices testmkd /mnt/var/X11R6/bin echo '#!/bin/sh'> /mnt/var/X11R6/bin/vm-udev 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, \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, \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 }