summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-install-efi.sh
diff options
context:
space:
mode:
authorCalifornia Sullivan <california.l.sullivan@intel.com>2018-04-02 18:40:04 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-03 23:53:19 +0100
commit21586e595ac0856fe71e214fb6b49f3bf053b261 (patch)
treef5e218d42913f954e64d4626b93ed2040c6c7779 /meta/recipes-core/initrdscripts/files/init-install-efi.sh
parent4cbd560eca64325fe2b61642b5868ca2d0fa7dd4 (diff)
downloadpoky-21586e595ac0856fe71e214fb6b49f3bf053b261.tar.gz
initrdscripts: init-install(-efi).sh: don't assume 20M boot partition
With multi kernel support in the installer we can exceed this limit. Calculate a sane size by checking the size of the original boot partition minus some objects we know won't be installed, plus some extra space for users. In addition, in the common case where only one small kernel is present to be installed, we actually get a smaller boot partition with less wasted space. Also add VIRTUAL-RUNTIME_base-utils to RDEPENDS where these scripts are used, as they're needed for the du command. [YOCTO #12583]. (From OE-Core rev: 2ca601bef44a07512c93b8452cf9001dce402617) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts/files/init-install-efi.sh')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 43b75b0175..82b0aa819e 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -8,8 +8,19 @@
8 8
9PATH=/sbin:/bin:/usr/sbin:/usr/bin 9PATH=/sbin:/bin:/usr/sbin:/usr/bin
10 10
11# We need 20 Mb for the boot partition 11# figure out how big of a boot partition we need
12boot_size=20 12boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
13# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
14if [ -e /run/media/$1/$2 ]; then
15 boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
16fi
17# remove initrd from size since its not currently installed
18if [ -e /run/media/$1/initrd ]; then
19 boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
20fi
21# add 10M to provide some extra space for users and account
22# for rounding in the above subtractions
23boot_size=$(( boot_size + 10 ))
13 24
14# 5% for swap 25# 5% for swap
15swap_ratio=5 26swap_ratio=5