diskimage-builder Package grub-pc is not available error running on Fedora 25 AArch64

Bug #1655765 reported by d.marlin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
diskimage-builder
Confirmed
Undecided
Unassigned

Bug Description

I am running Fedora 25 on a 64-bit ARM (AArch64) host, and tried testing the latest (F26) version of diskimage-builder,

  # cat /etc/redhat-release
  Fedora release 25 (Twenty Five)

  # rpm -q diskimage-builder
  diskimage-builder-1.26.1-1.fc26.noarch

but I encountered an error with the following command:

  # disk-image-create -a arm64 -o test.qcow2 vm ubuntu
     :

  + install-packages -m bootloader grub-pc
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  Package grub-pc is not available, but is referred to by another package.
  This may mean that the package is missing, has been obsoleted, or
  is only available from another source
  However the following packages replace it:
    grub2-common grub-common

  E: Package 'grub-pc' has no installation candidate

Note: running the same command without the "vm" element successfully creates an image:

  # disk-image-create -a arm64 -o test.qcow2 ubuntu
     :

  Converting image using qemu-img convert
  Image file test.qcow2 created...

  # ls -l test.qcow2
  -rw-r--r--. 1 root root 418840576 Jan 11 16:36 test.qcow2

Revision history for this message
Ian Wienand (iwienand) wrote :

That image wouldn't be bootable i'm guessing.

in bootloader/finalise.d/50-bootloader we have a branch for ppc to install their grub; arm presumably requires it's own bootloader setup and no installing "grub-pc"

---
    elif [[ "$ARCH" =~ "ppc" ]]; then
        install-packages grub-ieee1275
    else
        install-packages -m bootloader grub-pc
    fi
---

I'm afraid i'm really not familiar enough with the architecture to know what it needs here. but i'm sure people have been doing aarch builds; but maybe not with VM targets?

Changed in diskimage-builder:
status: New → Confirmed
Revision history for this message
d.marlin (dmarlin) wrote :

Thank you for your reply.

I believe you are right that 64-bit ARM will require its own bootloader setup, and that may be distro-specific as well (for Fedora we install grub2-efi and grub2-tools, but those packages do not exist for Ubuntu, while grub-common and grub-efi-arm64 do).

I manually added:

     elif [[ "$ARCH" =~ "ppc" ]]; then
         install-packages grub-ieee1275
+ elif [[ "$ARCH" == "arm64" ]]; then
+ install-packages grub-efi-arm64 grub-efi-arm64-bin
+ elif [[ "$ARCH" == "aarch64" ]]; then
+ install-packages grub2-tools grub2-efi
     else
         install-packages -m bootloader grub-pc

as a test, and it gets past the error (although I don't know if those are the right packages for Ubuntu arm64).

It then fails with:

  + /usr/sbin/grub-install '--modules=biosdisk part_msdos' --force /dev/loop0
  Installing for arm64-efi platform.
  /usr/sbin/grub-install: error: cannot find EFI directory.

so I think we are hitting platform-specific code for running grub(2)-install:

    if [[ "$ARCH" =~ "ppc" ]] ; then
        $GRUBNAME --modules="part_msdos" $GRUB_OPTS $BOOT_DEV --no-nvram
    else
        $GRUBNAME --modules="biosdisk part_msdos" $GRUB_OPTS $BOOT_DEV
    fi

Note: the error may be related to the fact that I am running this on an EFI host.

There may be other platform-specifics (and/or distro-specifics) in bootloader/finalise.d/50-bootloader that need to be addressed, i.e. setting GRUB_CFG, and creating /etc/default/grub.

I can help with the changes required for Fedora (aarch64), but will need someone familiar with setting up Ubuntu for the arm64 changes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.