1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

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>
This commit is contained in:
California Sullivan
2018-04-02 18:40:04 -07:00
committed by Richard Purdie
parent 4cbd560eca
commit 21586e595a
6 changed files with 30 additions and 8 deletions
@@ -8,8 +8,19 @@
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# We need 20 Mb for the boot partition
boot_size=20
# figure out how big of a boot partition we need
boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
if [ -e /run/media/$1/$2 ]; then
boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
fi
# remove initrd from size since its not currently installed
if [ -e /run/media/$1/initrd ]; then
boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
fi
# add 10M to provide some extra space for users and account
# for rounding in the above subtractions
boot_size=$(( boot_size + 10 ))
# 5% for swap
swap_ratio=5
@@ -7,8 +7,19 @@
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# We need 20 Mb for the boot partition
boot_size=20
# figure out how big of a boot partition we need
boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
if [ -e /run/media/$1/$2 ]; then
boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
fi
# remove initrd from size since its not currently installed
if [ -e /run/media/$1/initrd ]; then
boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
fi
# add 10M to provide some extra space for users and account
# for rounding in the above subtractions
boot_size=$(( boot_size + 10 ))
# 5% for the swap
swap_ratio=5
@@ -5,7 +5,7 @@ SRC_URI = "file://init-install-efi.sh"
PR = "r1"
RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools util-linux-blkid"
RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
S = "${WORKDIR}"
@@ -7,7 +7,7 @@ PR = "r9"
S = "${WORKDIR}"
RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs util-linux-blkid"
RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
do_install() {
install -m 0755 ${WORKDIR}/init-install.sh ${D}/install.sh
@@ -1,7 +1,7 @@
SUMMARY = "initramfs-framework module for EFI installation option"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
RDEPENDS_${PN} = "initramfs-framework-base parted e2fsprogs-mke2fs dosfstools util-linux-blkid"
RDEPENDS_${PN} = "initramfs-framework-base parted e2fsprogs-mke2fs dosfstools util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
PR = "r4"
@@ -1,7 +1,7 @@
SUMMARY = "initramfs-framework module for installation option"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
RDEPENDS_${PN} = "initramfs-framework-base grub parted e2fsprogs-mke2fs util-linux-blkid"
RDEPENDS_${PN} = "initramfs-framework-base grub parted e2fsprogs-mke2fs util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
# The same restriction as grub
COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'