Subversion Repositories livecd

Rev

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

Rev 1 Rev 37
Line 10... Line 10...
10
# - remove detect of CD and Floppy (done by fstab-sync)
10
# - remove detect of CD and Floppy (done by fstab-sync)
11
# - add sr_mod (USB CDROM support)
11
# - add sr_mod (USB CDROM support)
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)
-
 
16
# - to allow LiveCD mounted over NFS (for diskless client)
15
#
17
#
16
 
18
 
17
# ===========================================================
19
# ===========================================================
18
# user interface functions
20
# user interface functions
19
# ===========================================================
21
# ===========================================================
Line 183... Line 185...
183
# $1 = union absolute path (starting with /)
185
# $1 = union absolute path (starting with /)
184
# $2 = path to data directory
186
# $2 = path to data directory
185
#
187
#
186
union_insert_dir()
188
union_insert_dir()
187
{
189
{
188
   unionctl $1 --add --after 0 --mode ro $2
190
   unionctl "$1" --add --after 0 --mode ro "$2"
189
}
191
}
190
 
192
 
191
# List all modules in all directories (base, modules, optional)
193
# List all modules in all directories (base, modules, optional)
192
# and filter out unneeded optional modules (not specified by load= kernel parameter)
194
# and filter out unneeded optional modules (not specified by load= kernel parameter)
193
# $1 = root directory of mounted DATAdir
195
# $1 = root directory of mounted DATAdir
Line 348... Line 350...
348
   modprobe_module cdrom
350
   modprobe_module cdrom
349
   echolog "starting cdrom filesystem support"
351
   echolog "starting cdrom filesystem support"
350
   modprobe_module isofs
352
   modprobe_module isofs
351
   echolog "starting squashfs support"
353
   echolog "starting squashfs support"
352
   modprobe_module squashfs
354
   modprobe_module squashfs
353
   echolog "starting unionfs support"
355
   echolog "starting unionfs/aufs support"
354
   modprobe_module unionfs
356
   modprobe_module unionfs
-
 
357
   modprobe_module aufs
355
   echolog "starting vfat support"
358
   echolog "starting vfat support"
356
   modprobe_module nls_cp437
359
   modprobe_module nls_cp437
357
   modprobe_module nls_iso8859-1
360
   modprobe_module nls_iso8859-1
358
   modprobe_module nls_iso8859-2
361
   modprobe_module nls_iso8859-2
359
   modprobe_module vfat
362
   modprobe_module vfat
Line 469... Line 472...
469
 
472
 
470
   # now done by fstab-sync
473
   # now done by fstab-sync
471
   # echo "/dev/fd0 /mnt/floppy auto noauto,users,suid,dev,exec 0 0" >>$FSTAB
474
   # echo "/dev/fd0 /mnt/floppy auto noauto,users,suid,dev,exec 0 0" >>$FSTAB
472
   # mkdir -p $1/mnt/floppy
475
   # mkdir -p $1/mnt/floppy
473
}
476
}
-
 
477
 
-
 
478
# load network modules, if NFSROOT is set
-
 
479
# Urs Beyerle, PSI
-
 
480
load_network_modules()
-
 
481
{
-
 
482
    # mii maybe need by NIC
-
 
483
    echolog "load module mii"
-
 
484
    modprobe_module mii
-
 
485
 
-
 
486
    # detecting network card
-
 
487
    PCITABLE=/bin/pcitable
-
 
488
    NICS=`lspci -n | awk '/Class 0200/ {print $4}' | tr ':' ' ' \
-
 
489
	| while read x y ; do grep "0x$x.*0x$y" $PCITABLE \
-
 
490
	| awk '$3 !~ /"unknown"/ {print $3}' | tr -d '"' ; done`
-
 
491
    echolog "Found network card(s): $NICS"
-
 
492
    
-
 
493
    if [ -n "$NICS" ]; then
-
 
494
	echo $NICS | while read nic ; do
-
 
495
	    echo "Loading module $nic"
-
 
496
	    modprobe_module $nic
-
 
497
	done
-
 
498
    else
-
 
499
	echo "ERROR: No network card detected!"
-
 
500
	echo "Type in your network card driver (e.g. tg3, e1000). "
-
 
501
	echo "Or ask your system administrator for help."
-
 
502
	echo -n "Network card driver: "
-
 
503
	read nic
-
 
504
	echo "Loading module $nic"
-
 
505
	modprobe_module $nic
-
 
506
    fi
-
 
507
}
-
 
508
 
-
 
509
# get DHCP lease
-
 
510
# Urs Beyerle, PSI
-
 
511
get_dhcp_lease()
-
 
512
{
-
 
513
    # create /dev/urandom (needed by udhcpc)
-
 
514
    mknod /dev/urandom c 1 9
-
 
515
    echolog "Try to get DHCP lease on eth0"
-
 
516
    udhcpc --now --quit --interface=eth0 --script=/bin/udhcpc.script
-
 
517
    if [ $? -ne 0 ]; then
-
 
518
	echo "ERROR: couldn't get DHCP lease, trying again"
-
 
519
	udhcpc --now --quit --interface=eth0 --script=/bin/udhcpc.script
-
 
520
	if [ $? -ne 0 ]; then
-
 
521
	    echo "ERROR: couldn't get DHCP lease, trying eth1"
-
 
522
	    udhcpc --now --quit --interface=eth1 --script=/bin/udhcpc.script
-
 
523
	    if [ $? -ne 0 ]; then
-
 
524
		echo "ERROR: couldn't get DHCP lease, trying again eth1"
-
 
525
		udhcpc --now --quit --interface=eth1 --script=/bin/udhcpc.script
-
 
526
		if [ $? -ne 0 ]; then
-
 
527
		    echo "ERROR: can't get DHCP lease on eth0 and eth1"
-
 
528
		fi
-
 
529
	    fi
-
 
530
	fi
-
 
531
    fi
-
 
532
}
-
 
533