summaryrefslogtreecommitdiffstats
path: root/initramfs/distro-specs/ubuntu/functions-5.10
blob: 5edf207ec7bd94d930b409ac070fea531ae05f74 (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
# configuration script for Ubuntu V5.10 to configure OpenSLX linux diskless
# clients (merged in stage2 with ubuntu/functions-default - and loaded within
# initial ramfs - stage3) It may overwrite settings from the default config 
# file (/etc/functions)
#
# Dirk von Suchodoletz <dvs@OpenSLX.com>, 31-08-2006
# Nico Dietrich
# Felix Endres
#
# (c) 2006 - RZ Universitaet Freiburg
# (c) 2006 - OpenSLX.ORG Project


# syslog service
config_syslog () {
if [ "x$start_syslog" = "xyes" ] ; then
  echo -e "# /etc/syslog.conf - file generated by $0" >/mnt/etc/syslogd.conf
  echo "kern.warn;*.err;authpriv.none\t/dev/tty10\n\
#kern.warn;*.err;authpriv.none\t|/dev/xconsole\n\
#*.emerg\n\n*.=warn;*.=err\t\t\t-/var/log/warn\n\
#*.crit\t\t\t\t/var/log/warn\n*.*;mail.none;news.none\t\t\
#-/var/log/messages" >> /mnt/etc/syslogd.conf
#  test -n "$log_servers" && \
#  for logserver in $log_servers; do
#       echo -e "*.*;*.*;*.*;*kern.!*\t@$logserver" >>/mnt/etc/syslog.conf
#  done
  rllinker "sysklogd" "02" "18"
fi
}

# secure shell service
config_sshd () {
if [ "x$start_sshd" = "xyes" ] ; then
  if [ -f /mnt/etc/init.d/ssh ] ; then
    #testmkd /mnt/var/run/sshd
    rllinker "ssh" "12" "10"
  else
    error "$df_errsshd" nonfatal
  fi
fi
}

# snmp agent for remote monitoring
config_snmp () {
if [ "x$start_snmp" = "xyes" ] ; then
  if [ -f /mnt/etc/init.d/snmpd ] ; then
    rllinker "snmpd" "24" "02"
    testmkd /mnt/var/lib/net-snmp >/dev/null 2>&1
  fi
    # fixme!!
    # write service monitor depending on services started
fi
}

# consolefont
consolefont () {
echo -e "setfont ${CONSOLE_FONT} >${LOGFILE} 2>&1" \
  >>/mnt/etc/${D_INITDIR}/boot.slx
}
# acpi and powersave
config_acpi () {
  rllinker "acpid" "02" "19"
  rllinker "acpi-support" "20" "02"
}

# configure hal, dbus, resmgr and services like that
# fixme: complete or remove (dummy function is present in /etc/functions)
config_dreshal () {
if [ "x$start_dreshal" = "xyes" ]; then
  :
fi
}


# fixme!! taken from SuSE10.0 untested here ...
# prepare virtual machine environment (vmware, vmplayer)
config_vmware () {
rllinker "vmware-prep" "18" "02"
rllinker "vmware" "20" "02"
# 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, <dvs@OpenSLX.com>\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, <dvs@OpenSLX.com>\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
}