mkrw /etc: testing it

shaulka at 012.net.il shaulka at 012.net.il
Wed May 10 17:11:18 CEST 2006


  I finally was able to run it. I am using 2.10.

The following version of sulogin.sh seems to work:

#! /bin/sh

#set -xv # for full debugging

PATH=/usr/local/sbin:/usr/local/bin:/usr/lib/fai:/bin:/sbin:/usr/bin:/usr/sbin:
# some variables
FAI_VERSION="FAI 2.10, 3 Apr 2006"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ramdisk() {

    local    os_type sub rundir stamp

    rundir=/var/run/fai
    stamp=$rundir/FAI_INSTALLATION_IN_PROGRESS
    # the type of operating system (linux, sunos)
    os_type=$(uname -s | tr A-Z a-z)
    sub=/usr/lib/fai/subroutines

    umask 022

    [ -f "$stamp" ] && {
       echo "$0, ${FAI_VERSION}, already running. Aborting."
       exit 11
    }

    # are we called as sulogin substitute ?
    if [ "$0" = "/sbin/sulogin" -a "${os_type}" = linux ]; then
        # Solaris has already a writable /tmp directory.
        [ ! -f $sub-${os_type} ] && {
            echo "$0, ${FAI_VERSION}: Couldn't find $sub-${os_type}."
            exit 12
        }
        . ${sub}-${os_type}    &&    export  -f  mkrw mkrwsize
        create_ramdisk
    fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Main routine

echo "Beginning of $0, ${FAI_VERSION}"

if [ `id -u` -ne 0 ]; then
    echo "Run this program as root."
    exit 1
fi

# exit if we do not run from nfsroot and no parameter is given
if [ ! -f /.THIS_IS_THE_FAI_NFSROOT ]; then
    echo "$0 is only run from the nfsroot."
    exit 2
fi

ramdisk

echo "End of $0, ${FAI_VERSION}"





More information about the linux-fai-devel mailing list