|
From: <abe...@us...> - 2014-05-02 00:07:15
|
Revision: 6513
http://sourceforge.net/p/astlinux/code/6513
Author: abelbeck
Date: 2014-05-02 00:07:10 +0000 (Fri, 02 May 2014)
Log Message:
-----------
initrd, increase the tmpfs asturo limit from 128 MB to 192 MB. Additionally resize the asturo mount to match the 'used' space so no free space remains.
Modified Paths:
--------------
branches/1.0/project/initrd/busybox.config
branches/1.0/project/initrd/target_skeleton/linuxrc
branches/1.0/scripts/build
Modified: branches/1.0/project/initrd/busybox.config
===================================================================
--- branches/1.0/project/initrd/busybox.config 2014-04-30 14:58:31 UTC (rev 6512)
+++ branches/1.0/project/initrd/busybox.config 2014-05-02 00:07:10 UTC (rev 6513)
@@ -200,7 +200,7 @@
# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set
# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
# CONFIG_FEATURE_DD_IBS_OBS is not set
-# CONFIG_DF is not set
+CONFIG_DF=y
# CONFIG_FEATURE_DF_FANCY is not set
# CONFIG_DIRNAME is not set
# CONFIG_DOS2UNIX is not set
Modified: branches/1.0/project/initrd/target_skeleton/linuxrc
===================================================================
--- branches/1.0/project/initrd/target_skeleton/linuxrc 2014-04-30 14:58:31 UTC (rev 6512)
+++ branches/1.0/project/initrd/target_skeleton/linuxrc 2014-05-02 00:07:10 UTC (rev 6513)
@@ -5,10 +5,28 @@
# when reverted to an older version that still uses IDE
DRIVES="hda hdb hdc hdd sda sdb sdc sdd sde sdf sdg sdh"
-# Max image size in megabytes
-IMAGEFS_SIZE=128
+# Max image size in 1024 (k) bytes
+MAX_IMAGEFS_SIZE=196608 # 192m
#functions
+
+image_to_tmpfs() {
+ local mp="$1" used
+
+ mount -t tmpfs -o size=${MAX_IMAGEFS_SIZE}k none $mp
+
+ echo "Copying AstLinux files to RAM..."
+ cp -a /image/. $mp/
+
+ mount -o ro,remount $mp
+
+ # Reduce total size to 'used'
+ used="$(df -k -P $mp | awk '/^none/ { print $3; }')"
+ if [ -n "$used" ] && [ $used -lt $MAX_IMAGEFS_SIZE ]; then
+ mount -o remount,size=${used}k $mp
+ fi
+}
+
geninstall () {
echo "
@@ -138,17 +156,8 @@
mount -t ext2 -o noatime $ASTURW /mnt/asturw
- # no longer needed with new version of unionfs
- # rm -rf /mnt/asturw/lib/modules
+ image_to_tmpfs /mnt/asturo
- mount -t tmpfs -o size=${IMAGEFS_SIZE}m none /mnt/asturo
-
- echo "Copying AstLinux files to RAM..."
-
- cp -a /image/. /mnt/asturo/
-
- mount -o ro,remount /mnt/asturo
-
mount -t unionfs -o dirs=/mnt/asturw=rw:/mnt/asturo=ro none /new
cd /
@@ -170,22 +179,14 @@
mount -t ext2 -o noatime $ASTURW /mnt/asturw
- # no longer needed since new unionfs version
- # rm -rf /mnt/asturw/lib/modules
-
mount -t unionfs -o dirs=/mnt/asturw=rw:/image=ro none /new
fi
else
# non unionfs stuff
if [ "$RAMFS" = "yes" ]; then
- mount -t tmpfs -o size=${IMAGEFS_SIZE}m none /new
+ image_to_tmpfs /new
- echo "Copying AstLinux files to RAM..."
-
- cp -a /image/. /new/
- mount -o ro,remount /new
-
# unmount the loop device
cd /
umount /dev/loop0
Modified: branches/1.0/scripts/build
===================================================================
--- branches/1.0/scripts/build 2014-04-30 14:58:31 UTC (rev 6512)
+++ branches/1.0/scripts/build 2014-05-02 00:07:10 UTC (rev 6513)
@@ -3,7 +3,8 @@
# build [ board ]
#
-IMAGEFS_SIZE=128
+# Max image size in 1024 (k) bytes
+MAX_IMAGEFS_SIZE=196608 # 192m
REQUIRED_CMDS="which zcat bzcat make gcc bison flex msgfmt makeinfo autoconf nasm wget rsync sed"
@@ -48,9 +49,9 @@
)
touch ${ASTVER}/astflag
sed -e "s/ASTVER/${ASTVER}/g" project/astlinux/board/${board}/runnix.conf > ${ASTVER}/${ASTVER}.run.conf
- image_size=$(du -s -m "${ROOTFS_EXT2}" | awk '{ print $1 }')
- if [ "$image_size" -gt ${IMAGEFS_SIZE} ]; then
- echo "build: WARNING -- Image Size is larger then ${IMAGEFS_SIZE}MB, 'noram' is set"
+ image_size=$(du -s -k "${ROOTFS_EXT2}" | awk '{ print $1 }')
+ if [ $image_size -gt $MAX_IMAGEFS_SIZE ]; then
+ echo "build: WARNING -- Image Size is larger then ${MAX_IMAGEFS_SIZE}KB, 'noram' is set"
sed -i 's/ astlive / astlive noram /' ${ASTVER}/${ASTVER}.run.conf
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|