GNU bug report logs - #55406
GUIX Image API: wrong fs type and flag

Previous Next

Package: guix;

Reported by: Pavel Shlyak <shlyakpavel <at> gmail.com>

Date: Fri, 13 May 2022 23:01:03 UTC

Severity: normal

Merged with 55405

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55406 in the body.
You can then email your comments to 55406 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Fri, 13 May 2022 23:01:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pavel Shlyak <shlyakpavel <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 13 May 2022 23:01:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <shlyakpavel <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: GUIX Image API: wrong fs type and flag
Date: Sat, 14 May 2022 00:46:57 +0300
I have a scheme code like

(define rpi-boot-partition
(partition
(size (* 128 (expt 2 20)))
(label "BOOT")
(file-system "vfat")
(flags '())
(initializer (gexp initialize-efi-partition))))

(define rpi-root-partition
(partition
(size 'guess)
(label "RASPIROOT")
(file-system "ext4")
(flags '(boot))
(initializer (gexp initialize-root-partition))))

(define raspberry-pi-image
(image
(format 'disk-image)
(partitions (list rpi-boot-partition rpi-root-partition))))

The output is like that:
$ fdisk -l /gnu/store/hnsfs5a161f5hvymg7ar541qrml62yvv-raspberry-pi-barebones-raw-image
Device Boot Start End Sectors Size Id Type
/gnu/store/hnsfs5a161f5hvymg7ar541qrml62yvv-raspberry-pi-barebones-raw-image1 1 262144 262144 128M 83 Linux
/gnu/store/hnsfs5a161f5hvymg7ar541qrml62yvv-raspberry-pi-barebones-raw-image2 262145 3583688 3321544 1.6G 83 Linux	

No boot flag is set on the first partition. The file system seems to be incorrect (ext* instead of vfat)



Merged 55405 55406. Request was from Tobias Geerinckx-Rice <me <at> tobias.gr> to control <at> debbugs.gnu.org. (Sat, 14 May 2022 08:28:02 GMT) Full text and rfc822 format available.

Merged 55405 55406. Request was from Maxime Devos <maximedevos <at> telenet.be> to control <at> debbugs.gnu.org. (Sat, 14 May 2022 09:17:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Sun, 15 May 2022 17:12:02 GMT) Full text and rfc822 format available.

Message #12 received at 55406 <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <shlyakpavel <at> gmail.com>
To: 55406 <at> debbugs.gnu.org
Subject: GUIX Image API: wrong fs type and flag
Date: Sun, 15 May 2022 20:11:11 +0300
[Message part 1 (text/plain, inline)]
I found it. It blows my mind. Let me just cry out here.

    (define (partition->dos-type partition)
      ;; Return the MBR partition type corresponding to the given PARTITION.
      ;; See: https://en.wikipedia.org/wiki/Partition_type.
      (let ((flags (partition-flags partition)))
        (cond
         ((member 'esp flags) "0xEF")
         (else "0x83"))))

    (define (partition->gpt-type partition)
      ;; Return the genimage GPT partition type code corresponding to PARTITION.
      ;; See https://github.com/pengutronix/genimage/blob/master/README.rst
      (let ((flags (partition-flags partition)))
        (cond
          ((member 'esp flags) "U")
          (else "L"))))
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Sun, 15 May 2022 22:17:03 GMT) Full text and rfc822 format available.

Message #15 received at 55406 <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <p.shlyak <at> pantherx.org>
To: 55406 <at> debbugs.gnu.org
Subject: GUIX Image API: wrong fs type and flag
Date: Sun, 15 May 2022 20:00:14 +0300
It looks like setting esp flag with (flags '(esp)) also sets file system to vfat. However,
1. I still cannot resolve boot flag issue
2. I do not need that flag and I’d be glad getting correct partition without it



Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Fri, 20 May 2022 17:28:02 GMT) Full text and rfc822 format available.

Message #18 received at 55406 <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <p.shlyak <at> pantherx.org>
To: 55406 <at> debbugs.gnu.org
Subject: WIP: Image API support for fat16 partitions
Date: Fri, 20 May 2022 20:01:45 +0300
[Message part 1 (text/plain, inline)]
I have written a small patch to partially fix the issue. Flags are still not set. GPT is still not fixed. There’s no need to return file systems that are not supported in make-partition-image function in gnu/build/image.scm
[mbr-support-vfat-partitions.patch (application/octet-stream, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Fri, 20 May 2022 20:33:02 GMT) Full text and rfc822 format available.

Message #21 received at 55406 <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <p.shlyak <at> pantherx.org>
To: 55406 <at> debbugs.gnu.org
Subject: WIP: Image API support for fat16 partitions
Date: Fri, 20 May 2022 22:54:47 +0300
[Message part 1 (text/plain, inline)]
This patch fixes GPT support for fat partitions. Should be applied after gpt-support-vfat-partitions.patch
[gpt-support-vfat-partitions.patch (application/octet-stream, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Sat, 21 May 2022 16:49:02 GMT) Full text and rfc822 format available.

Message #24 received at 55406 <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <p.shlyak <at> pantherx.org>
To: 55406 <at> debbugs.gnu.org
Subject: Patch to handle boot flag in Image API
Date: Sat, 21 May 2022 16:09:07 +0300
[Message part 1 (text/plain, inline)]
Here’s the last patch in the set that adds support for the boot flag. It should be merged after mbr-support-vfat-partitions.patch and gpt-support-vfat-partitions.patch
The issue can be closed as soon as all three patches are merged.
Have a nice day!
 
[support-bootable-partitions.patch (application/octet-stream, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Sun, 22 May 2022 13:34:01 GMT) Full text and rfc822 format available.

Message #27 received at 55406 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Pavel Shlyak <p.shlyak <at> pantherx.org>
Cc: 55406 <at> debbugs.gnu.org
Subject: Re: bug#55406: GUIX Image API: wrong fs type and flag
Date: Sun, 22 May 2022 15:33:22 +0200
Hello Pavel,

> Here’s the last patch in the set that adds support for the boot
> flag. It should be merged after mbr-support-vfat-partitions.patch and
> gpt-support-vfat-partitions.patch The issue can be closed as soon as
> all three patches are merged.  Have a nice day!

Thanks for those three patches. At first sight, they look fine :) It
would be great if you could resend them using "git format-patch",
following the guidelines available here:
https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html.

Could you also add your copyright on top of the edited files?

Mathieu




Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Sun, 22 May 2022 14:03:02 GMT) Full text and rfc822 format available.

Message #30 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <p.shlyak <at> pantherx.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 55406 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: [PATCH] GUIX Image API support for vfat and boot flag
Date: Sun, 22 May 2022 17:02:33 +0300
[Message part 1 (text/plain, inline)]
Ok, I tried to format them :)
[0001-Image-API-support-VFAT-partitions-in-MBR.patch (application/octet-stream, attachment)]
[0002-Image-API-support-VFAT-partitions-in-GPT.patch (application/octet-stream, attachment)]
[0003-Image-API-support-boot-flag.patch (application/octet-stream, attachment)]
[0004-Update-copyright.patch (application/octet-stream, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#55406; Package guix. (Sun, 22 May 2022 14:03:02 GMT) Full text and rfc822 format available.

Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Mon, 23 May 2022 08:31:01 GMT) Full text and rfc822 format available.

Notification sent to Pavel Shlyak <shlyakpavel <at> gmail.com>:
bug acknowledged by developer. (Mon, 23 May 2022 08:31:01 GMT) Full text and rfc822 format available.

Message #38 received at 55406-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Pavel Shlyak <p.shlyak <at> pantherx.org>
Cc: 55406-done <at> debbugs.gnu.org
Subject: Re: bug#55406: GUIX Image API: wrong fs type and flag
Date: Mon, 23 May 2022 10:30:23 +0200
Hello Pavel,

> Ok, I tried to format them :)

Thanks, I added commit messages following our guidelines, fixed the
indentation and a few other small details.

Pushed on master!

Mathieu




Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Mon, 23 May 2022 08:31:02 GMT) Full text and rfc822 format available.

Notification sent to Pavel Shlyak <shlyakpavel <at> gmail.com>:
bug acknowledged by developer. (Mon, 23 May 2022 08:31:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Jun 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.