busybox-initramfs: copy SYSTEM to RAM before mounting. this new feature can be deactivated with the 'noram' option to the bootloaderconfig or is not avaible if to avaible total memory (1024000 Kb on normal systems, 364544 Kb for RaspberryPi) is to low.

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-11-21 16:08:10 +01:00
parent 8fbd0aa379
commit b4dbbbdd97
3 changed files with 25 additions and 1 deletions

View File

@ -31,6 +31,10 @@ mkdir -p $INSTALL/etc
touch $INSTALL/etc/fstab
ln -sf /proc/self/mounts $INSTALL/etc/mtab
if [ -f $PROJECT_DIR/$PROJECT/initramfs/initramfs.conf ]; then
cp $PROJECT_DIR/$PROJECT/initramfs/initramfs.conf $INSTALL/etc
fi
mkdir -p $INSTALL/dev
mkdir -p $INSTALL/proc
mkdir -p $INSTALL/sys

View File

@ -81,6 +81,9 @@ NBD_DEVS="0"
nosplash)
SPLASH=no
;;
noram)
SYSTEM_TORAM=no
;;
overlay)
OVERLAY=yes
;;
@ -458,7 +461,20 @@ NBD_DEVS="0"
if [ -f "/flash/$IMAGE_SYSTEM" ]; then
# /flash is filesystem with system image file
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
INSTALLED_MEMORY=`cat /proc/meminfo | grep 'MemTotal:' | awk '{print $2}'`
SYSTEM_TORAM_LIMIT=1024000
if [ -f "/etc/initramfs.conf" ]; then
. /etc/initramfs.conf
fi
if [ "$SYSTEM_TORAM" = "no" -o "$INSTALLED_MEMORY" -lt "$SYSTEM_TORAM_LIMIT" ]; then
mount_part "/flash/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
else
cp /flash/$IMAGE_SYSTEM /dev/$IMAGE_SYSTEM
mount_part "/dev/$IMAGE_SYSTEM" "/sysroot" "ro,loop"
fi
/bin/busybox mount --move /flash /sysroot/flash
else
# /flash is actual root filesystem

View File

@ -0,0 +1,4 @@
# min size to support System to RAM
# default for RaspberryPi we set to 356MB (256MB + appr. image size (100MB) )
# to be sure we have at least 256MB free
SYSTEM_TORAM_LIMIT=364544