busybox-initramfs: fix system-to-ram support, move default variables block after mounting the special filesystems

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-01-11 14:05:20 +01:00
parent 1231e036b3
commit 75ebfa364d

View File

@ -22,25 +22,29 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
MODULE_DIR=/lib/modules
UPDATE_DIR=/storage/.update
UPDATE_KERNEL="KERNEL"
UPDATE_SYSTEM="SYSTEM"
IMAGE_KERNEL="KERNEL"
IMAGE_SYSTEM="SYSTEM"
REBOOT="0"
MD5_FAILED="0"
MD5_NOCHECK="0"
NBD_DEVS="0"
# mount all needed special filesystems
/bin/busybox mount -t devtmpfs none /dev
/bin/busybox mount -t proc none /proc
/bin/busybox mount -t sysfs none /sys
# set needed variables
MODULE_DIR=/lib/modules
UPDATE_DIR=/storage/.update
UPDATE_KERNEL="KERNEL"
UPDATE_SYSTEM="SYSTEM"
IMAGE_KERNEL="KERNEL"
IMAGE_SYSTEM="SYSTEM"
REBOOT="0"
MD5_FAILED="0"
MD5_NOCHECK="0"
NBD_DEVS="0"
INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'`
SYSTEM_TORAM_LIMIT=1024000
# load any configuration
if [ -f "/etc/initramfs.conf" ]; then
. /etc/initramfs.conf
@ -468,9 +472,6 @@ NBD_DEVS="0"
if [ -f "/flash/$IMAGE_SYSTEM" ]; then
# /flash is filesystem with system image file
INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'`
SYSTEM_TORAM_LIMIT=1024000
if [ "$SYSTEM_TORAM" = "no" -o "$INSTALLED_MEMORY" -lt "$SYSTEM_TORAM_LIMIT" ]; then
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
else