]> code.ossystems Code Review - openembedded-core.git/commitdiff
init-install: Use swap_ratio in the calulation of swap_size
authorDarren Hart <dvhart@linux.intel.com>
Tue, 3 Jul 2012 20:02:50 +0000 (13:02 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 Jul 2012 15:58:17 +0000 (16:58 +0100)
swap_size currently uses a hard coded percentage and ignores the
swap_ratio variable. Fortunately they are the same value currently. Make
the calculation use the variable to avoid problems in the future.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
meta/recipes-core/initrdscripts/files/init-install.sh

index 01ff82926a534651ecfc556ed7ae3c61413bb920..3005f2045c833859022e60107d7a783c19fbfb11 100644 (file)
@@ -81,7 +81,7 @@ cat /proc/mounts > /etc/mtab
 
 disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
 
-swap_size=$((disk_size*5/100))
+swap_size=$((disk_size*swap_ratio/100))
 rootfs_size=$((disk_size-boot_size-swap_size))
 
 rootfs_start=$((boot_size + 1))