summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-03-31 23:10:27 -0700
committerRobert Yang <liezhi.yang@windriver.com>2016-04-01 23:13:55 -0700
commit745a7562c829171ff677a201777fe330a1cebdc6 (patch)
treee159123963b30f5c205ccb96e6131065cdacdeac
parent322904f62f11e794543362f04212242567c556a0 (diff)
downloadopenembedded-core-contrib-745a7562c829171ff677a201777fe330a1cebdc6.tar.gz
openembedded-core-contrib-745a7562c829171ff677a201777fe330a1cebdc6.tar.bz2
openembedded-core-contrib-745a7562c829171ff677a201777fe330a1cebdc6.zip
init-install.sh: fix disk_size
It mis-matched "SanDisk" or "Disk Flags" before, which caused unexpected error. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh2
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi.sh2
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh2
3 files changed, 3 insertions, 3 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
index 7a0b4d4406..b562109157 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
@@ -69,7 +69,7 @@ umount /dev/${device}* 2> /dev/null || /bin/true
mkdir -p /tmp
cat /proc/mounts > /etc/mtab
-disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+disk_size=$(parted /dev/${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
testfs_size=$((disk_size*testfs_ratio/100))
rootfs_size=$((disk_size-boot_size-testfs_size))
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 0443a9d11f..3531158f3b 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -120,7 +120,7 @@ if [ ! -e /etc/mtab ]; then
cat /proc/mounts > /etc/mtab
fi
-disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
swap_size=$((disk_size*swap_ratio/100))
rootfs_size=$((disk_size-boot_size-swap_size))
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 1925d90693..c5623eeb26 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -116,7 +116,7 @@ if [ ! -L /etc/mtab ]; then
cat /proc/mounts > /etc/mtab
fi
-disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/')