x86/boot: Fix make hdimage with older versions of mtools
authorH. Peter Anvin (Intel) <hpa@zytor.com>
Sat, 11 Sep 2021 00:39:06 +0000 (17:39 -0700)
committerBorislav Petkov <bp@suse.de>
Wed, 29 Sep 2021 09:06:47 +0000 (11:06 +0200)
commit067595d728179219c120dd50b4dc711e92f1eb16
treef9aa4e40c099a93fbaf88fae4bbc3cb51f79ec4a
parent5816b3e6577eaa676ceb00a848f0fd65fe2adc29
x86/boot: Fix make hdimage with older versions of mtools

Some versions of mtools (fixed somewhere between 4.0.31 and 4.0.35)
generate bad output for mformat when used with the partition= option.
Use the offset= option instead. An mtools.conf entry is *also* needed
with partition= to support mpartition; combining them in one entry does
not work either.

Don't specify the -t option to mpartition; it is unnecessary and seems
to confuse mpartition under some circumstances.

Also do a few minor optimizations:

Use a larger cluster size; there is no reason for the typical 4K
clusters when we are dealing mainly with comparatively huge files.

Start the partition at 32K. There is no reason to align it more than
that, since the internal FAT filesystem structures will at best be
cluster-aligned, and 32K is the maximum FAT cluster size.

 [ bp: Remove "we". ]

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210911003906.2700218-1-hpa@zytor.com
arch/x86/boot/genimage.sh
arch/x86/boot/mtools.conf.in