All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexander E. Patrakov" <patrakov@gmail.com>
To: Andrei Borzenkov <arvidjaar@gmail.com>,
	The development of GNU GRUB <grub-devel@gnu.org>,
	bug-xorriso@gnu.org
Subject: Re: [Bug-xorriso] grub-mkrescue does not boot on older Macs as USB stick
Date: Thu, 24 Dec 2015 00:37:39 +0500	[thread overview]
Message-ID: <567AF803.7080005@gmail.com> (raw)
In-Reply-To: <567AEB71.7020208@gmail.com>

23.12.2015 23:44, Andrei Borzenkov пишет:
> OK, it turned out to be not related to xorriso, but for the record ...
>
> Mac does not like FAT created by mformat. I can reproduce it easily by
> creating single MSDOS partition on USB stick of type 0xef size 2880K,
> formatting it with same options as grub-mkrescue:
>
> sudo mformat -C -f 2880 -L 16 -i /dev/sdb1 ::
>
> and copying bootx64.efi into \EFI\BOOT on it.
>
> The same partition formatted with mkfs -t fat works like a charm.
>
> Both Porteus and openSUSE CD (which correctly boot) have ESP created by
> mkfs.fat.
>
> TBH I think that precreating FAT once and shipping image with GRUB is
> the most simple solution. It can be empty, we can dd files later.
>
> Ideas?
>

I have byte-compared the boot sectors (because that's the only different 
things in the filesystems).

So, here are the differences:

Bytes 0x03 .. 0x0a represent the OEM ID (software that created the 
filesystem). mformat: "MTOO4018", mkfs.vfat: "mkfs.fat". Should not be 
significant.

Bytes 0x11 .. 0x12: a WORD that represents the number of root directory 
entries. mformat: 240, mkfs.vfat: 224. This is settable via the -r 
parameter of mformat.

Bytes 0x27 .. 0x2a: a DWORD with the serial number of the filesystem. 
Should not be significant.

Bytes 0x3e .. 0x1fe: x86 bootstrap code, which is not executed and thus 
is likely not significant.

If you make the number of root directory entries match (using -r 14), 
then there appears a difference in bytes 0x16 .. 0x17, which form a WORD 
that means the number of sectors per FAT. mformat -r 14: 16, mkfs.vfat: 
9. But this is settable with -L.

So, could you please run this?

sudo mformat -C -f 2880 -L 9 -r 14 -i /dev/sdb1 ::

If this fails, try giving mformat a known-good x86 boot sector using the 
-B option.

-- 
Alexander E. Patrakov


  reply	other threads:[~2015-12-23 19:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22 20:02 grub-mkrescue does not boot on older Macs as USB stick Andrei Borzenkov
2015-12-23 18:44 ` Andrei Borzenkov
2015-12-23 19:37   ` Alexander E. Patrakov [this message]
2015-12-24 20:17     ` [Bug-xorriso] " Andrei Borzenkov
2015-12-25 17:35       ` Alexander E. Patrakov
2015-12-25 17:44         ` Andrei Borzenkov
2015-12-25 17:50           ` Alexander E. Patrakov
  -- strict thread matches above, loose matches on Subject: below --
2015-12-22 20:02 Andrei Borzenkov
2015-12-22 20:42 ` [Bug-xorriso] " Alexander E. Patrakov

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=567AF803.7080005@gmail.com \
    --to=patrakov@gmail.com \
    --cc=arvidjaar@gmail.com \
    --cc=bug-xorriso@gnu.org \
    --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.