summaryrefslogtreecommitdiffstats
path: root/initrd/distro-specs/suse/functions-10.0
blob: 06887d7e77262058066154624d0da6f4a85bc261 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Description:  configuration functions for SuSE 10.0 which differ from
#               functions defined in general SuSE base settings ... General
#               changes should be done there, version specific changes for
#               the 10.0 here.
#
# Author(s):    Dirk von Suchodoletz <dirk@goe.net>, 24-06-2006
#
# Copyright:    (c) 2006 - RZ Universitaet Freiburg
# 
# Version:      0.3.0a

# udev service
udev_hotplug () {
local result=0
echo "Starting udev"
udevstart || result=1
if [ -x /bin/udevd ] ; then
  export UDEVD_EXPECTED_SEQNUM=$(cat /sys/kernel/hotplug_seqnum)
  export UDEVD_EVENT_TIMEOUT=1
  echo "" > /proc/sys/kernel/hotplug
  udevd --daemon || result=1
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, <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
}