busybox-initramfs: optimize disk check function in init script

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-09-17 14:43:51 +02:00
parent f26a86e0bd
commit 07610579a1

View File

@ -79,7 +79,7 @@ REBOOT="0"
break
else
if [ -f "/sbin/ply-image" ]; then
/sbin/ply-image "$SPLASHIMAGE"
/sbin/ply-image "$SPLASHIMAGE" &
fi
fi
}
@ -119,11 +119,18 @@ REBOOT="0"
}
hfsdiskprep() {
for DEV in `/bin/busybox ls /dev/sd*`; do
FS_TYPE=$(/sbin/blkid -o value -s TYPE $DEV)
if [ "$FS_TYPE" = "hfs" -o "$FS_TYPE" = "hfsplus" ]; then
progress "check filesystem $DEV ..."
/sbin/fsck_hfs -r -y $DEV > /dev/null 2>&1
for DEVICE in /dev/sd*; do
for device in $(/bin/busybox blkid $DEVICE); do
case $device in
TYPE=*)
FS_TYPE=${device#TYPE=}
;;
esac
done
if [ "$FS_TYPE" = "\"hfs\"" -o "$FS_TYPE" = "\"hfsplus\"" ]; then
progress "check filesystem $DEVICE [$FS_TYPE]..."
/sbin/fsck_hfs -r -y $DEVICE > /dev/null 2>&1
fi
done
}
@ -135,12 +142,12 @@ REBOOT="0"
mount_part "$boot" "/flash" "ro,noatime"
show_splash
if [ -f "/flash/MACH_KERNEL" ]; then
IMAGE_KERNEL="MACH_KERNEL"
fi
show_splash
if [ -n "$disk" ]; then
mount_part "$disk" "/storage" "rw,noatime"
update "Kernel" "$IMAGE_KERNEL" "/flash/$IMAGE_KERNEL"