summaryrefslogtreecommitdiffstats
path: root/initramfs/distro-specs/suse/functions-10.0
blob: b67df02bfd8d0e9df896a3b20e19764b8897d1cc (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
# Copyright (c) 2003 - 2006 - RZ Uni Freiburg
# Copyright (c) 2006, 2007 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your feedback to feedback@openslx.org
#
# General information about OpenSLX can be found under http://openslx.org
#
# Configuration functions for SuSE 10.0 which differ from functions defined
# in general SuSE base definitions ...  General changes should be done there,
# version specific changes for the version 10.0 go here.

# prepare virtual machine environment (vmware, vmplayer)
config_vmware () {
rllinker "vmware" 20 2
# 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 - OpenSLX.ORG Project, <openslx-users@openslx.org>\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# OpenSLX \
Project, <openslx-users@openslx.org>\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
}
# secure shell service
config_sshd () {
if [ "x$start_sshd" = "xyes" ] ; then
  if [ -f /mnt/etc/${D_INITDIR}/sshd ] ; then
    testmkd /mnt/var/lib/sshd
    testmkd /mnt/var/lib/empty
    if ! strinfile "sshd:" /mnt/etc/passwd ; then
      echo -e "sshd:x:71:65::/var/run/sshd:/bin/false" \
        >>/mnt/etc/passwd
      echo -e "sshd:!:13099:0:99999:7:::" >>/mnt/etc/shadow
    fi
    rllinker "sshd" 25 10
  else
    error "$df_errsshd" nonfatal
  fi
fi
}
# Xorg variable settings. Lots of stuff changes for newer Xorg servers
displayvars () {
synapticsdrv="/usr/X11R6/lib/modules/input/synaptics_drv.o"
}