guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/20: x add make-squashfs-image


From: guix-commits
Subject: 06/20: x add make-squashfs-image
Date: Tue, 3 Sep 2024 16:19:00 -0400 (EDT)

nckx pushed a commit to branch mol
in repository guix.

commit c04d489e772206b27e90681addfa2b578d4ebb89
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Sun Aug 20 02:00:00 2023 +0200

    x add make-squashfs-image
---
 gnu/build/image.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 6ca0a428e0..349ac8dcf5 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -101,6 +101,22 @@ turn doesn't take any constant overhead into account, 
force a 1-MiB minimum."
                            (estimate-partition-size root)
                            size)))))))
 
+(define* (make-squashfs-image partition target root
+                              #:key
+                              (owner-uid 0)
+                              (owner-gid 0))
+  "Handle the creation of Squashfs partition images.
+See 'make-partition-image'."
+  (let ((fs (partition-file-system partition))
+        (fs-options (partition-file-system-options partition)))
+    (apply invoke
+           `("fakeroot" "gensquashfs" "-D" ,root
+             "-j1" "-b" ,(number->string (ash 1 20))
+             "-u" ,owner-uid "-g" ,owner-gid
+             "-c" "zstd"
+             ,@fs-options
+             ,target))))
+
 (define* (make-vfat-image partition target root fs-bits)
   "Handle the creation of VFAT partition images.  See 'make-partition-image'."
   (let ((size (partition-size partition))
@@ -139,6 +155,8 @@ ROOT directory to populate the image."
     (cond
      ((string-prefix? "ext" type)
       (make-ext-image partition target root))
+     ((string=? "squashfs" type)
+      (make-squashfs-image partition target root))
      ((or (string=? type "vfat") (string=? type "fat16"))
       (make-vfat-image partition target root 16))
      ((string=? type "fat32")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]