Subversion Repositories livecd

Rev

Rev 38 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 38 Rev 48
Line 12... Line 12...
12
# - add SATA to modprobe_usb_modules -> modprobe_usb_sata_modules
12
# - add SATA to modprobe_usb_modules -> modprobe_usb_sata_modules
13
# - add fscache (for SL5) 
13
# - add fscache (for SL5) 
14
# - add ide-cd, sr_mod, cdrom (for SL5 cdrom support)
14
# - add ide-cd, sr_mod, cdrom (for SL5 cdrom support)
15
# - add aufs (unionfs replacement)
15
# - add aufs (unionfs replacement)
16
# - to allow LiveCD mounted over NFS (for diskless client)
16
# - to allow LiveCD mounted over NFS (for diskless client)
-
 
17
# - add functions get_dhcp_lease() and load_network_modules()
17
#
18
#
18
 
19
 
19
# ===========================================================
20
# ===========================================================
20
# user interface functions
21
# user interface functions
21
# ===========================================================
22
# ===========================================================
Line 433... Line 434...
433
   FSTAB="$1/etc/fstab"
434
   FSTAB="$1/etc/fstab"
434
   echo "tmpfs            /                tmpfs       defaults         0   0" >$FSTAB
435
   echo "tmpfs            /                tmpfs       defaults         0   0" >$FSTAB
435
   echo "devpts           /dev/pts         devpts      gid=5,mode=620   0   0" >>$FSTAB
436
   echo "devpts           /dev/pts         devpts      gid=5,mode=620   0   0" >>$FSTAB
436
   echo "proc             /proc            proc        defaults         0   0" >>$FSTAB
437
   echo "proc             /proc            proc        defaults         0   0" >>$FSTAB
437
 
438
 
438
   # now done by fstab-sync
-
 
439
   # list_cdrom_devices | while read DEVICE; do
-
 
440
   #   MOUNTDIR="/mnt/`basename $DEVICE`_cdrom"
-
 
441
   #   mkdir -p $1/$MOUNTDIR
-
 
442
   #   echo "$DEVICE $MOUNTDIR iso9660 noauto,users,exec 0 0" >>$FSTAB
-
 
443
   # done
-
 
444
 
-
 
445
   # now done in runlast
-
 
446
   # # should we auto mount all found devices?
-
 
447
   # if [ "`cmdline_parameter automount`" ]; then
-
 
448
   #    MOUNTOPT="auto,users"
-
 
449
   # else
-
 
450
   #    MOUNTOPT="noauto,users,ro"
-
 
451
   # fi
-
 
452
 
-
 
453
   # list_partition_devices | while read DEVICE; do
439
   # all the rest will be done by runlast or by fstab-sync
454
   #    unset REMOVABLE; DEV="`basename $DEVICE`"; DEV0="`echo $DEV | cut -b 1-3`"
-
 
455
   #    if [ "`cat /sys/block/$DEV0/removable`" != "0" ]; then
-
 
456
   #      REMOVABLE="_removable"
-
 
457
   #   fi
-
 
458
 
-
 
459
   #   # skip this device if mountpoint exists
-
 
460
   #   MOUNTDIR="/mnt/$DEV$REMOVABLE"
-
 
461
   #   if [ -d "$1/$MOUNTDIR" ]; then continue; fi
-
 
462
 
-
 
463
   #   # try to mount the device and unmount it. If OK, we can add it to fstab
-
 
464
   #   mount_device "$DEVICE" "$1/$MOUNTDIR"
-
 
465
   #   umount "$1/$MOUNTDIR" 2>/dev/null
-
 
466
   #   if [ $? -eq 0 ]; then
-
 
467
   #      # noauto,nousers (default)
-
 
468
   #      echo "$DEVICE $MOUNTDIR auto $MOUNTOPT,suid,dev,exec 0 0" >>$FSTAB
-
 
469
   #   else # remove empty directory
-
 
470
   #      rmdir "$1/$MOUNTDIR" 2>/dev/null
-
 
471
   #   fi
-
 
472
   # done
-
 
473
   
-
 
474
   # search for SWAP done later in /etc/rc.sysinit
440
   # search for SWAP done later in /etc/rc.sysinit
475
   # fdisk -l 2>/dev/null | grep -i "Linux swap" | egrep "^/dev/" \
-
 
476
   #   | cut -f 1 -d " " | sed -r "s/(.+)/\\1 swap swap defaults 0 0/" >>$FSTAB
-
 
477
 
-
 
478
   # now done by fstab-sync
-
 
479
   # echo "/dev/fd0 /mnt/floppy auto noauto,users,suid,dev,exec 0 0" >>$FSTAB
-
 
480
   # mkdir -p $1/mnt/floppy
-
 
481
}
441
}
482
 
442
 
-
 
443
 
-
 
444
# ===========================================================
-
 
445
# functions used for LiveCD on NFS 
-
 
446
# ===========================================================
-
 
447
 
483
# load network modules, if NFSROOT is set
448
# load network modules, if NFSROOT is set
484
# Urs Beyerle, PSI
449
# Urs Beyerle, PSI
-
 
450
#
485
load_network_modules()
451
load_network_modules()
486
{
452
{
487
    # mii maybe need by NIC
453
    # mii maybe need by NIC
488
    echolog "load module mii"
454
    echolog "load module mii"
489
    modprobe_module mii
455
    modprobe_module mii
Line 511... Line 477...
511
    fi
477
    fi
512
}
478
}
513
 
479
 
514
# get DHCP lease
480
# get DHCP lease
515
# Urs Beyerle, PSI
481
# Urs Beyerle, PSI
-
 
482
#
516
get_dhcp_lease()
483
get_dhcp_lease()
517
{
484
{
518
    # create /dev/urandom (needed by udhcpc)
485
    # create /dev/urandom (needed by udhcpc)
519
    mknod /dev/urandom c 1 9
486
    mknod /dev/urandom c 1 9
520
    echolog "Try to get DHCP lease on eth0"
487
    echolog "Try to get DHCP lease on eth0"