Patchwork [CONSOLIDATED,PULL,21/41] init-install: Use swap_ratio in the calulation of swap_size

login
register
mail settings
Submitter Saul Wold
Date July 9, 2012, 3:47 p.m.
Message ID <b9fb8df4672bd8ab8a8a4a8d0dd5900a753b375e.1341802889.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/31465/
State New
Headers show

Comments

Saul Wold - July 9, 2012, 3:47 p.m.
From: Darren Hart <dvhart@linux.intel.com>

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>
---
 .../initrdscripts/files/init-install.sh            |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 01ff829..3005f20 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -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))