unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Thomas Schmitt <scdbackup@gmx.net>
Cc: bug-xorriso@gnu.org, guix-devel@gnu.org
Subject: Re: ISO installer image: GPT versus MBR partitions
Date: Thu, 25 Apr 2019 19:55:21 +0200	[thread overview]
Message-ID: <20190425195521.4dd1ef5e@scratchpost.org> (raw)
In-Reply-To: <198856777051031048477@scdbackup.webframe.org>

[-- Attachment #1: Type: text/plain, Size: 4253 bytes --]

Hi Thomas,

On Thu, 25 Apr 2019 18:22:11 +0200
"Thomas Schmitt" <scdbackup@gmx.net> wrote:

> Then do if you can make use of those two git commits.
> They are the only ones to that file since release 1.5.0.

Okay, I've picked them up.

> > I'm not sure about amending "guix system disk-image" by options that
> > aren't really end user options, but I guess it can't be helped.  
> 
> How about
> 
>   --file-system-type=iso9660[_$variation]
> 
> with $variation being "gpt_hfs" (= "original"), "mbr_hfs", "mbr_only",
> and "gpt_appended", defaulting to "gpt_hfs" ?

I'm not sure yet.  We have a lot of special-casing for iso9660
already.  If anything, at that point, we could pass an arbitrary list
of options or something (an "environment" if you will.  Hah).

> This translates quite straightforward to the proposed variations of
> grub-mkrescue-sed.sh in
>   http://lists.gnu.org/archive/html/guix-devel/2019-04/msg00420.html
> 
> The partition offset 16 and MBR partition type 0x83 would be ordered
> only with "mbr_*" variations.
> 
> The setting
>   export MKRESCUE_SED_IN_EFI_NO_PT=yes
> should be used unconditionally. It gets applied to the EFI partition
> block 0, only if it is marked with an MBR signature 55 aa. Then we may
> safely assume that bytes 446 to 509 are MBR partition table, which is
> of no use and maybe harmfull. Only then they get zeroed.

Okay, that makes sense.

> If the Guix download servers can afford two more ISOs, how about offering
> "gpt_hfs" and "mbr_hfs" ISOs with the explanation that both should work
> for booting and installing, but that "mbr_hfs" is more convenient when
> the remaining capacity of a Guix ISO USB stick shall be used as partition
> for a read-write filesystem.
> (Moving the backup GPT is an expert option in fdisk. But without moving
>  it there is no room for a new partition.)

I don't know these things.  But someone on the list will know.

> On the long run and if no negative results arise, i propose to switch the
> default to "mbr_hfs".

Yeah, I agree.

> I tried hard to keep it conservative and am open for proposals to
> make it more portable to older shells.

The problem is that there were horrible security problems in bash and that
made a lot of distributions switch to a more minimal shell ("dash") for
scripts.  I agree that that was a good move, but error handling is even
worse there.

> > But then grub-mkrescue will invoke
> > grub-mkrescue-sed.sh at runtime, and who knows what the latter will pick up
> > as the sed to use?  
> 
> grub-mkrescue runs the mformat program and the mcopy program before
> it runs xorriso.

Yeah, we patch grub-mkrescue to use an absolute path for mformat and mcopy
in order to make them predictable.

> > For example in grub-mkrescue-sed.sh there's no "-e" in the shebang  
> 
> Is it conservative enough to add it ?

It will exit the shell when one of the toplevel commands has an
exit status != 0.
So as long as your script doesn't have toplevel commands return error status
in normal operation it should be fine.

Toplevel:

$ grep foo bar

Not toplevel:

$ if grep foo bar

(that won't fail the script even with "-e")

Questionable:

$ foo | bar

If foo fails, should the script fail?  Spoiler: It won't fail the script even with "-e".
If bar fails, should the script fail?  Spoiler: It will fail the script with "-e".

But:

$ set -e
$ set -o pipefail
$ foo | bar

Now if foo or bar fails, the script will fail.

> > Guile, on the other hand, will just fail the script on error (usually).  
> 
> That's why i brought a Guile re-write into consideration.
> Firstly it would be the language of choice and secondly it would make
> Guix independent of my ideas how it should be done. 

We're not trying to become iso bootloader experts ourselves :)

>As said, the
> script-in-the-middle gives substantial control over the stage of
> grub-mkrescue when the prepared files are still not packed up in the ISO.
> 
> (Or maybe it's time to re-write the script in C ... as was done with
>  grub-mkrescue when it became too complicated.)

Yeah, we'll see.  For now, let's try the shell script and make it more
paranoid.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-04-25 17:55 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190415165451.dpzngealeisbibc7@pelzflorian.localdomain>
     [not found] ` <1582867226375139246@scdbackup.webframe.org>
2019-04-16  9:57   ` bug#33639: ISO installer image is broken on i686 Gábor Boskovits
2019-04-16 13:40     ` ISO installer image: GPT versus MBR partitions (was bug#33639) Thomas Schmitt
2019-04-16 16:32       ` pelzflorian (Florian Pelz)
2019-04-16 17:57         ` ISO installer image: GPT versus MBR partitions Thomas Schmitt
2019-04-16 19:55           ` pelzflorian (Florian Pelz)
2019-04-16 20:31             ` pelzflorian (Florian Pelz)
2019-04-16 21:15               ` Thomas Schmitt
2019-04-17  8:59                 ` pelzflorian (Florian Pelz)
2019-04-17 10:23                   ` Thomas Schmitt
2019-04-17 10:30                     ` pelzflorian (Florian Pelz)
2019-04-17 15:51                     ` Thomas Schmitt
2019-04-17 22:35                       ` pelzflorian (Florian Pelz)
2019-04-18  6:32                         ` Thomas Schmitt
2019-04-18  7:00                           ` Thomas Schmitt
2019-04-18  7:07                             ` pelzflorian (Florian Pelz)
2019-04-18  8:13                               ` Thomas Schmitt
2019-04-18 12:19                                 ` pelzflorian (Florian Pelz)
2019-04-18 13:50                                   ` Thomas Schmitt
2019-04-18 21:28                                     ` Thomas Schmitt
2019-04-19  7:29                                       ` pelzflorian (Florian Pelz)
2019-04-19  8:03                                     ` pelzflorian (Florian Pelz)
2019-04-19  9:01                                       ` Thomas Schmitt
2019-04-19  9:39                                         ` pelzflorian (Florian Pelz)
2019-04-19 10:58                                           ` Thomas Schmitt
2019-04-19 14:57                                             ` pelzflorian (Florian Pelz)
2019-04-19 11:30                                         ` pelzflorian (Florian Pelz)
2019-04-19 18:33                                           ` pelzflorian (Florian Pelz)
2019-04-19 19:23                                             ` Thomas Schmitt
2019-04-20 10:26                                               ` pelzflorian (Florian Pelz)
2019-04-20 10:50                                                 ` Thomas Schmitt
2019-04-20 11:16                                                   ` Thomas Schmitt
2019-04-20 11:29                                                     ` Thomas Schmitt
2019-04-20 14:23                                                       ` Thomas Schmitt
2019-04-20 14:54                                                         ` pelzflorian (Florian Pelz)
2019-04-20 15:17                                                           ` pelzflorian (Florian Pelz)
2019-04-20 15:33                                                           ` pelzflorian (Florian Pelz)
2019-04-20 16:32                                                             ` Thomas Schmitt
2019-04-21  7:58                                                               ` pelzflorian (Florian Pelz)
2019-04-21  9:35                                                                 ` Thomas Schmitt
2019-04-21 11:10                                                                   ` pelzflorian (Florian Pelz)
2019-04-21 11:16                                                                 ` Thomas Schmitt
2019-04-21 11:56                                                                   ` pelzflorian (Florian Pelz)
2019-04-21 12:27                                                                     ` Thomas Schmitt
2019-04-21 14:11                                                                       ` pelzflorian (Florian Pelz)
2019-04-21 14:36                                                                         ` Thomas Schmitt
2019-04-22 13:11                                                                           ` Thomas Schmitt
2019-04-23 16:40                                                                       ` pelzflorian (Florian Pelz)
2019-04-23 17:23                                                                         ` Thomas Schmitt
2019-04-17 12:24               ` Ludovic Courtès
2019-04-17 13:42                 ` pelzflorian (Florian Pelz)
2019-04-23 18:14       ` Thomas Schmitt
2019-04-23 19:50         ` pelzflorian (Florian Pelz)
2019-04-23 20:18           ` Thomas Schmitt
2019-04-23 21:43             ` pelzflorian (Florian Pelz)
2019-04-24  6:56               ` Thomas Schmitt
2019-04-24  9:13                 ` pelzflorian (Florian Pelz)
2019-04-24 10:34                   ` Thomas Schmitt
2019-04-24 22:13                     ` Danny Milosavljevic
2019-04-25  7:07                       ` Thomas Schmitt
2019-04-25  9:45                       ` pelzflorian (Florian Pelz)
2019-04-25 13:44                         ` Thomas Schmitt
2019-04-25 14:59                           ` Danny Milosavljevic
2019-04-25 16:22                             ` Thomas Schmitt
2019-04-25 17:55                               ` Danny Milosavljevic [this message]
2019-04-25 18:46                                 ` Thomas Schmitt
2019-04-25 19:01                                   ` Danny Milosavljevic
2019-04-25 16:34                         ` Ludovic Courtès
2019-04-26 11:34                           ` pelzflorian (Florian Pelz)
2019-04-26 14:41                             ` Ludovic Courtès
2019-04-26 15:30                               ` pelzflorian (Florian Pelz)
2019-04-26 13:57                           ` Thomas Schmitt
2019-04-27 13:20                             ` Ludovic Courtès
2019-04-27 16:24                               ` Thomas Schmitt
2019-04-28 12:53                                 ` Ludovic Courtès
2019-04-25 11:49                   ` pelzflorian (Florian Pelz)
2019-04-25 15:09                     ` Thomas Schmitt
2019-04-25 15:58                       ` pelzflorian (Florian Pelz)
2019-04-25 16:40                         ` Thomas Schmitt

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20190425195521.4dd1ef5e@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=bug-xorriso@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=scdbackup@gmx.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).