Skip to content

Image size in % does not work #227

@Zlika

Description

@Zlika

Hello,
I'm using genimage 15 (through buildroot 2022.02.8) and specifying an image size in % does not seem to work.
My configuration file is:

image boot.vfat {
	vfat {
		files = {
			"zImage",
			"socfpga_cyclone5_de10_standard.dtb"
		}
		file extlinux/extlinux.conf {
			image = "extlinux.conf"
		}
	}

	size = 20M
}

image sdcard.img {
	hdimage {
	}

	partition boot {
		partition-type = 0xc
		bootable = "true"
		image = "boot.vfat"
	}

	partition uboot {
		partition-type = 0xa2
		image = "u-boot-with-spl.sfp"
	}
}

This config file works, but if I replace the "size = 20M" with a percent value (e.g. "size=120%" or even "size=200%") I always have the following error message:
mkdosfs: Attempting to create a too small or too large filesystem.

Here is the full log with --loglevel=3:

>>>   Executing post-image script support/scripts/genimage.sh
INFO: cmd: "mkdir -p "/home/thomas/git/buildroot/output/build/genimage.tmp"" (stderr+stdout):
INFO: cmd: "rm -rf "/home/thomas/git/buildroot/output/build/genimage.tmp"/*" (stderr+stdout):
DEBUG: vfat(boot.vfat): adding implicit file rule for 'extlinux.conf'
DEBUG: vfat(boot.vfat): adding implicit file rule for 'zImage'
DEBUG: vfat(boot.vfat): adding implicit file rule for 'socfpga_cyclone5_de10_standard.dtb'
DEBUG: hdimage(sdcard.img): adding implicit file rule for 'u-boot-with-spl.sfp'
INFO: cmd: "mkdir -p "/home/thomas/git/buildroot/output/build/genimage.tmp"" (stderr+stdout):
INFO: cmd: "cp -a "/tmp/tmp.sOOkd31ndS" "/home/thomas/git/buildroot/output/build/genimage.tmp/root"" (stderr+stdout):
INFO: cmd: "find '/home/thomas/git/buildroot/output/build/genimage.tmp/root' -depth -type d -printf '%P\0' | xargs -0 -I {} touch -r '/tmp/tmp.sOOkd31ndS/{}' '/home/thomas/git/buildroot/output/build/genimage.tmp/root/{}'" (stderr+stdout):
INFO: cmd: "mkdir -p "/home/thomas/git/buildroot/output/images"" (stderr+stdout):
INFO: vfat(boot.vfat): cmd: "dd if=/dev/zero of="/home/thomas/git/buildroot/output/images/boot.vfat" seek=6144 count=0 bs=1 2>/dev/null" (stderr+stdout):
INFO: vfat(boot.vfat): cmd: "mkdosfs   '/home/thomas/git/buildroot/output/images/boot.vfat'" (stderr+stdout):
mkfs.fat 4.2 (2021-01-31)
mkdosfs: Attempting to create a too small or a too large filesystem
INFO: vfat(boot.vfat): cmd: "rm -f "/home/thomas/git/buildroot/output/images/boot.vfat"" (stderr+stdout):
ERROR: vfat(boot.vfat): failed to generate boot.vfat

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions