Subversion Repositories livecd

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 beyerle@PS 1
#!/bin/bash
2
#
3
# Fix things during bootup - run very first 
4
# Executed at the begining of /etc/rc.d/rc.sysinit
5
#
169 beyerle@PS 6
# Urs Beyerle
1 beyerle@PS 7
#
8
 
9
### definitions
10
 
11
# dir of mounted /$MOUNTDIR/live
12
MOUNTDIR=livecd
13
 
14
# source functions
15
. /$MOUNTDIR/live/liblinuxlive
16
. /etc/init.d/functions
17
 
259 beyerleu 18
 
1 beyerle@PS 19
### get boot parameters
20
 
21
# root on NFS?
22
NFSROOT=$( cmdline_value nfsroot )
23
 
259 beyerleu 24
# kernel modules for blacklist?
25
BLACKLIST=$( cmdline_value blacklist )
1 beyerle@PS 26
 
259 beyerleu 27
# disable udev hotplug?
28
NOHOTPLUG=$( cmdline_parameter nohotplug )
29
 
30
 
28 beyerle@PS 31
### create /srv and /selinux
32
mkdir -p /srv
33
mkdir -p /selinux
34
 
35
 
259 beyerleu 36
### blacklist file
37
[ -e /etc/hotplug/blacklist ]    && BLACKLIST_FILE=/etc/hotplug/blacklist
38
[ -e /etc/modprobe.d/blacklist ] && BLACKLIST_FILE=/etc/modprobe.d/blacklist
39
 
40
 
1 beyerle@PS 41
### put wireless kernel module on blacklist, if boot over NFS
42
#   we don't need to load wireless modules, if we boot over network 
43
if [ $NFSROOT ]; then
44
 
45
    echo "Disable probing for wireless modules on diskless client"
259 beyerleu 46
    cp -a ${BLACKLIST_FILE} ${BLACKLIST_FILE}.ori
1 beyerle@PS 47
    echo >> ${BLACKLIST_FILE}
48
    echo "# Disable wireless modules on diskless client" >> ${BLACKLIST_FILE}
49
 
50
    # for SL4
51
    if [ -e /etc/hotplug/blacklist ]; then
52
	find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
53
	    basename $module | cut -d"." -f 1
54
	done >> ${BLACKLIST_FILE}
55
    fi
56
 
57
    # for SL5
58
    if [ -e /etc/modprobe.d/blacklist ]; then
59
	find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
60
	    echo -n "blacklist "; basename $module | cut -d"." -f 1
61
	done >> ${BLACKLIST_FILE}
62
    fi
63
fi
64
 
259 beyerleu 65
 
66
### blacklist kernel modules
67
if [ -n $BLACKLIST ]; then
68
    cp -a ${BLACKLIST_FILE} ${BLACKLIST_FILE}.ori
262 beyerleu 69
    echo                                       >> ${BLACKLIST_FILE}
70
    echo "# Added by boot parameter of LiveCD" >> ${BLACKLIST_FILE}
259 beyerleu 71
    for module in `echo "$BLACKLIST" | tr ':' ' '`; do
262 beyerleu 72
	echo "blacklist $module"               >> ${BLACKLIST_FILE}
259 beyerleu 73
    done
74
fi
75
 
76
 
77
### disable udev hotplug - may make the system unusable
261 beyerleu 78
[ -e /lib/udev/udev_run_hotplugd ] && HOTPLUG_FILE=/lib/udev/udev_run_hotplugd   # SL5
259 beyerleu 79
 
80
if [ $NOHOTPLUG ] && [ $HOTPLUG_FILE ]; then
81
    mv ${HOTPLUG_FILE} ${HOTPLUG_FILE}.ori
82
    touch ${HOTPLUG_FILE}
83
    chmod 755 ${HOTPLUG_FILE}
84
fi