On Fri, Jun 09, 2023 at 10:42:37PM +0200, Ludovic Courtès wrote: > Efraim Flashner 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 רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted