Date:2010-07-01 01:09:13 (8 years 5 months ago)
Author:cshore
Commit:7bc978b32b012346bad19ee8f1481a1e63a33d37
Message:block-extroot, block-mount: Fixed multiple bugs which prevented e2fsck from being executed on the external root filesystem before mounting it as root. Added /etc/e2fsck.conf which indicates that the clock is broken (since most OpenWRT devices don't have a battery backed RTC) so that e2fsck will not exit with fatal error when the rdat has not yet been run (i.e. before network).

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22002 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: package/block-extroot/files/50_determine_usb_root (1 diff)
package/block-mount/files/fsck.sh (1 diff)
package/block-mount/files/mount.sh (2 diffs)
package/e2fsprogs/Makefile (1 diff)
package/e2fsprogs/files/e2fsck.conf (1 diff)

Change Details

package/block-extroot/files/50_determine_usb_root
44# See /LICENSE for more information.
55
66
7. /etc/functions.sh
8. /lib/functions/extmount.sh
9. /lib/functions/mount.sh
10
117determine_external_root() {
8    . /etc/functions.sh
9    . /lib/functions/extmount.sh
10    . /lib/functions/mount.sh
11
1212    local OLD_UCI_CONFIG_DIR="$UCI_CONFIG_DIR"
1313    set_jffs_mp
1414    determine_root_device
package/block-mount/files/fsck.sh
1212    local found_fsck=0
1313
1414
15    [ -n "$fsck_type" ] && [ "$fsck_type" != "swap" ] && {
16        grep -q "$device" /proc/swaps || grep -q "$device" /proc/mounts || {
17            [ -e "$device" ] && [ "$fsck_enabled" -eq 1 ] && {
18                for known_type in $libmount_known_fsck; do
19                    if [ "$known_type" = "$fsck_fstype" ]; then
20                        fsck_${known_type} "$device"
21                        found_fsck=1
22                        break
23                    fi
24                done
25                if [ "$found_fsck" -ne 1 ]; then
26                    logger -t 'fstab' "Unable to check/repair $device; no known fsck for filesystem type $fstype"
15    grep -q "$device" /proc/swaps || grep -q "$device" /proc/mounts || {
16        [ -e "$device" ] && [ "$fsck_enabled" -eq 1 ] && {
17            for known_type in $libmount_known_fsck; do
18                if [ "$known_type" = "$fsck_fstype" ]; then
19                    fsck_${known_type} "$device"
20                    found_fsck=1
21                    break
2722                fi
28            }
23            done
24            if [ "$found_fsck" -ne 1 ]; then
25                logger -t 'fstab' "Unable to check/repair $device; no known fsck for filesystem type $fstype"
26            fi
2927        }
3028    }
3129}
package/block-mount/files/mount.sh
2828        local is_rootfs="$9"
2929        shift
3030        local found_device=""
31        local fsck_type=""
3231
3332        found_device="$(libmount_find_device_by_id "$uuid" "$label" "$device" "$cfgdevice")"
3433        if [ -n "$found_device" ]; then
3534            if [ -z "$find_rootfs" ] || [ "$find_rootfs" -eq 0 ] || [ "$is_rootfs" -eq 1 ]; then
3635                [ "$enabled_fsck" -eq 1 ] && {
3736                    grep -q "$found_device" /proc/swaps || grep -q "$found_device" /proc/mounts || {
38                        libmount_fsck "$found_device" "$fsck_type" "$enabled_fsck"
37                        libmount_fsck "$found_device" "$fstype" "$enabled_fsck"
3938                    }
4039                }
4140
...... 
7271        local label
7372
7473        local found_device=""
75        local fsck_type=""
7674
7775        found_device="$(libmount_find_device_by_id "$uuid" "$label" "$device" "$cfgdevice")"
7876
package/e2fsprogs/Makefile
158158    $(INSTALL_DIR) $(1)/etc/init.d
159159    $(INSTALL_DIR) $(1)/lib/functions/fsck
160160    $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
161    $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
161162endef
162163
163164define Package/libuuid/install
package/e2fsprogs/files/e2fsck.conf
1[options]
2broken_system_clock = true
3

Archive Download the corresponding diff file



interactive