From: Efraim Flashner <efraim@flashner.co.il>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Tobias Geerinckx-Rice <me@tobias.gr>,
Simon Tournier <zimon.toutoune@gmail.com>,
paren@disroot.org, Christopher Baines <mail@cbaines.net>,
63766@debbugs.gnu.org, Ricardo Wurmus <rekado@elephly.net>,
Raghav Gururajan <rg@raghavgururajan.name>,
jgart <jgart@dismail.de>, Mathieu Othacehe <othacehe@gnu.org>
Subject: [bug#63766] [PATCH 0/4] Image for HiFive Unmatched
Date: Tue, 13 Jun 2023 12:53:47 +0300 [thread overview]
Message-ID: <ZIg8q3XKUriocOkv@3900XT> (raw)
In-Reply-To: <87jzwcv03m.fsf_-_@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2305 bytes --]
On Fri, Jun 09, 2023 at 10:42:37PM +0200, Ludovic Courtès wrote:
> Efraim Flashner <efraim@flashner.co.il> skribis:
>
> > * gnu/build/image.scm (make-unformatted-image): New procedure.
> > (make-partition-image): Add support for unformatted partition.
> > * gnu/system/image.scm (system-disk-image)[partition->gpt-type]: Add
> > case for using unformatted partition uuid.
> > [partition-image]: Add coreutils to image-builder closure.
>
> [...]
>
> > +(define* (make-unformatted-image partition target)
> > + "Make an unformatted partition of a certain size."
> > + (let ((size (partition-size partition)))
> > + (invoke "truncate" "--size" (number->string size) target)))
>
> Simply: (truncate-file target size).
Almost.
Backtrace:
1 (primitive-load "/gnu/store/v9kg0qwyws5s5m07klzkfqc9dmf…")
0 (truncate-file "/gnu/store/rcillf8ni077l9fi2cy2gdzzpqv…" …)
ERROR: In procedure truncate-file:
In procedure truncate-file: No such file or directory
I changed it to:
(let ((size (partition-size partition)))
;; Create the file and then truncate it to the desired size.
(with-output-to-file target
(lambda _ (display "")))
(truncate-file target size)))
And that got me the empty partition/block device as needed.
> > - (inputs '#+(list e2fsprogs fakeroot dosfstools mtools))
> > + (inputs '#+(list e2fsprogs ; ext2/3/4
> > + fakeroot
> > + dosfstools ; vfat
> > + mtools ; vfat
> > + coreutils)) ; truncate
>
> And this can be dropped.
Not for this review, but I'd like to make the inputs dependant on which
partition type is being made. There's no need to have dosfstools and
mtools when making an ext4 partition. And if we add a btrfs partition
option there's a large possibility that someone using that won't need
e2fsprogs at all while creating their image.
> Ludo’.
Thanks
--
Efraim Flashner <efraim@flashner.co.il> רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-06-13 19:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-28 9:41 [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Efraim Flashner
2023-05-28 9:44 ` [bug#63766] [PATCH 1/4] gnu: bootloader: Add u-boot-sifive-unmatched-bootloader Efraim Flashner
2023-05-28 9:44 ` [bug#63766] [PATCH 2/4] gnu: image: Add support for unformatted partitions Efraim Flashner
2023-06-09 20:42 ` [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Ludovic Courtès
2023-06-13 9:53 ` Efraim Flashner [this message]
2023-06-21 22:08 ` Ludovic Courtès
2023-05-28 9:44 ` [bug#63766] [PATCH 3/4] system: images: Add unmatched module Efraim Flashner
2023-06-09 20:46 ` [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Ludovic Courtès
2023-05-28 9:44 ` [bug#63766] [PATCH 4/4] gnu: glibc-2.33: Fix building for riscv64-linux Efraim Flashner
2023-06-09 20:49 ` [bug#63766] [PATCH 0/4] Image for HiFive Unmatched Ludovic Courtès
2023-06-09 20:50 ` Ludovic Courtès
2023-06-14 11:59 ` bug#63766: " Efraim Flashner
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=ZIg8q3XKUriocOkv@3900XT \
--to=efraim@flashner.co.il \
--cc=63766@debbugs.gnu.org \
--cc=jgart@dismail.de \
--cc=ludo@gnu.org \
--cc=mail@cbaines.net \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=paren@disroot.org \
--cc=rekado@elephly.net \
--cc=rg@raghavgururajan.name \
--cc=zimon.toutoune@gmail.com \
/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).