From 5c72bcb27e0d0528abde7e03700a210f38200046 Mon Sep 17 00:00:00 2001 From: Awais Belal Date: Sat, 12 Jan 2019 01:22:14 +0500 Subject: [PATCH 3/7] init-install-efi: deploy kernel images as imageA With a single boot partition we keep two copies of kernel to support the AB approach so deploy kernels as imageA on scratch installation. Signed-off-by: Awais Belal --- init-install-efi.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init-install-efi.sh b/init-install-efi.sh index 6e713ba..8905cfa 100644 --- a/init-install-efi.sh +++ b/init-install-efi.sh @@ -286,9 +286,9 @@ mkdir -p $EFIDIR # Copy the efi loader cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR +GRUBCFG="$EFIDIR/grub.cfg" if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs1}) - GRUBCFG="$EFIDIR/grub.cfg" cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG # Update grub config for the installed image # Delete the install entry @@ -324,8 +324,13 @@ umount /tgt_root # Copy kernel artifacts. To add more artifacts just add to types # For now just support kernel types already being used by something in OE-core for types in bzImage zImage vmlinux vmlinuz fitImage; do + # MEL - SWUpdate - copy all kernel images as A, this is our first copy for kernel in `find /run/media/$1/ -name $types*`; do - cp $kernel /boot + kernel_name=$(basename $kernel) + cp $kernel /boot/${kernel_name}A + if [ -e $GRUBCFG ]; then + sed -i "s/\/${kernel_name} /\/${kernel_name}A /" $GRUBCFG + fi done done -- 2.11.1