From: Pavel Shlyak <p.shlyak@pantherx.org>
To: 55406@debbugs.gnu.org
Subject: bug#55406: Patch to handle boot flag in Image API
Date: Sat, 21 May 2022 16:09:07 +0300 [thread overview]
Message-ID: <37ECE4BB-C5C7-4C9E-A54A-03F12EA2464E@pantherx.org> (raw)
In-Reply-To: <3078A40B-22B0-4492-BFD2-72D725F31689@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
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!
[-- Attachment #2: support-bootable-partitions.patch --]
[-- Type: application/octet-stream, Size: 2641 bytes --]
cdiff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 81caa424f8..321fba40e3 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -48,12 +48,13 @@ (define (sexp->partition sexp)
"Take SEXP, a tuple as returned by 'partition->gexp', and turn it into a
<partition> record."
(match sexp
- ((size file-system file-system-options label uuid)
+ ((size file-system file-system-options label uuid flags)
(partition (size size)
(file-system file-system)
(file-system-options file-system-options)
(label label)
- (uuid uuid)))))
+ (uuid uuid)
+ (flags flags)))))
(define (size-in-kib size)
"Convert SIZE expressed in bytes, to kilobytes and return it as a string."
@@ -78,6 +79,7 @@ (define* (make-ext-image partition target root
(fs-options (partition-file-system-options partition))
(label (partition-label partition))
(uuid (partition-uuid partition))
+ (flags (partition-flags partition))
(journal-options "lazy_itable_init=1,lazy_journal_init=1"))
(apply invoke
`("fakeroot" "mke2fs" "-t" ,fs "-d" ,root
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index a6267feab2..d903cb4579 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -218,7 +218,8 @@ (define (partition->gexp partition)
#$(partition-file-system-options partition)
#$(partition-label partition)
#$(and=> (partition-uuid partition)
- uuid-bytevector)))
+ uuid-bytevector)
+ #$(partition-flags partition)))
(define gcrypt-sqlite3&co
;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs.
@@ -392,17 +393,21 @@ (define (partition->config image partition)
(partition-type-values image partition)))
(let ((label (partition-label partition))
(image (partition-image partition))
- (offset (partition-offset partition)))
+ (offset (partition-offset partition))
+ (bootable (if (member 'boot (partition-flags partition))
+ "true" "false" )))
#~(format #f "~/partition ~a {
~/~/~a = ~a
~/~/image = \"~a\"
~/~/offset = \"~a\"
+ ~/~/bootable = \"~a\"
~/}"
#$label
#$partition-type-attribute
#$partition-type-value
#$image
- #$offset))))
+ #$offset
+ #$bootable))))
(define (genimage-type-options image-type image)
(cond
next prev parent reply other threads:[~2022-05-21 16:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 21:46 bug#55406: GUIX Image API: wrong fs type and flag Pavel Shlyak
2022-05-15 17:00 ` Pavel Shlyak
2022-05-15 17:11 ` Pavel Shlyak
2022-05-20 17:01 ` bug#55406: WIP: Image API support for fat16 partitions Pavel Shlyak
2022-05-20 19:54 ` Pavel Shlyak
2022-05-21 13:09 ` Pavel Shlyak [this message]
2022-05-22 13:33 ` bug#55406: GUIX Image API: wrong fs type and flag Mathieu Othacehe
2022-05-22 14:02 ` bug#55406: [PATCH] GUIX Image API support for vfat and boot flag Pavel Shlyak
2022-05-23 8:30 ` bug#55406: GUIX Image API: wrong fs type and flag Mathieu Othacehe
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=37ECE4BB-C5C7-4C9E-A54A-03F12EA2464E@pantherx.org \
--to=p.shlyak@pantherx.org \
--cc=55406@debbugs.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.
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).