Changeset 3931

Show
Ignore:
Timestamp:
03/05/10 01:01:24 (2 years ago)
Author:
sumsum
Message:

improve the hotplug.d/usb/01-mount script that it tries to check ext2 filesystems before mounting with automatic reapair flag.
logging to syslog allows later check for success. Don't allow 01-mount to run before init process is complete. This ensures that date/time is set if that is ever going to be the case.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/package/base-files/Makefile

    r3846 r3931  
    1010PKG_NAME:=              base-files 
    1111PKG_VERSION:=           1.1 
    12 PKG_RELEASE:=           36 
     12PKG_RELEASE:=           37 
    1313WRKDIST=                ${WRKDIR}/base-files 
    1414NO_DISTFILES:=          1 
  • trunk/freewrt/package/base-files/files/etc/hotplug.d/usb/01-mount

    r3839 r3931  
    1313                                        [[ -e $part ]] || continue 
    1414                                        path=/mnt/${dev}_${part##*part} 
     15                                        if [ -x /usr/sbin/e2fsck ]; then 
     16                                                logger -p syslog.notice -s "Checking filesystem on ${part} ... " 
     17                                                /usr/sbin/e2fsck -p -v /dev/discs/${dev}/${part} | logger -p syslog.notice -s 
     18                                                logger -p syslog.notice -s "Filesystem on ${part} checked." 
     19                                        else 
     20                                                logger -p syslog.warn -s "Not checking filesystem on ${part}, no filesystem checker found." 
     21                                        fi 
    1522                                        mkdir -p ${path} 
    1623                                        mount ${part} ${path} 
     
    3542} 
    3643 
     44if [[ -f /tmp/.booting ]]; then 
     45  echo cd `pwd` >> /tmp/.hotplug-boot 
     46  echo export ACTION="${ACTION}" >> /tmp/.hotplug-boot 
     47  echo export INTERFACE="${INTERFACE}" >> /tmp/.hotplug-boot 
     48  echo export PRODUCT="${PRODUCT}" >> /tmp/.hotplug-boot 
     49  echo /bin/sh "$0" >> /tmp/.hotplug-boot 
     50  exit 0; 
     51fi; 
     52 
    3753if [[ ! -f /proc/bus/usb/devices ]]; then 
    3854        grep -q usbfs /proc/filesystems && mount -t usbfs none /proc/bus/usb 
  • trunk/freewrt/package/base-files/files/etc/init.d/rcS

    r3288 r3931  
    1616                ${shebang:-/bin/sh} ${line%%:*} autostart 2>&1 
    1717        done 
     18        rm -f /tmp/.booting 
     19        . /tmp/.hotplug-boot 
     20        rm /tmp/.hotplug-boot 
    1821        test -e /etc/rc.local && (/bin/sh /etc/rc.local) 2>&1 
    1922        [[ -f /proc/diag/led/power ]] && echo 1 >/proc/diag/led/power 
    20         rm -f /tmp/.booting 
    2123} | logger -s -p 6 -t '' &