Skip to contentSkip to conversation

Further partition creation with genimage fails

Buildroot AAlex_ 2 participants 3 messages Feb 1, 2018

lore
Share & tools
lore

AAlex_

author
#0 lore raw

Hi,
trying to define a further (third) partition within the disk.img fails. With error messge:
/genext2fs: couldn't allocate a block (no free space) ext4(data.ext4): failed to generate data.ext4/

Added to the disk.img block in genimage config file a partition named data.ext4
(complete config script genimage config on pastebin
<https://pastebin.com/yN1Zfb5r> )

Creating manually the partition file via dd within the output/image folder works.
But the goal is creating the partition file when building the system.

Thanks for help or proposal

Regards,
AAlex

--
Sent from: http://buildroot-busybox.2317881.n4.nabble.com/

#1 lore raw
Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"AAlex" == AAlex <[email protected]> writes:

Hi,
trying to define a further (third) partition within the disk.img fails. With error messge:
/genext2fs: couldn't allocate a block (no free space) ext4(data.ext4): failed to generate data.ext4/

Added to the disk.img block in genimage config file a partition named data.ext4
(complete config script genimage config on pastebin
<https://pastebin.com/yN1Zfb5r> )

Quoted 5 lines

Creating manually the partition file via dd within the output/image folder works.
But the goal is creating the partition file when building the system.

Thanks for help or proposal

Looking at the genimage code (image-ext2.c) I see it runs genext2fs:

        ret = systemp(image, "%s -d %s --size-in-blocks=%lld -i 16384 %s %s",
                        get_opt("genext2fs"),
                        mountpath(image), image->size / 1024, imageoutfile(image),
                        extraargs);

You could run genimage with '--loglevel 2' to see exactly what arguments it was executed with.

I did a quick test here, and it seems to work for me. You do have enough disk space on your build machine, right?

Do notice that we have moved away from using genext2fs for creating the ext2/3/4 rootfs in Buildroot. Once issue with genext2fs is that it doesn't know about the new features in ext3/4, so depending on your use case you may be better up running mkfs.ext4 in your post-image script manually.

Signature · 1 line
Bye, Peter Korsgaard
author
#2 lore raw

Hi,
enabled loglevel 2 in genimage,
the data.ext4 is given as a further argument to genext2fs genext2fs -d <DIR>/buildroot2017.11rc/pc_x86_64_efi_defconfig/output/build/genimage.tmp/root --size-in-blocks=131072 -i 16384 <DIR>/buildroot2017.11rc/pc_x86_64_efi_defconfig/output/images/data.ext4

But as you mentioned i will not longer use the genext2fs tool, so what i did:
Editing board/pc/post-image.sh, added following:
/dd if=/dev/zero of=${BINARIES_DIR}/data.ext4 bs=124M count=1 mkfs.ext4 -F ${BINARIES_DIR}/data.ext4
echo "created: ${BINARIES_DIR}/data.ext4"
/

And keep just the partition data{} ]entry in the board/pc/genimage-efi.cfg:

/partition data {
    partition-type = 0x83
    image = "data.ext4"

}/

This works fine...and no further dependency on genext2fs tool.

So i dont need BR2_PACKAGE_HOST_GENEXT2FS anymore.

Regards,
AAlex

--
Sent from: http://buildroot-busybox.2317881.n4.nabble.com/