summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/etc/vmware-prep
blob: 9ea2f82cfb71c5ce4d605f48c0c780af1c60bb47 (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
#!/bin/sh
#
# Kernel of a generic runlevel script file for use with OpenSLX diskless
# linux machines - script prepares vmware environment. Start and stop 
# functionality is added within initialramfs
#
# Michael Janczyk <mj0@uni-freiburg.de>, 07-09-2006
# Dirk von Suchodoletz <dirk@goe.net>, 03-09-2006
#
# (c) 2003, 2006 - RZ Universitaet Freiburg
#
# Version:      0.2.359
#
#######################################################################
# set verbose mode for script debugging
#set -xv

### CONFIGURATION #####################################################
# read configuration information
#. /etc/machine-setup # not needed at the moment!

### VARIABLES SECTION #################################################
# Declaration of default variables
vmdir=/var/lib/vmware

### START SCRIPT ######################################################

modprobe loop >/dev/null 2>&1

# device creation - the module does not trigger udev properly
for i in 0 1 2 3 4 5 6 7 8 9; do
  [ -c /dev/vmnet${i} ] || mknod /dev/vmnet${i} c 119 ${i};
done
chmod 0700 /dev/vmnet*

# loop file for exchanging information between linux and vmware guest
loopsrc=/etc/vmware/loopimg
loopdst=/etc/vmware/fd-loop
mkdir -p $loopsrc
grep "unionfs" /proc/mounts >/dev/null && \
  mount -o size=1500k -t tmpfs vm-loopimg $loopsrc
mkdir -p -m a+t $loopdst
cp ${vmdir}/templ/fd1.img /$loopsrc/fd1.img
chmod a+rw /$loopsrc/fd1.img
mount -n -t msdos -o loop,umask=000 /$loopsrc/fd1.img $loopdst

# mount usbfs needed for vmware to detect usb devices
grep "/proc/bus/usb" /proc/mounts >/dev/null || \
  mount -t usbfs usbfs /proc/bus/usb