Patchwork [1/5] init-install: Use swap_ratio in the calulation of swap_size

login
register
mail settings
Submitter Darren Hart
Date July 4, 2012, 4:33 a.m.
Message ID <cc3bda9f6375350f8f549a34594cdd338392cc37.1341376182.git.dvhart@linux.intel.com>
Download mbox | patch
Permalink /patch/31143/
State Accepted
Commit 2678ce668499af0e90994b9da8c518e85de56651
Headers show

Comments

Darren Hart - July 4, 2012, 4:33 a.m.
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))