Subversion Repositories livecd

Rev

Rev 28 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 169
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# Fix things during bootup - run very first 
3
# Fix things during bootup - run very first 
4
# Executed at the begining of /etc/rc.d/rc.sysinit
4
# Executed at the begining of /etc/rc.d/rc.sysinit
5
#
5
#
6
# Urs Beyerle, PSI
6
# Urs Beyerle
7
#
7
#
8
 
8
 
9
### definitions
9
### definitions
10
 
10
 
11
# dir of mounted /$MOUNTDIR/live
11
# dir of mounted /$MOUNTDIR/live
12
MOUNTDIR=livecd
12
MOUNTDIR=livecd
13
 
13
 
14
# source functions
14
# source functions
15
. /$MOUNTDIR/live/liblinuxlive
15
. /$MOUNTDIR/live/liblinuxlive
16
. /etc/init.d/functions
16
. /etc/init.d/functions
17
 
17
 
18
### get boot parameters
18
### get boot parameters
19
 
19
 
20
# root on NFS?
20
# root on NFS?
21
NFSROOT=$( cmdline_value nfsroot )
21
NFSROOT=$( cmdline_value nfsroot )
22
 
22
 
23
 
23
 
24
### create /srv and /selinux
24
### create /srv and /selinux
25
mkdir -p /srv
25
mkdir -p /srv
26
mkdir -p /selinux
26
mkdir -p /selinux
27
 
27
 
28
 
28
 
29
### put wireless kernel module on blacklist, if boot over NFS
29
### put wireless kernel module on blacklist, if boot over NFS
30
#   we don't need to load wireless modules, if we boot over network 
30
#   we don't need to load wireless modules, if we boot over network 
31
if [ $NFSROOT ]; then
31
if [ $NFSROOT ]; then
32
    [ -e /etc/hotplug/blacklist ] && BLACKLIST_FILE=/etc/hotplug/blacklist
32
    [ -e /etc/hotplug/blacklist ] && BLACKLIST_FILE=/etc/hotplug/blacklist
33
    [ -e /etc/modprobe.d/blacklist ] && BLACKLIST_FILE=/etc/modprobe.d/blacklist
33
    [ -e /etc/modprobe.d/blacklist ] && BLACKLIST_FILE=/etc/modprobe.d/blacklist
34
 
34
 
35
    echo "Disable probing for wireless modules on diskless client"
35
    echo "Disable probing for wireless modules on diskless client"
36
    cp -a ${BLACKLIST_FILE} ${BLACKLIST_FILE}.backup
36
    cp -a ${BLACKLIST_FILE} ${BLACKLIST_FILE}.backup
37
    echo >> ${BLACKLIST_FILE}
37
    echo >> ${BLACKLIST_FILE}
38
    echo "# Disable wireless modules on diskless client" >> ${BLACKLIST_FILE}
38
    echo "# Disable wireless modules on diskless client" >> ${BLACKLIST_FILE}
39
 
39
 
40
    # for SL4
40
    # for SL4
41
    if [ -e /etc/hotplug/blacklist ]; then
41
    if [ -e /etc/hotplug/blacklist ]; then
42
	find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
42
	find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
43
	    basename $module | cut -d"." -f 1
43
	    basename $module | cut -d"." -f 1
44
	done >> ${BLACKLIST_FILE}
44
	done >> ${BLACKLIST_FILE}
45
    fi
45
    fi
46
 
46
 
47
    # for SL5
47
    # for SL5
48
    if [ -e /etc/modprobe.d/blacklist ]; then
48
    if [ -e /etc/modprobe.d/blacklist ]; then
49
	find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
49
	find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
50
	    echo -n "blacklist "; basename $module | cut -d"." -f 1
50
	    echo -n "blacklist "; basename $module | cut -d"." -f 1
51
	done >> ${BLACKLIST_FILE}
51
	done >> ${BLACKLIST_FILE}
52
    fi
52
    fi
53
fi
53
fi
54
 
54