Subversion Repositories livecd

Rev

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

Rev 169 Rev 170
Line 18... Line 18...
18
# - add ata_piix to modprobe_usb_sata_modules
18
# - add ata_piix to modprobe_usb_sata_modules
19
# - works with unionfs 2.x
19
# - works with unionfs 2.x
20
# - better detection of network card in case of diskless client
20
# - better detection of network card in case of diskless client
21
# - add sg, sata_nv module
21
# - add sg, sata_nv module
22
# - to allow LiveCD mounted over CIFS (for diskless client)
22
# - to allow LiveCD mounted over CIFS (for diskless client)
-
 
23
# - add function find_changes
23
#
24
#
24
 
25
 
25
# ===========================================================
26
# ===========================================================
26
# user interface functions
27
# user interface functions
27
# ===========================================================
28
# ===========================================================
Line 318... Line 319...
318
find_live_data_dir()
319
find_live_data_dir()
319
{
320
{
320
   if [ "$NFSROOT" != "" ]; then 
321
   if [ "$NFSROOT" != "" ]; then 
321
      DIR="/$1/nfs"
322
      DIR="/$1/nfs"
322
      mkdir -p $DIR
323
      mkdir -p $DIR
323
 
-
 
324
      # disable kernel warnings
-
 
325
      PRINTK=`cat /proc/sys/kernel/printk`
-
 
326
      echo "0" >/proc/sys/kernel/printk
-
 
327
      # try to mount nfs dir
324
      # try to mount nfs dir
328
      mount -t nfs -o $NFSOPT $NFSROOT $DIR
325
      mount -t nfs -o $NFSOPT $NFSROOT $DIR
329
      # enable kernel warnings
-
 
330
      echo "$PRINTK" >/proc/sys/kernel/printk
-
 
331
   fi
326
   fi
332
 
327
 
333
   if [ "$CIFSROOT" != "" ]; then
328
   if [ "$CIFSROOT" != "" ]; then
334
      DIR="/$1/cifs"
329
      DIR="/$1/cifs"
335
      mkdir -p $DIR
330
      mkdir -p $DIR
336
 
-
 
337
      # disable kernel warnings
-
 
338
      PRINTK=`cat /proc/sys/kernel/printk`
-
 
339
      echo "0" >/proc/sys/kernel/printk
-
 
340
      # try to mount cifs dir
331
      # try to mount cifs dir
341
      mount -t cifs $CIFSROOT $DIR -o ro,$CIFSOPTS
332
      mount -t cifs $CIFSROOT $DIR -o ro,$CIFSOPTS
342
      # enable kernel warnings
-
 
343
      echo "$PRINTK" >/proc/sys/kernel/printk
-
 
344
   fi
333
   fi
345
 
334
 
346
   PRINTK=`cat /proc/sys/kernel/printk`
-
 
347
   echo "0" >/proc/sys/kernel/printk
-
 
348
   if [ "$DIR" = "" ]; then
335
   if [ "$DIR" = "" ]; then
349
       list_block_devices | while read DEVICE; do
336
       list_block_devices | while read DEVICE; do
350
	   DIR="/$1/`basename $DEVICE`"
337
	   DIR="/$1/`basename $DEVICE`"
351
	   mount_device $DEVICE $DIR
338
	   mount_device $DEVICE $DIR
352
	   if [ $? -ne 0 ]; then continue; fi
339
	   if [ $? -ne 0 ]; then continue; fi
Line 360... Line 347...
360
       FOUND=`ls -A1d $DIR/livecd.sgn $DIR/*/livecd.sgn 2>/dev/null | head -n 1`
347
       FOUND=`ls -A1d $DIR/livecd.sgn $DIR/*/livecd.sgn 2>/dev/null | head -n 1`
361
       if [ "$FOUND" != "" ]; then 
348
       if [ "$FOUND" != "" ]; then 
362
	   dirname "$FOUND"
349
	   dirname "$FOUND"
363
       fi
350
       fi
364
   fi
351
   fi
365
   echo "$PRINTK" >/proc/sys/kernel/printk	   
-
 
366
 
-
 
367
}
352
}
368
 
353
 
369
# ===========================================================
354
# ===========================================================
370
# hardware preparation functions
355
# hardware preparation functions
371
# ===========================================================
356
# ===========================================================
Line 492... Line 477...
492
   # all the rest will be done by runlast or by fstab-sync
477
   # all the rest will be done by runlast or by fstab-sync
493
   # search for SWAP done later in /etc/rc.sysinit
478
   # search for SWAP done later in /etc/rc.sysinit
494
}
479
}
495
 
480
 
496
 
481
 
-
 
482
# find partition and/or folder taht stores the changes
-
 
483
# return false, if changes not set or changes folder/partition not found
-
 
484
find_changes()
-
 
485
{
-
 
486
 
-
 
487
    CHANGESDEV="`echo "$CHANGESVAL" | egrep -o "^/dev/[^/]+"`"
-
 
488
    CHANGESFOLDER="`echo "$CHANGESVAL" | sed -r 's:^/dev/[^/]+(.*):\1:'`"
-
 
489
    # (re-)define CHANGES if CHANGESFOLDER is set
-
 
490
    if [ "$CHANGESFOLDER" != "" ]; then CHANGES=$MEMORY/$CHANGESFOLDER; fi
-
 
491
 
-
 
492
    # we may need usb sata support
-
 
493
    modprobe_usb_sata_modules
-
 
494
 
-
 
495
    # device defined?
-
 
496
    if [ "$CHANGESDEV" != "" ]; then
-
 
497
	mount_device $CHANGESDEV $MEMORY
-
 
498
	return
-
 
499
    fi 
-
 
500
    
-
 
501
    # if no device is specified, search all devices for folder CHANGESFOLDER
-
 
502
    list_block_devices | while read DEVICE; do
-
 
503
	mount_device $DEVICE $MEMORY
-
 
504
	if [ $? -ne 0 ]; then continue; fi
-
 
505
	FOUND_FOLDER=`ls -A1d $MEMORY/$CHANGESFOLDER | head -n 1`
-
 
506
	if [ "$FOUND_FOLDER" = "" ]; then 
-
 
507
	    umount $MEMORY 2>/dev/null
-
 
508
	else
-
 
509
	    echo "found folder $CHANGESFOLDER on $DEVICE"
-
 
510
	    return
-
 
511
	fi
-
 
512
    done
-
 
513
}
-
 
514
 
-
 
515
 
497
# ===========================================================
516
# ===========================================================
498
# functions used for LiveCD on NFS 
517
# functions used for LiveCD on NFS 
499
# ===========================================================
518
# ===========================================================
500
 
519
 
501
# load network modules, if NFSROOT is set
520
# load network modules, if NFSROOT is set