diff --git a/gadget/gadget-amd64.yaml b/gadget/gadget-amd64.yaml index 4595853..3efcf46 100644 --- a/gadget/gadget-amd64.yaml +++ b/gadget/gadget-amd64.yaml @@ -27,10 +27,18 @@ volumes: update: edition: 2 content: + - source: shim.efi.signed + target: EFI/BOOT/BOOTX64.efi + - source: fbx64.efi + target: EFI/BOOT/fbx64.efi + - source: BOOTX64.CSV + target: EFI/ubuntu/BOOTX64.CSV - source: grubx64.efi - target: EFI/boot/grubx64.efi + target: EFI/ubuntu/grubx64.efi + - source: mmx64.efi + target: EFI/ubuntu/mmx64.efi - source: shim.efi.signed - target: EFI/boot/bootx64.efi + target: EFI/ubuntu/shimx64.efi - name: ubuntu-boot role: system-boot filesystem: ext4 diff --git a/gadget/gadget-arm64.yaml b/gadget/gadget-arm64.yaml index 546b612..a5cc109 100644 --- a/gadget/gadget-arm64.yaml +++ b/gadget/gadget-arm64.yaml @@ -13,10 +13,18 @@ volumes: update: edition: 2 content: + - source: shim.efi.signed + target: EFI/BOOT/BOOTAA64.efi + - source: fbaa64.efi + target: EFI/BOOT/fbaa64.efi + - source: BOOTAA64.CSV + target: EFI/ubuntu/BOOTAA64.CSV - source: grubaa64.efi - target: EFI/boot/grubaa64.efi + target: EFI/ubuntu/grubaa64.efi + - source: mmaa64.efi + target: EFI/ubuntu/mmaa64.efi - source: shim.efi.signed - target: EFI/boot/bootaa64.efi + target: EFI/ubuntu/shimaa64.efi - name: ubuntu-boot role: system-boot filesystem: ext4 diff --git a/snapcraft.yaml b/snapcraft.yaml index 85da8e3..ddb048f 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -24,9 +24,9 @@ hooks: # DO NOT check this API key into a publicly accessible VCS MODEL_APIKEY: "" -# Min version to support shim 15.7 and min-size +# Min version to support shim 15.7 and min-size and assets in /EFI/ubuntu assumes: - - snapd2.60.1 + - snapd2.61 parts: mbr: @@ -51,27 +51,44 @@ parts: grub_target=x86_64 grub_bin=grubx64.efi.signed shim_bin=shimx64.efi.dualsigned + fb_bin=fbx64.efi + mm_bin=mmx64.efi + boot_csv=BOOTX64.CSV if [ "$CRAFT_TARGET_ARCH" = arm64 ]; then grub_target=arm64 grub_bin=grubaa64.efi.signed shim_bin=shimaa64.efi.dualsigned + fb_bin=fbaa64.efi + mm_bin=mmaa64.efi + boot_csv=BOOTAA64.CSV fi # Make sure we have signatures from the UC certificates shim_path="$CRAFT_PART_INSTALL"/usr/lib/shim/$shim_bin grub_path="$CRAFT_PART_INSTALL"/usr/lib/grub/"$grub_target"-efi-signed/$grub_bin + fb_path="$CRAFT_PART_INSTALL"/usr/lib/shim/$fb_bin + mm_path="$CRAFT_PART_INSTALL"/usr/lib/shim/$mm_bin + csv_path="$CRAFT_PART_INSTALL"/usr/lib/shim/$boot_csv sbverify --list "$shim_path" | grep -E 'Canonical Ltd. Secure Boot Signing \(Ubuntu Core' sbverify --list "$grub_path" | grep -E 'Canonical Ltd. Secure Boot Signing \(Ubuntu Core' + sbverify --list "$fb_path" | grep -E 'Canonical Ltd. Secure Boot Signing \(Ubuntu Core' + sbverify --list "$mm_path" | grep -E 'Canonical Ltd. Secure Boot Signing \(Ubuntu Core' - # Move shim/grub to the expected path + # Move assets to the expected paths install -m 644 "$shim_path" "$CRAFT_PART_INSTALL"/shim.efi.signed install -m 644 "$grub_path" "$CRAFT_PART_INSTALL"/${grub_bin%.signed} + install -m 644 "$fb_path" "$CRAFT_PART_INSTALL"/$fb_bin + install -m 644 "$mm_path" "$CRAFT_PART_INSTALL"/$mm_bin + install -m 644 "$csv_path" "$CRAFT_PART_INSTALL"/$boot_csv # Remove all the bits we do not need, keeping changelogs and copyrights # (using organize/prime is not possible due to different names per arch - x64/aa64) find "$CRAFT_PART_INSTALL"/ -type f,l \ -not -path "$SNAPCRAFT_PART_INSTALL"/shim.efi.signed \ -not -path "$SNAPCRAFT_PART_INSTALL"/${grub_bin%.signed} \ + -not -path "$SNAPCRAFT_PART_INSTALL"/$fb_bin \ + -not -path "$SNAPCRAFT_PART_INSTALL"/$mm_bin \ + -not -path "$SNAPCRAFT_PART_INSTALL"/$boot_csv \ -not -path "$SNAPCRAFT_PART_INSTALL"/usr/share/doc/grub-efi-$CRAFT_TARGET_ARCH-signed/'*' \ -and -not -path "$SNAPCRAFT_PART_INSTALL"/'usr/share/doc/shim-signed/*' \ -delete