Bug 9906

Summary: genimage: Disk full
Product: buildroot Reporter: Alexander Klauer <Alexander.Klauer>
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: normal CC: buildroot, yann.morin.1998
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Alexander Klauer 2017-05-30 12:09:44 UTC
>>>   Executing post-image script board/raspberrypi3-64/post-image.sh
vfat(boot.vfat): adding file 'bcm2710-rpi-3-b.dtb' as 'bcm2710-rpi-3-b.dtb' ...
vfat(boot.vfat): adding file 'bcm2837-rpi-3-b.dtb' as 'bcm2837-rpi-3-b.dtb' ...
vfat(boot.vfat): adding file 'rpi-firmware/bootcode.bin' as 'rpi-firmware/bootcode.bin' ...
vfat(boot.vfat): adding file 'rpi-firmware/cmdline.txt' as 'rpi-firmware/cmdline.txt' ...
vfat(boot.vfat): adding file 'rpi-firmware/config.txt' as 'rpi-firmware/config.txt' ...
vfat(boot.vfat): adding file 'rpi-firmware/fixup.dat' as 'rpi-firmware/fixup.dat' ...
vfat(boot.vfat): adding file 'rpi-firmware/start.elf' as 'rpi-firmware/start.elf' ...
vfat(boot.vfat): adding file 'Image' as 'Image' ...
Disk full
vfat(boot.vfat): failed to generate boot.vfat
make[1]: *** [target-post-image] Error 1
make: *** [_all] Error 2

This little patch helps:

--- a/board/raspberrypi/genimage-raspberrypi3-64.cfg
+++ b/board/raspberrypi/genimage-raspberrypi3-64.cfg
@@ -11,7 +11,7 @@ image boot.vfat {
       "Image"
     }
   }
-  size = 32M
+  size = 64M
 }
 
 image sdcard.img {
Comment 1 Peter Korsgaard 2017-05-30 19:49:47 UTC
With what configuration and Buildroot version is this? Presumably with a big initramfs? I just did a test build with 2017.05-rc3 here and raspberrypi3_64_defconfig, and I end up with ~15 MB used in the fat partition:

sudo mount -o loop,ro images/boot.vfat /tmp/mp

df -h /tmp/mp
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0       32M   15M   18M  47% /tmp/mp

ls -lahS /tmp/mp
total 15M
-rwxr-xr-x  1 root root  12M May 30  2017 Image
-rwxr-xr-x  1 root root 2.8M May 30  2017 start.elf
drwxrwxrwt 30 root root  60K May 30 21:45 ..
-rwxr-xr-x  1 root root  50K May 30  2017 bootcode.bin
drwxr-xr-x  2 root root  16K Jan  1  1970 .
-rwxr-xr-x  1 root root  15K May 30  2017 bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root 8.2K May 30  2017 bcm2837-rpi-3-b.dtb
-rwxr-xr-x  1 root root 6.6K May 30  2017 fixup.dat
-rwxr-xr-x  1 root root  774 May 30  2017 config.txt
-rwxr-xr-x  1 root root   65 May 30  2017 cmdline.txt

If you change the configuration significantly then it isn't surprising that you may need to tweak other things, so this IMHO isn't a bug.
Comment 2 Yann E. MORIN 2017-05-30 21:16:57 UTC
Alexander, Peter, All,

> I just did a test build with 2017.05-rc3 here and raspberrypi3_64_defconfig,
> and I end up with ~15 MB used in the fat partition[...]

Ditto.

> If you change the configuration significantly then it isn't surprising
> that you may need to tweak other things, so this IMHO isn't a bug.

Agreed.

I'm closing this report. If you still have the issue with a stock
Buildroot rpi3_64 defconfig, please re-open.

Thanks! :-)
Comment 3 Alexander Klauer 2017-05-31 07:26:14 UTC
Just for the record, this was on version a6a4a8b2ef1fa747fdc79bc7bae0518417910f5d. And yes, I added the ramdisk option in the config, plus some other things.

I agree that more than 32M bootfs might not be necessary for most people. The error simply came somewhat unexpected for me, since I "just changed the config" ;-)

Would it make sense to be able to configure the bootfs size via make nconfig just as the rootfs size? Or at least print some error message pointing to the appropriate genimage.cfg so that users don't have to dig for the size option? If so, I could open an enhancement bug.
Comment 4 Yann E. MORIN 2017-06-04 09:28:37 UTC
> Would it make sense to be able to configure the bootfs size via make
> nconfig[...]?

No, it does not make sense.

Remember that our defconfigs are just basic samples to have a board
boot up to a shell. If your use-case diverges from the sample, it is
your responsibility to adapt it.

Regards,
Yann E. MORIN.