Date: Mon, 22 Feb 2021 14:58:45 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 253764] mkimg does not allocate space for partitions when given an absolute offset Message-ID: <bug-253764-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253764 Bug ID: 253764 Summary: mkimg does not allocate space for partitions when given an absolute offset Product: Base System Version: 11.4-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: ardovm@yahoo.it When mkimg(1) is asked to output a partition of a given size with a given absolute offset into a raw image, it does not size the output file properly. When no offset is given, the file is sized correctly: $ mkimg -f raw -o temp.img -s mbr -p freebsd::512000 creates a file that is 1001 blocks long. Relative offsets work well: $ mkimg -f raw -o temp.img -s mbr -p freebsd::512000:+512 creates a file that is 1002 blocks long. But: $ mkimg -f raw -o temp.img -s mbr -p freebsd::512000:512 creates a file that is only 1 block long, instead of 1001. Looking at the code, in file mkimg.c the problem seems to be that the "block" variable is not updated with the partition size. But I could not understand the code well enough to propose a patch, unfortunately. Additional info: $ uname -a FreeBSD myhost 11.4-STABLE FreeBSD 11.4-STABLE #1 r369279: Tue Feb 16 10:16:53 CET 2021 root@myhost:/usr/obj/usr/src/sys/GENERIC amd64 $ svn info /usr/src/usr.bin/mkimg | grep Revision Revision: 369279 -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-253764-227>
