grub-install: error: /usr/lib/grub/i386-ieee1275/modinfo.sh doesn't exist. Please specify --target or --directory

Bug #1943363 reported by lionel.h
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
New
Undecided
Unassigned

Bug Description

Hi there,

Trying to build an ubuntu VM within docker from my MacBook Air M1.

The trick is that I'm using a Mac M1 using the ARM architecture and I'm trying to build an amd64 image.

Everything is running fine until it tries to do the grub-install part:

```
2021-09-12 08:50:51.252 | Creating config file /etc/default/grub with new version
2021-09-12 08:50:52.328 | Setting up grub-gfxpayload-lists (0.7) ...
2021-09-12 08:50:52.442 | Processing triggers for install-info (6.7.0.dfsg.2-5) ...
2021-09-12 08:50:53.332 | Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
2021-09-12 08:50:53.432 | Processing triggers for systemd (245.4-4ubuntu3.11) ...
2021-09-12 08:50:53.451 | Processing triggers for man-db (2.9.1-1) ...
2021-09-12 08:50:57.496 | /tmp/in_target.d/finalise.d/50-bootloader: line 50: type: grub2-mkconfig: not found
2021-09-12 08:50:57.496 | Installing GRUB2...
2021-09-12 08:50:57.793 | /usr/sbin/grub-install: error: /usr/lib/grub/i386-ieee1275/modinfo.sh doesn't exist. Please specify --target or --directory.
```

I'm building something very basic:
```
DIB_RELEASE=focal disk-image-create -a amd64 -o ubuntu-focal.qcow2 vm ubuntu
```

As per the manual, I also installed qemu-user-static needed for the cross compilation.

And indeed `/usr/lib/grub/i386-ieee1275` is inexistent since I'm building from docker on a MacBook Air M1, I know this is a bit esoteric :)

As any one already tried to build a image for another architecture here ?
Maybe I'm missing a package, but I don't have really clue about what's missing.

Revision history for this message
lionel.h (lionel-dell24) wrote :

Hi guys,

I made some progress and found a workaround :)

The issue seems to come from the following element: `elements/bootloader/finalise.d/50-bootloader`

As a workaround for now, I simply override the GRUB_OPTS to force a specific target:
```
DIB_RELEASE=focal GRUB_OPTS="--target=i386-pc" disk-image-create -a amd64 -o ubuntu-focal.qcow2 vm ubuntu
```
And from there, it will compile successfully.

I'm trying to figure out how to adapt the element to automatically select the correct target while doing a cross build.

Revision history for this message
lionel.h (lionel-dell24) wrote :

Oh I forgot to mention. I'm using diskimage-builder version 3.13.0

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.