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: [email protected]
          Reporter: [email protected]

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.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to