Skip to contentSkip to conversation

board/pc: fix build failure due to new genimage 15

PATCH Applied Giulio Benetti 2 participants 7 messages Feb 4, 2022 – Feb 12, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board/pc: fix build failure due to new genimage 15

Actually genimage fails to create final image with:

```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```

This is because genimage 15 is less permissive than before, so let's add holes = {"(440; 512)"} to leave room to MBR.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249

---
 board/pc/genimage-bios.cfg | 1 +
 1 file changed, 1 insertion(+)
board/pc/genimage-bios.cfg +1 -0
index 26d12d9ab3..54026f6527 100644
@@ -7,6 +7,7 @@ image disk.img {
 		image = "boot.img"
 		offset = 0
 		size = 512
+		holes = {"(440; 512)"}
 	}
 
 	partition grub {
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Giulio,

Quoted 22 lines · Giulio Benetti

Actually genimage fails to create final image with:

```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```

This is because genimage 15 is less permissive than before, so let's add holes = {"(440; 512)"} to leave room to MBR.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249

---
  board/pc/genimage-bios.cfg | 1 +
  1 file changed, 1 insertion(+)
board/pc/genimage-bios.cfg +0 -0
index 26d12d9ab3..54026f6527 100644

board/pc/genimage-bios.cfg image disk.img { · line 10

Quoted 4 lines
board/pc/genimage-bios.cfg +1 -0
@@ -7,6 +7,7 @@ image disk.img {
  		image = "boot.img"
  		offset = 0
  		size = 512
+		holes = {"(440; 512)"}

Have you tested this change on an actual board (i.e. a PC :-)?

Regards,
Arnout

board/pc/genimage-bios.cfg image disk.img { · line 13

Quoted 3 lines
board/pc/genimage-bios.cfg +0 -0
  	}
 
  	partition grub {

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hi Arnout,

Quoted 21 lines

Il giorno 5 feb 2022, alle ore 15:11, Arnout Vandecappelle <[email protected]> ha scritto:

 Hi Giulio,

Quoted 17 lines · Giulio Benetti

Actually genimage fails to create final image with:

```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```

This is because genimage 15 is less permissive than before, so let's add holes = {"(440; 512)"} to leave room to MBR.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249

---
 board/pc/genimage-bios.cfg | 1 +
 1 file changed, 1 insertion(+)
board/pc/genimage-bios.cfg +0 -1
index 26d12d9ab3..54026f6527 100644
--- a/board/pc/genimage-bios.cfg
Quoted 8 lines

board/pc/genimage-bios.cfg image disk.img { · line 10

Quoted 6 lines

+++ b/board/pc/genimage-bios.cfg

board/pc/genimage-bios.cfg +1 -0
@@ -7,6 +7,7 @@ image disk.img {
         image = "boot.img"
         offset = 0
         size = 512
+        holes = {"(440; 512)"}

Have you tested this change on an actual board (i.e. a PC :-)?

I’ve tested it with qemu and it boots the kernel correctly(that is in rootfs), only thing is that it can’t mount the rootfs and I don’t understand why. I wanted to ask about this but I’ve got lost among all the other patches :-)

Could someone double check if it mounts?

Best regards
Giulio

Quoted 10 lines

Regards,
Arnout

board/pc/genimage-bios.cfg image disk.img { · line 13

Quoted 2 lines
board/pc/genimage-bios.cfg +0 -0
     }
       partition grub {

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hi again Arnout,

Quoted 32 lines · Giulio Benetti

Hi Arnout,

Quoted 21 lines

Il giorno 5 feb 2022, alle ore 15:11, Arnout Vandecappelle <[email protected]> ha scritto:

 Hi Giulio,

Quoted 17 lines · Giulio Benetti

Actually genimage fails to create final image with:

```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```

This is because genimage 15 is less permissive than before, so let's add holes = {"(440; 512)"} to leave room to MBR.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249

---
  board/pc/genimage-bios.cfg | 1 +
  1 file changed, 1 insertion(+)
board/pc/genimage-bios.cfg +0 -1
index 26d12d9ab3..54026f6527 100644
--- a/board/pc/genimage-bios.cfg
Quoted 8 lines

board/pc/genimage-bios.cfg image disk.img { · line 10

Quoted 6 lines

+++ b/board/pc/genimage-bios.cfg

board/pc/genimage-bios.cfg +1 -0
@@ -7,6 +7,7 @@ image disk.img {
          image = "boot.img"
          offset = 0
          size = 512
+        holes = {"(440; 512)"}

Have you tested this change on an actual board (i.e. a PC :-)?

Quoted 2 lines

I’ve tested it with qemu and it boots the kernel correctly(that is in rootfs), only thing is that it can’t mount the rootfs and I don’t understand why. I wanted to ask about this but I’ve got lost among all the other patches :-)

I've compared the 2 disk.img files, one generated with genimage 14 without "holes..." and the other generated with genimage 15 and they are the same.

The problem here is not that it can't mount using qemu, but it doesn't show the shell.

Here is the qemu command:
qemu-system-x86_64 -M pc -drive file=images/disk.img,if=virtio,format=raw -net nic,model=virtio -net user

and this is the output:
https://imgur.com/a/ffZBlJR

So it seems like a busybox/init system issue with tty1. I'm digging.

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 16 lines

Could someone double check if it mounts?

Best regards
Giulio

Quoted 10 lines

Regards,
Arnout

board/pc/genimage-bios.cfg image disk.img { · line 13

Quoted 2 lines
board/pc/genimage-bios.cfg +0 -0
      }
        partition grub {

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

author Tested-by
#4 lore raw

Hi Arnout,

Quoted 45 lines · Giulio Benetti

Hi again Arnout,

Quoted 32 lines · Giulio Benetti

Hi Arnout,

Quoted 21 lines

Il giorno 5 feb 2022, alle ore 15:11, Arnout Vandecappelle <[email protected]> ha scritto:

 Hi Giulio,

Quoted 17 lines · Giulio Benetti

Actually genimage fails to create final image with:

```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```

This is because genimage 15 is less permissive than before, so let's add holes = {"(440; 512)"} to leave room to MBR.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249

---
   board/pc/genimage-bios.cfg | 1 +
   1 file changed, 1 insertion(+)
board/pc/genimage-bios.cfg +0 -1
index 26d12d9ab3..54026f6527 100644
--- a/board/pc/genimage-bios.cfg
Quoted 8 lines

board/pc/genimage-bios.cfg image disk.img { · line 10

Quoted 6 lines

+++ b/board/pc/genimage-bios.cfg

board/pc/genimage-bios.cfg +1 -0
@@ -7,6 +7,7 @@ image disk.img {
           image = "boot.img"
           offset = 0
           size = 512
+        holes = {"(440; 512)"}

Have you tested this change on an actual board (i.e. a PC :-)?

Quoted 2 lines

I’ve tested it with qemu and it boots the kernel correctly(that is in rootfs), only thing is that it can’t mount the rootfs and I don’t understand why. I wanted to ask about this but I’ve got lost among all the other patches :-)

I've compared the 2 disk.img files, one generated with genimage 14 without "holes..." and the other generated with genimage 15 and they are the same.

The problem here is not that it can't mount using qemu, but it doesn't show the shell.

Quoted 8 lines

Here is the qemu command:
qemu-system-x86_64 -M pc -drive file=images/disk.img,if=virtio,format=raw -net nic,model=virtio -net user

and this is the output:
https://imgur.com/a/ffZBlJR

So it seems like a busybox/init system issue with tty1. I'm digging.

I've found the problem. Using the grub.cfg as it is(root=/dev/sda1) works only with Virtualbox but not with Qemu that needs s/sda1/vda1.

But it's not so well explained in readme.txt, so I'm going to send a patch for that.

So I can give a:

[Giulio: tested successfully with Qemu and Virtualbox]

Best regards

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
Quoted 55 lines · Giulio Benetti

Hi Arnout,

Quoted 52 lines · Giulio Benetti

Hi again Arnout,

Quoted 32 lines · Giulio Benetti

Hi Arnout,

Quoted 21 lines

Il giorno 5 feb 2022, alle ore 15:11, Arnout Vandecappelle <[email protected]> ha scritto:

 Hi Giulio,

Quoted 17 lines · Giulio Benetti

Actually genimage fails to create final image with:

```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```

This is because genimage 15 is less permissive than before, so let's add holes = {"(440; 512)"} to leave room to MBR.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249

---
    board/pc/genimage-bios.cfg | 1 +
    1 file changed, 1 insertion(+)
board/pc/genimage-bios.cfg +0 -1
index 26d12d9ab3..54026f6527 100644
--- a/board/pc/genimage-bios.cfg
Quoted 8 lines

board/pc/genimage-bios.cfg image disk.img { · line 10

Quoted 6 lines

+++ b/board/pc/genimage-bios.cfg

board/pc/genimage-bios.cfg +1 -0
@@ -7,6 +7,7 @@ image disk.img {
            image = "boot.img"
            offset = 0
            size = 512
+        holes = {"(440; 512)"}

Have you tested this change on an actual board (i.e. a PC :-)?

Quoted 2 lines

I’ve tested it with qemu and it boots the kernel correctly(that is in rootfs), only thing is that it can’t mount the rootfs and I don’t understand why. I wanted to ask about this but I’ve got lost among all the other patches :-)

I've compared the 2 disk.img files, one generated with genimage 14 without "holes..." and the other generated with genimage 15 and they are the same.

The problem here is not that it can't mount using qemu, but it doesn't show the shell.

Here is the qemu command:
qemu-system-x86_64 -M pc -drive file=images/disk.img,if=virtio,format=raw -net nic,model=virtio -net user

and this is the output:
https://imgur.com/a/ffZBlJR

Quoted 7 lines
Quoted 1 line

So it seems like a busybox/init system issue with tty1. I'm digging.

I've found the problem. Using the grub.cfg as it is(root=/dev/sda1) works only with Virtualbox but not with Qemu that needs s/sda1/vda1.

But it's not so well explained in readme.txt, so I'm going to send a patch for that.

Pardon, I've only misread. readme.txt is correct.

Quoted 5 lines

So I can give a:

[Giulio: tested successfully with Qemu and Virtualbox]

Best regards

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
In reply to Giulio Benetti
Quoted 6 lines · Giulio Benetti

Actually genimage fails to create final image with:

```
ERROR: hdimage(disk.img): partition [MBR] (offset 0x1b8, size 0x48) overlaps previous partition boot (offset 0x0, size 0x200)
ERROR: hdimage(disk.img): bootloaders, etc. that overlap with the partition table must declare the overlapping area as a hole.
```
Quoted 7 lines

This is because genimage 15 is less permissive than before, so let's add holes = {"(440; 512)"} to leave room to MBR.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1865935249

Applied to master, thanks.

Regards,
Arnout

Quoted 9 lines
---
  board/pc/genimage-bios.cfg | 1 +
  1 file changed, 1 insertion(+)
board/pc/genimage-bios.cfg +0 -0
index 26d12d9ab3..54026f6527 100644

board/pc/genimage-bios.cfg image disk.img { · line 13

Quoted 7 lines
board/pc/genimage-bios.cfg +1 -0
@@ -7,6 +7,7 @@ image disk.img {
  		image = "boot.img"
  		offset = 0
  		size = 512
+		holes = {"(440; 512)"}
  	}
 
  	partition grub {

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot