Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-5221

Find a way to preserve boot PARTUUID when converting an image using mender-convert

    XMLWordPrintable

    Details

      Description

      The symptom is this: After converting an image, the boot order table from UEFI is ignored, and is reconstructed, usually with BOOT ranking first, but this is not always the case.

      What happens for Ubuntu, is that we already have an entry "ubuntu", like this:

      # efibootmgr 
      BootCurrent: 0001
      Timeout: 0 seconds
      BootOrder: 0001,0004,0000,0007
      Boot0000* UiApp
      Boot0001* ubuntu
      Boot0004* UEFI QEMU HARDDISK QM00001 
      Boot0007* EFI Internal Shell
      
      # efibootdump Boot0001
      Boot0001: * ubuntu HD(1,GPT,e328edef-feb2-4627-bc54-fa372e6e08cc,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
      
      #
      

      As you can see, it contains a PARTUUID reference to the first partition. The problem is that when mender-convert makes a new boot partition, even if it fills it with the same content as the original, the PARTUUID has changed, so the entry in the UEFI manager is wrong, gets automatically deleted, and a new default one is created. This does not work well when integrating with the Ubuntu boot scripts, and in particular it is likely required for Secure Boot to work correctly.

      The most likely approach is simply to preserve the PARTUUID in mender-convert when creating a new boot partition. But there is a bit more to it than that: We also need to make sure we use the same boot entry (the name after "\EFI\" above) as the original, and there may be more than one. This requires some research. It could perhaps choose the one which has grub.cfg in it, since it's the most likely candidate to be linux.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              oleorhagen Ole Petter Orhagen
              Reporter:
              a10040 Kristian Amlie
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support