Subversion Repositories livecd

Rev

Rev 28 | Blame | Last modification | View Log | Download | RSS feed

#!/bin/bash
#
# Fix things during bootup - run very first 
# Executed at the begining of /etc/rc.d/rc.sysinit
#
# Urs Beyerle
#

### definitions

# dir of mounted /$MOUNTDIR/live
MOUNTDIR=livecd

# source functions
. /$MOUNTDIR/live/liblinuxlive
. /etc/init.d/functions

### get boot parameters

# root on NFS?
NFSROOT=$( cmdline_value nfsroot )


### create /srv and /selinux
mkdir -p /srv
mkdir -p /selinux


### put wireless kernel module on blacklist, if boot over NFS
#   we don't need to load wireless modules, if we boot over network 
if [ $NFSROOT ]; then
    [ -e /etc/hotplug/blacklist ] && BLACKLIST_FILE=/etc/hotplug/blacklist
    [ -e /etc/modprobe.d/blacklist ] && BLACKLIST_FILE=/etc/modprobe.d/blacklist

    echo "Disable probing for wireless modules on diskless client"
    cp -a ${BLACKLIST_FILE} ${BLACKLIST_FILE}.backup
    echo >> ${BLACKLIST_FILE}
    echo "# Disable wireless modules on diskless client" >> ${BLACKLIST_FILE}

    # for SL4
    if [ -e /etc/hotplug/blacklist ]; then
        find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
            basename $module | cut -d"." -f 1
        done >> ${BLACKLIST_FILE}
    fi

    # for SL5
    if [ -e /etc/modprobe.d/blacklist ]; then
        find /lib/modules/$( uname -r )/kernel/drivers/net/wireless -type f | grep -v "_" | while read module; do 
            echo -n "blacklist "; basename $module | cut -d"." -f 1
        done >> ${BLACKLIST_FILE}
    fi
fi