busybox-initramfs: init: cleanup (/flash is actual root filesystem?)

This commit is contained in:
Stefan Saraev 2013-05-25 19:01:31 +03:00
parent 8444c690f8
commit 8c7241c53d

View File

@ -313,8 +313,6 @@
}
update_bootloader() {
if [ -f "/flash/$IMAGE_SYSTEM" ]; then
# /flash is filesystem with system image file
export BOOT_ROOT="/flash"
export SYSTEM_ROOT="/sysroot"
@ -327,7 +325,6 @@
fi
umount /sysroot
fi
}
load_modules() {
@ -406,9 +403,6 @@
fi
fi
if [ -f "/flash/$IMAGE_SYSTEM" ]; then
# /flash is filesystem with system image file
# use dd and mkfs.ext4 from system
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
echo "Creating empty file, this can take a long time..."
/sysroot/bin/busybox dd if=/dev/zero of="$storage_loop_file" bs=1M count=$STORAGE_USE &>/dev/null
@ -416,14 +410,6 @@
LD_LIBRARY_PATH=/sysroot/usr/lib /sysroot/sbin/mkfs.ext4 -F -L StorageLive "$storage_loop_file" &>/dev/null
/bin/busybox sync
umount /sysroot
else
# /flash is actual root filesystem
echo "Creating empty file, this can take a long time..."
/flash/bin/busybox dd if=/dev/zero of="$storage_loop_file" bs=1M count=$STORAGE_USE &>/dev/null
echo "Formating to EXT4 filesystem, this can take a long time..."
LD_LIBRARY_PATH=/flash/usr/lib /flash/sbin/mkfs.ext4 -F -L StorageLive "$storage_loop_file" &>/dev/null
/bin/busybox sync
fi
echo "Done..."
/bin/busybox usleep 2000000
@ -536,8 +522,6 @@
prepare_sysroot() {
progress "Preparing system"
if [ -f "/flash/$IMAGE_SYSTEM" ]; then
# /flash is filesystem with system image file
if [ "$SYSTEM_TORAM" = "no" -o "$INSTALLED_MEMORY" -lt "$SYSTEM_TORAM_LIMIT" ]; then
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
else
@ -546,10 +530,6 @@
fi
/bin/busybox mount --move /flash /sysroot/flash
else
# /flash is actual root filesystem
/bin/busybox mount --move /flash /sysroot
fi
if [ -n "$disk" ]; then
/bin/busybox mount --move /storage /sysroot/storage