summaryrefslogtreecommitdiffstats
path: root/initrd/distro-specs/suse/functions-10.1
blob: 1eb49dfd340e5beb4ae16bfa5d89324e21b8bc91 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Description:  configuration functions for SuSE 10.1 which differ from
#		functions defined for SuSE 9.3 which is base ... General
#		changes should be done there, version specific changes for
#		the 10.0 here.
#
# Author(s):    Dirk von Suchodoletz <dirk@goe.net>, 02-04-2006
#
# Copyright:    (c) 2006 - RZ Universitaet Freiburg
# 
# Version:      0.2.1e

# distro specific stuff to initialize
preinit () {
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/*
}

postinit () {
:
}


# udev service
udev_hotplug () {
local result=0
echo "Starting udev"
#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 "  udev daemon is not available. Some devices might not \
apprear." nonfatal
fi
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"
}

# configure dbus (inter application communication for kde and gnome), hal
# (hardware abstraction layer - used e.g. by powersaved) and resmgr
# (resource manager - the user gets permissions to devices when loggin on)
# runlevel script for haldaemon is now haldaemon instead of hal
config_dreshal () {
local start="05"
local stop="18"
if [ "x$start_dreshal" = "xyes" ]; then
  if [ -f /mnt/etc/${D_INITDIR}/dbus ] ; then
    strinfile "messagebus:" /mnt/etc/passwd || \
      echo "messagebus:x:100:101:User for D-BUS:/var/run/dbus:/bin/false" \
        >> /mnt/etc/passwd
    strinfile "messagebus:" /mnt/etc/group || \
      echo "messagebus:!:101:" >> /mnt/etc/group
    testmkd /mnt/var/run/dbus
    # set permissions with userid
    echo -e "\tchown messagebus:messagebus /var/run/dbus 2>/dev/null" \
      >>/mnt/etc/${D_INITDIR}/boot.ld
    rllinker "dbus" "$start" "$stop"
  fi
  if [ -f /mnt/etc/${D_INITDIR}/resmgr ] ; then
    testmkd /mnt/var/run/resmgr/classes
    start="0"`expr $start + 1`
    stop="0"`expr $start - 1`
    rllinker "resmgr" "$start" "$stop"
  fi
  if [ -f /mnt/etc/${D_INITDIR}/haldaemon ] ; then
    strinfile "haldaemon:" /mnt/etc/passwd || \
      echo "haldaemon:x:105:103:User for haldaemon:/var/run/hal:/bin/false" \
        >> /mnt/etc/passwd
    strinfile "haldaemon:" /mnt/etc/group || \
      echo "haldaemon:!:103:" >> /mnt/etc/group
    testmkd /mnt/var/run/hal
    # set permissions with userid
    echo -e "\tchown haldaemon:haldaemon /var/run/hal 2>/dev/null" \
      >>/mnt/etc/${D_INITDIR}/boot.ld
    start="0"`expr $start + 1`
    stop="0"`expr $start - 1`
    rllinker "haldaemon" "$start" "$stop"
  fi
fi
}