busybox-initramfs:

- simplyfing update script a little bit
This commit is contained in:
Stephan Raue 2009-12-17 01:13:45 +01:00
parent 770e773f88
commit 5f12716fee

View File

@ -10,6 +10,7 @@
IMAGE_SYSTEM="SYSTEM" IMAGE_SYSTEM="SYSTEM"
IMAGE_KERNEL="KERNEL" IMAGE_KERNEL="KERNEL"
REBOOT=0
# parse command line arguments # parse command line arguments
for arg in $(cat /proc/cmdline); do for arg in $(cat /proc/cmdline); do
@ -56,16 +57,20 @@
/bin/busybox mv $UPDATE_DIR/$2 $3 /bin/busybox mv $UPDATE_DIR/$2 $3
/bin/busybox mount -o remount,ro /flash /bin/busybox mount -o remount,ro /flash
/bin/busybox sync /bin/busybox sync
[ $4 = "reboot" ] && REBOOT="reboot" [ $2 = $IMAGE_KERNEL ] && REBOOT=1
fi fi
} }
mount_part "$boot" "/flash" "ro,noatime" mount_part "$boot" "/flash" "ro,noatime"
mount_part "$disk" "/storage" "rw,noatime" mount_part "$disk" "/storage" "rw,noatime"
update "Kernel" "$IMAGE_KERNEL" "/flash/$IMAGE_KERNEL" "reboot" update "Kernel" "$IMAGE_KERNEL" "/flash/$IMAGE_KERNEL"
update "System" "$IMAGE_SYSTEM" "/flash/$IMAGE_SYSTEM" update "System" "$IMAGE_SYSTEM" "/flash/$IMAGE_SYSTEM"
[ $REBOOT = "reboot" ] && echo "System reboots now..." && /bin/busybox reboot
if test "$REBOOT" -eq 1; then
echo "System reboots now..." && \
/bin/busybox reboot
fi
if [ -f "/flash/$IMAGE_SYSTEM" ]; then if [ -f "/flash/$IMAGE_SYSTEM" ]; then
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "loop" mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "loop"