All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Schmitt" <scdbackup@gmx.net>
To: alain@knaff.lu
Cc: <grub-devel@gnu.org>
Subject: Re: Several GNU projects wondering about the reason for mformat partition table
Date: Sun, 02 Jun 2019 20:34:05 +0200	[thread overview]
Message-ID: <29131676412833610017@scdbackup.webframe.org> (raw)
In-Reply-To: <c549cd13-ae40-c3ac-7129-4d78c864faab@knaff.lu>

Hi,

thanks a lot for the background info.

Alain Knaff wrote:
> A platform that expects the disk to be unpartitioned would just ignore
> this mini partition table.

The EFI platform encounters the mformat-produced image in a partition.
Nearly all implementations indeed ignore the MBR-ish table in the
partition. But one wanted to be smart, obviously.
(The disk device, a USB stick, was partitioned by GPT.)

If you see any other potential problem with using a mformat image
as content of a partition, then please tell.


> In the next release I'll provide a new option to just skip this
> partition table [...]
>
> If all goes well, I expect to make this new release by the end of the month

Good move.

------------------------------------------------------------------------

I assume that grub-mkrescue will have to wait a while before it can
unconditionally use a new option of mformat, or that it will need a
function like check_xorriso()
  http://git.savannah.gnu.org/cgit/grub.git/tree/util/grub-mkrescue.c#n316
which is used to look for a five year old option in the help text of xorriso:
  http://git.savannah.gnu.org/cgit/grub.git/tree/util/grub-mkrescue.c#n608


The three alternatives for grub-mkrescue now look like this:

> > - Keep the partition entry because its removal could break some other
> >   EFI firmware's boot process.

No objections are known yet against partition table removal. Its purpose
has nothing to do with the use case as EFI System Partition.
I am out of ideas whom else to ask for an opinion.


So i think grub-mkrescue should dare to choose one of the other two:

> > - Overwrite the partition table in bytes 446 to 509 of the mformat result
> >   by zeros before populating it with files.

If i am not mistaken, then this is equivalent to the new option of mformat.
grub-mkrescue could anticipate this option by own postprocessing after the
mformat run.


> > - Use mformat option -k to avoid production of the partition table.

Alain Knaff wrote about the new option probably in contrast to -k:
> [...] but still initialize the other fields (jump at
> beginning of boot sector, mformat "banner", 0xaa55 boot signature,
> physdrive, mtools boot code, zeroing out unused bytes)

None of the items in this list looks like it would be necessary for a
partition image which gets created as new file. I assume that no non-zero
bytes can sneak in, if the image file does not exist before it gets
written by mformat.


Have a nice day :)

Thomas



      reply	other threads:[~2019-06-02 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 16:52 Several GNU projects wondering about the reason for mformat partition table Thomas Schmitt
2019-05-20 22:09 ` Mihai Moldovan
2019-06-02  7:03 ` Alain Knaff
2019-06-02 18:34   ` Thomas Schmitt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29131676412833610017@scdbackup.webframe.org \
    --to=scdbackup@gmx.net \
    --cc=alain@knaff.lu \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.