diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-04-01 02:14:44 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-03 15:51:35 +0100 |
commit | 3ce7d8cdc8537fef07efc2d3f6b540faab1819e4 (patch) | |
tree | cefd61cd0fac9ef9e214abbd351c381d805cb744 /meta/recipes-core/initrdscripts | |
parent | 46eed0a4aaac943fff9cdba81848a9e0b1154b5c (diff) | |
download | poky-3ce7d8cdc8537fef07efc2d3f6b540faab1819e4.tar.gz |
init-install.sh: fix disk_size
It mis-matched "SanDisk" or "Disk Flags" before, which caused unexpected
error.
(From OE-Core rev: a68ac76c1b6ed4c1a2fbc944c5021c89fd26217f)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
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 | |||
69 | mkdir -p /tmp | 69 | mkdir -p /tmp |
70 | cat /proc/mounts > /etc/mtab | 70 | cat /proc/mounts > /etc/mtab |
71 | 71 | ||
72 | disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") | 72 | disk_size=$(parted /dev/${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") |
73 | 73 | ||
74 | testfs_size=$((disk_size*testfs_ratio/100)) | 74 | testfs_size=$((disk_size*testfs_ratio/100)) |
75 | rootfs_size=$((disk_size-boot_size-testfs_size)) | 75 | 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 | |||
120 | cat /proc/mounts > /etc/mtab | 120 | cat /proc/mounts > /etc/mtab |
121 | fi | 121 | fi |
122 | 122 | ||
123 | disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") | 123 | disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") |
124 | 124 | ||
125 | swap_size=$((disk_size*swap_ratio/100)) | 125 | swap_size=$((disk_size*swap_ratio/100)) |
126 | rootfs_size=$((disk_size-boot_size-swap_size)) | 126 | 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 | |||
116 | cat /proc/mounts > /etc/mtab | 116 | cat /proc/mounts > /etc/mtab |
117 | fi | 117 | fi |
118 | 118 | ||
119 | disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//") | 119 | disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") |
120 | 120 | ||
121 | grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/') | 121 | grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/') |
122 | 122 | ||