summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-install.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.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.sh')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index aa9476660b..28e8f09d19 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -7,8 +7,19 @@
7 7
8PATH=/sbin:/bin:/usr/sbin:/usr/bin 8PATH=/sbin:/bin:/usr/sbin:/usr/bin
9 9
10# We need 20 Mb for the boot partition 10# figure out how big of a boot partition we need
11boot_size=20 11boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
12# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
13if [ -e /run/media/$1/$2 ]; then
14 boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
15fi
16# remove initrd from size since its not currently installed
17if [ -e /run/media/$1/initrd ]; then
18 boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
19fi
20# add 10M to provide some extra space for users and account
21# for rounding in the above subtractions
22boot_size=$(( boot_size + 10 ))
12 23
13# 5% for the swap 24# 5% for the swap
14swap_ratio=5 25swap_ratio=5