Subversion Repositories livecd

Rev

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

Rev 170 Rev 173
Line 477... Line 477...
477
   # 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
478
   # search for SWAP done later in /etc/rc.sysinit
478
   # search for SWAP done later in /etc/rc.sysinit
479
}
479
}
480
 
480
 
481
 
481
 
482
# find partition and/or folder taht stores the changes
482
# find partition and/or folder that stores the changes
483
# return false, if changes not set or changes folder/partition not found
483
# return false, if changes not set or changes folder/partition not found
484
find_changes()
484
find_changes()
485
{
485
{
-
 
486
    echolog "looking for changes on $CHANGESVAL"
486
 
487
 
487
    CHANGESDEV="`echo "$CHANGESVAL" | egrep -o "^/dev/[^/]+"`"
488
    CHANGESDEV="`echo "$CHANGESVAL" | egrep -o "^/dev/[^/]+"`"
488
    CHANGESFOLDER="`echo "$CHANGESVAL" | sed -r 's:^/dev/[^/]+(.*):\1:'`"
489
    CHANGESFOLDER="`echo "$CHANGESVAL" | sed -r 's:^/dev/[^/]+(.*):\1:'`"
489
    # (re-)define CHANGES if CHANGESFOLDER is set
490
    # (re-)define CHANGES if CHANGESFOLDER is set
490
    if [ "$CHANGESFOLDER" != "" ]; then CHANGES=$MEMORY/$CHANGESFOLDER; fi
491
    if [ "$CHANGESFOLDER" != "" ]; then CHANGES=$MEMORY/$CHANGESFOLDER; fi
491
 
492
 
492
    # we may need usb sata support
493
    # we may need usb and sata support
493
    modprobe_usb_sata_modules
494
    modprobe_usb_sata_modules
494
 
495
 
495
    # device defined?
496
    # device defined?
496
    if [ "$CHANGESDEV" != "" ]; then
497
    if [ "$CHANGESDEV" != "" ]; then
497
	mount_device $CHANGESDEV $MEMORY
498
	mount_device $CHANGESDEV $MEMORY
Line 500... Line 501...
500
    
501
    
501
    # if no device is specified, search all devices for folder CHANGESFOLDER
502
    # if no device is specified, search all devices for folder CHANGESFOLDER
502
    list_block_devices | while read DEVICE; do
503
    list_block_devices | while read DEVICE; do
503
	mount_device $DEVICE $MEMORY
504
	mount_device $DEVICE $MEMORY
504
	if [ $? -ne 0 ]; then continue; fi
505
	if [ $? -ne 0 ]; then continue; fi
505
	FOUND_FOLDER=`ls -A1d $MEMORY/$CHANGESFOLDER | head -n 1`
506
	FOUND_FOLDER=`ls -1d $MEMORY/$CHANGESFOLDER 2>/dev/null`
506
	if [ "$FOUND_FOLDER" = "" ]; then 
507
	if [ "$FOUND_FOLDER" = "" ]; then 
507
	    umount $MEMORY 2>/dev/null
508
	    umount $MEMORY 2>/dev/null
508
	else
509
	else
509
	    echo "found folder $CHANGESFOLDER on $DEVICE"
510
	    echo "found folder $CHANGESFOLDER on $DEVICE"
510
	    return
511
	    return