grub-install: error: /usr/lib/grub/i386-ieee1275/modinfo.sh doesn't exist. Please specify --target or --directory
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
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_
2021-09-12 08:50:57.496 | Installing GRUB2...
2021-09-12 08:50:57.793 | /usr/sbin/
```
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/
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.
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: "--target= i386-pc" disk-image-create -a amd64 -o ubuntu-focal.qcow2 vm ubuntu
```
DIB_RELEASE=focal GRUB_OPTS=
```
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.