summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorCayetano Santos <csantosb@inventati.org>2026-03-10 19:03:40 +0100
committerCayetano Santos <csantosb@inventati.org>2026-03-13 19:29:31 +0100
commit706541d384f5a2ee5ad3cd88909d22c0c13c4c27 (patch)
tree38878bf4aaa3f3c55e30135cc67de80693055c0d /gnu
parent2f61b27d367d16cf9fd3f022cba27cf2c7c2a251 (diff)
gnu: genimage: Move to flashing-tools.
* gnu/packages/genimage.scm: Remove. * packages/patches/genimage-mke2fs-test.patch: Remove. * gnu/local.mk (GNU_SYSTEM_MODULES): Unregister module. (dist_patch_DATA): Unregister patch. * po/packages/POTFILES.in: Unregister module. * gnu/packages/flashing-tools.scm (genimage): Add variable. * gnu/packages/image.scm: Update used module. Merges guix/guix!7045 Change-Id: Iaeafca2b63bcd92f588894543316b968f45c577c
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/packages/flashing-tools.scm124
-rw-r--r--gnu/packages/genimage.scm154
-rw-r--r--gnu/packages/patches/genimage-mke2fs-test.patch40
-rw-r--r--gnu/system/image.scm2
5 files changed, 124 insertions, 198 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 72f3cfff9f6..328f881aab4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -313,7 +313,6 @@ GNU_SYSTEM_MODULES = \
313 %D%/packages/gd.scm \ 313 %D%/packages/gd.scm \
314 %D%/packages/gdb.scm \ 314 %D%/packages/gdb.scm \
315 %D%/packages/genealogy.scm \ 315 %D%/packages/genealogy.scm \
316 %D%/packages/genimage.scm \
317 %D%/packages/geo.scm \ 316 %D%/packages/geo.scm \
318 %D%/packages/gettext.scm \ 317 %D%/packages/gettext.scm \
319 %D%/packages/ghostscript.scm \ 318 %D%/packages/ghostscript.scm \
@@ -1430,7 +1429,6 @@ dist_patch_DATA = \
1430 %D%/packages/patches/gemmi-fix-pegtl-usage.patch \ 1429 %D%/packages/patches/gemmi-fix-pegtl-usage.patch \
1431 %D%/packages/patches/gemmi-fix-sajson-types.patch \ 1430 %D%/packages/patches/gemmi-fix-sajson-types.patch \
1432 %D%/packages/patches/gemrb-remove-ifdef-and-externalize-path-setting-to-cmake.patch \ 1431 %D%/packages/patches/gemrb-remove-ifdef-and-externalize-path-setting-to-cmake.patch \
1433 %D%/packages/patches/genimage-mke2fs-test.patch \
1434 %D%/packages/patches/geoclue-config.patch \ 1432 %D%/packages/patches/geoclue-config.patch \
1435 %D%/packages/patches/gettext-libunicode-update.patch \ 1433 %D%/packages/patches/gettext-libunicode-update.patch \
1436 %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \ 1434 %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \
diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm
index 20fd37e8a0c..32be230c561 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -11,7 +11,7 @@
11;;; Copyright © 2021 Martin Becze <mjbecze@riseup.net> 11;;; Copyright © 2021 Martin Becze <mjbecze@riseup.net>
12;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org> 12;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
13;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io> 13;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io>
14;;; Copyright © 2022 Danny Milosavljevic <dannym@scratchpost.org> 14;;; Copyright © 2018, 2022 Danny Milosavljevic <dannym@scratchpost.org>
15;;; Copyright © 2023 B. Wilson <x@wilsonb.com> 15;;; Copyright © 2023 B. Wilson <x@wilsonb.com>
16;;; Copyright © 2023 Maxim Cournoyer <maxim@guixotic.coop> 16;;; Copyright © 2023 Maxim Cournoyer <maxim@guixotic.coop>
17;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com> 17;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
@@ -20,6 +20,9 @@
20;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com> 20;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com>
21;;; Copyright © 2025 Ian Eure <ian@retrospec.tv> 21;;; Copyright © 2025 Ian Eure <ian@retrospec.tv>
22;;; Copyright © 2023 Thomas Albers Raviola <thomas@thomaslabs.org> 22;;; Copyright © 2023 Thomas Albers Raviola <thomas@thomaslabs.org>
23;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
24;;; Copyright © 2025 Ashish SHUKLA <ashish.is@lostca.se>
25;;; Copyright © 2026 Cayetano Santos <csantosb@inventati.org>
23;;; 26;;;
24;;; This file is part of GNU Guix. 27;;; This file is part of GNU Guix.
25;;; 28;;;
@@ -59,8 +62,12 @@
59 #:use-module (gnu packages bash) 62 #:use-module (gnu packages bash)
60 #:use-module (gnu packages bison) 63 #:use-module (gnu packages bison)
61 #:use-module (gnu packages boost) 64 #:use-module (gnu packages boost)
65 #:use-module (gnu packages bootloaders)
66 #:use-module (gnu packages cdrom)
62 #:use-module (gnu packages check) 67 #:use-module (gnu packages check)
63 #:use-module (gnu packages compression) 68 #:use-module (gnu packages compression)
69 #:use-module (gnu packages cpio)
70 #:use-module (gnu packages disk)
64 #:use-module (gnu packages documentation) 71 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages electronics) 72 #:use-module (gnu packages electronics)
66 #:use-module (gnu packages elf) 73 #:use-module (gnu packages elf)
@@ -74,6 +81,7 @@
74 #:use-module (gnu packages libftdi) 81 #:use-module (gnu packages libftdi)
75 #:use-module (gnu packages libusb) 82 #:use-module (gnu packages libusb)
76 #:use-module (gnu packages linux) 83 #:use-module (gnu packages linux)
84 #:use-module (gnu packages mtools)
77 #:use-module (gnu packages pciutils) 85 #:use-module (gnu packages pciutils)
78 #:use-module (gnu packages pciutils) 86 #:use-module (gnu packages pciutils)
79 #:use-module (gnu packages perl) 87 #:use-module (gnu packages perl)
@@ -83,7 +91,9 @@
83 #:use-module (gnu packages qt) 91 #:use-module (gnu packages qt)
84 #:use-module (gnu packages readline) 92 #:use-module (gnu packages readline)
85 #:use-module (gnu packages swig) 93 #:use-module (gnu packages swig)
94 #:use-module (gnu packages textutils)
86 #:use-module (gnu packages tls) 95 #:use-module (gnu packages tls)
96 #:use-module (gnu packages virtualization)
87 #:use-module (gnu packages xml) 97 #:use-module (gnu packages xml)
88 #:use-module (srfi srfi-26)) 98 #:use-module (srfi srfi-26))
89 99
@@ -246,6 +256,118 @@ firmware from it.")
246 (home-page "https://dfu-util.sourceforge.net/") 256 (home-page "https://dfu-util.sourceforge.net/")
247 (license license:gpl2+))) 257 (license license:gpl2+)))
248 258
259(define-public genimage
260 (let ((commit "00009af6e29cfd46909bc8b4180147dda9f82ba8")
261 (revision "0"))
262 (package
263 (name "genimage")
264 (version (git-version "18" revision commit))
265 (source
266 (origin
267 (method git-fetch)
268 (uri (git-reference
269 (url "https://github.com/pengutronix/genimage")
270 (commit commit)))
271 (file-name (git-file-name name version))
272 (sha256
273 (base32
274 "1mijyq79cb0yj4jm9ln9smpddq1f6r8cnsa568qca0krcv0p3zag"))))
275 (build-system gnu-build-system)
276 (arguments
277 `(#:modules
278 ((ice-9 match)
279 ,@%default-gnu-imported-modules)
280 #:phases
281 (modify-phases %standard-phases
282 (add-after 'unpack 'guixify
283 (lambda* (#:key inputs #:allow-other-keys)
284 (map (match-lambda
285 ((input directory regexp)
286 (substitute* "config.c"
287 (((format #f "\\.def = \"(~a)\"" regexp) _ command)
288 (string-append ".def = \"" (assoc-ref inputs input)
289 "/" directory "/" command "\"")))))
290 '(("cpio" "bin" "cpio")
291 ("coreutils" "bin" "dd")
292 ("e2fsprogs" "sbin" "debugfs|e2fsck|mke2fs|tune2fs")
293 ("genext2fs" "bin" "genext2fs")
294 ("cdrkit-libre" "bin" "genisoimage")
295 ("mtools" "bin" "mcopy|mmd")
296 ;; mkcramfs is obsolete.
297 ("dosfstools" "sbin" "mkdosfs")
298 ("mtd-utils" "sbin" "mkfs.(jffs2|ubifs)|ubinize")
299 ("f2fs-tools" "sbin" "(mkfs|sload).f2fs")
300 ("squashfs-tools" "bin" "mksquashfs")
301 ("qemu" "bin" "qemu-img")
302 ;; rauc and fiptool are unsupported.
303 ("tar" "bin" "tar")
304 ("u-boot-tools" "bin" "mkimage")))
305 (substitute* "util.c"
306 (("\"/bin/sh\"")
307 (string-append "\"" (assoc-ref inputs "bash") "/bin/sh\"")))))
308 (add-before 'check 'disable-failing-tests
309 (lambda _
310 ;; We don't have /etc/passwd so uid 0 is not known as "root".
311 ;; Thus patch it out.
312 (substitute* '("test/flash.test")
313 (("test_expect_success \"flash\"")
314 "test_expect_fail \"flash\""))
315 (substitute* '("test/hdimage.test")
316 (("test_expect_success fdisk,sfdisk \"hdimage\"")
317 "test_expect_fail fdisk,sfdisk \"hdimage\"")
318 (("test_expect_success hexdump \"hdimage no-partition\"")
319 "test_expect_fail hexdump \"hdimage no-partition\""))))
320 (add-before 'check 'fix-failing-tests
321 (lambda _
322 ;; We don't have /etc/passwd so uid 0 is not known as "root".
323 ;; Thus patch it out.
324 (substitute* '("test/ext2test.2.dump"
325 "test/ext3test.2.dump"
326 "test/ext4test.2.dump"
327 "test/ext2test-percent.2.dump"
328 "test/mke2fs.2.dump"
329 "test/mke2fs.3.dump")
330 (("root") "unknown"))))
331 (add-before 'check 'setenv-check
332 (lambda _
333 ;; Our container doesn't provide access to /etc/mtab
334 (setenv "EXT2FS_NO_MTAB_OK" "1")
335 ;; Make test reproducible
336 (setenv "GENIMAGE_MKFJFFS2" "mkfs.jffs2 -U")
337 (setenv "GENIMAGE_MKE2FS" "mke2fs -E no_copy_xattrs")))
338 (replace 'check
339 (lambda _
340 (invoke "make" "TEST_LOG_COMPILER=" "check"))))))
341 (native-inputs
342 (list autoconf
343 automake
344 ;;; Note: cramfs is obsolete.
345 dtc ; for the tests
346 pkg-config
347 util-linux)) ; for the tests
348 (inputs
349 `(("bash" ,bash)
350 ("cdrkit-libre" ,cdrkit-libre)
351 ("cpio" ,cpio)
352 ;; Note: invoked by final executable.
353 ("coreutils" ,coreutils) ; chmod, dd
354 ("dosfstools" ,dosfstools)
355 ("e2fsprogs" ,e2fsprogs)
356 ("f2fs-tools" ,f2fs-tools)
357 ("genext2fs" ,genext2fs)
358 ("libconfuse" ,libconfuse)
359 ("mtd-utils" ,mtd-utils)
360 ("mtools" ,mtools)
361 ("qemu" ,qemu-minimal)
362 ("squashfs-tools" ,squashfs-tools)
363 ("tar" ,tar)
364 ("u-boot-tools" ,u-boot-tools)))
365 (synopsis "Create Flash images according to specification")
366 (description "@command{genimage} creates Flash images according to a
367specification file.")
368 (home-page "https://github.com/pengutronix/genimage")
369 (license license:gpl2))))
370
249(define-public teensy-loader-cli 371(define-public teensy-loader-cli
250 (package 372 (package
251 (name "teensy-loader-cli") 373 (name "teensy-loader-cli")
diff --git a/gnu/packages/genimage.scm b/gnu/packages/genimage.scm
deleted file mode 100644
index 0f70faf33e9..00000000000
--- a/gnu/packages/genimage.scm
+++ /dev/null
@@ -1,154 +0,0 @@
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
3;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com>
4;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
5;;; Copyright © 2025 Ashish SHUKLA <ashish.is@lostca.se>
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages genimage)
23 #:use-module (guix utils)
24 #:use-module (guix packages)
25 #:use-module (guix git-download)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build utils)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages bash)
33 #:use-module (gnu packages bootloaders)
34 #:use-module (gnu packages cdrom)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages cpio)
37 #:use-module (gnu packages disk)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages mtools)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages textutils)
42 #:use-module (gnu packages virtualization))
43
44(define-public genimage
45 (let ((commit "00009af6e29cfd46909bc8b4180147dda9f82ba8")
46 (revision "0"))
47 (package
48 (name "genimage")
49 (version (git-version "18" revision commit))
50 (source
51 (origin
52 (method git-fetch)
53 (uri (git-reference
54 (url "https://github.com/pengutronix/genimage")
55 (commit commit)))
56 (file-name (git-file-name name version))
57 (sha256
58 (base32
59 "1mijyq79cb0yj4jm9ln9smpddq1f6r8cnsa568qca0krcv0p3zag"))))
60 (build-system gnu-build-system)
61 (arguments
62 `(#:modules
63 ((ice-9 match)
64 ,@%default-gnu-imported-modules)
65 #:phases
66 (modify-phases %standard-phases
67 (add-after 'unpack 'guixify
68 (lambda* (#:key inputs #:allow-other-keys)
69 (map (match-lambda
70 ((input directory regexp)
71 (substitute* "config.c"
72 (((format #f "\\.def = \"(~a)\"" regexp) _ command)
73 (string-append ".def = \"" (assoc-ref inputs input)
74 "/" directory "/" command "\"")))))
75 '(("cpio" "bin" "cpio")
76 ("coreutils" "bin" "dd")
77 ("e2fsprogs" "sbin" "debugfs|e2fsck|mke2fs|tune2fs")
78 ("genext2fs" "bin" "genext2fs")
79 ("cdrkit-libre" "bin" "genisoimage")
80 ("mtools" "bin" "mcopy|mmd")
81 ;; mkcramfs is obsolete.
82 ("dosfstools" "sbin" "mkdosfs")
83 ("mtd-utils" "sbin" "mkfs.(jffs2|ubifs)|ubinize")
84 ("f2fs-tools" "sbin" "(mkfs|sload).f2fs")
85 ("squashfs-tools" "bin" "mksquashfs")
86 ("qemu" "bin" "qemu-img")
87 ;; rauc and fiptool are unsupported.
88 ("tar" "bin" "tar")
89 ("u-boot-tools" "bin" "mkimage")))
90 (substitute* "util.c"
91 (("\"/bin/sh\"")
92 (string-append "\"" (assoc-ref inputs "bash") "/bin/sh\"")))))
93 (add-before 'check 'disable-failing-tests
94 (lambda _
95 ;; We don't have /etc/passwd so uid 0 is not known as "root".
96 ;; Thus patch it out.
97 (substitute* '("test/flash.test")
98 (("test_expect_success \"flash\"")
99 "test_expect_fail \"flash\""))
100 (substitute* '("test/hdimage.test")
101 (("test_expect_success fdisk,sfdisk \"hdimage\"")
102 "test_expect_fail fdisk,sfdisk \"hdimage\"")
103 (("test_expect_success hexdump \"hdimage no-partition\"")
104 "test_expect_fail hexdump \"hdimage no-partition\""))))
105 (add-before 'check 'fix-failing-tests
106 (lambda _
107 ;; We don't have /etc/passwd so uid 0 is not known as "root".
108 ;; Thus patch it out.
109 (substitute* '("test/ext2test.2.dump"
110 "test/ext3test.2.dump"
111 "test/ext4test.2.dump"
112 "test/ext2test-percent.2.dump"
113 "test/mke2fs.2.dump"
114 "test/mke2fs.3.dump")
115 (("root") "unknown"))))
116 (add-before 'check 'setenv-check
117 (lambda _
118 ;; Our container doesn't provide access to /etc/mtab
119 (setenv "EXT2FS_NO_MTAB_OK" "1")
120 ;; Make test reproducible
121 (setenv "GENIMAGE_MKFJFFS2" "mkfs.jffs2 -U")
122 (setenv "GENIMAGE_MKE2FS" "mke2fs -E no_copy_xattrs")))
123 (replace 'check
124 (lambda _
125 (invoke "make" "TEST_LOG_COMPILER=" "check"))))))
126 (native-inputs
127 (list autoconf
128 automake
129 ;;; Note: cramfs is obsolete.
130 dtc ; for the tests
131 pkg-config
132 util-linux)) ; for the tests
133 (inputs
134 `(("bash" ,bash)
135 ("cdrkit-libre" ,cdrkit-libre)
136 ("cpio" ,cpio)
137 ;; Note: invoked by final executable.
138 ("coreutils" ,coreutils) ; chmod, dd
139 ("dosfstools" ,dosfstools)
140 ("e2fsprogs" ,e2fsprogs)
141 ("f2fs-tools" ,f2fs-tools)
142 ("genext2fs" ,genext2fs)
143 ("libconfuse" ,libconfuse)
144 ("mtd-utils" ,mtd-utils)
145 ("mtools" ,mtools)
146 ("qemu" ,qemu-minimal)
147 ("squashfs-tools" ,squashfs-tools)
148 ("tar" ,tar)
149 ("u-boot-tools" ,u-boot-tools)))
150 (synopsis "Create Flash images according to specification")
151 (description "@command{genimage} creates Flash images according to a
152specification file.")
153 (home-page "https://github.com/pengutronix/genimage")
154 (license license:gpl2))))
diff --git a/gnu/packages/patches/genimage-mke2fs-test.patch b/gnu/packages/patches/genimage-mke2fs-test.patch
deleted file mode 100644
index 5d4fbcfe449..00000000000
--- a/gnu/packages/patches/genimage-mke2fs-test.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1diff --git a/test/mke2fs.dump b/test/mke2fs.dump
2index 8e63662..0c25798 100644
3--- a/test/mke2fs.0.dump
4+++ b/test/mke2fs.0.dump
5@@ -11,7 +11,7 @@
6 Inode count: 8192
7 Block count: 32768
8 Reserved block count: 1638
9-Free blocks: 26568
10+Free blocks: 26566
11 Free inodes: 8141
12 First block: 1
13 Block size: 1024
14@@ -29,7 +29,7 @@
15 Maximum mount count: -1
16 Last checked: Sat Jan 1 00:00:00 2000
17 Check interval: 0 (<none>)
18-Lifetime writes: 141 kB
19+Lifetime writes: 143 kB
20 Reserved blocks uid: 0 (user root)
21 Reserved blocks gid: 0 (group root)
22 First inode: 11
23@@ -51,13 +51,13 @@
24 Journal start: 0
25
26
27-Group 0: (Blocks 1-8192) csum 0x74a0 [ITABLE_ZEROED]
28+Group 0: (Blocks 1-8192) csum 0x3f30 [ITABLE_ZEROED]
29 Primary superblock at 1, Group descriptors at 2-2
30- Block bitmap at 3 (+2), csum 0x16cec4db
31+ Block bitmap at 3 (+2), csum 0x8d67cdef
32 Inode bitmap at 7 (+6), csum 0xb1052088
33 Inode table at 11-522 (+10)
34- 6093 free blocks, 1997 free inodes, 18 directories, 1997 unused inodes
35- Free blocks: 2100-8192
36+ 6091 free blocks, 1997 free inodes, 18 directories, 1997 unused inodes
37+ Free blocks: 2102-8192
38 Free inodes: 52-2048
39 Group 1: (Blocks 8193-16384) csum 0x8fde [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED]
40 Backup superblock at 8193, Group descriptors at 8194-8194
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index fb0ba287730..0e4967012c8 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -55,8 +55,8 @@
55 #:use-module (gnu packages cdrom) 55 #:use-module (gnu packages cdrom)
56 #:use-module (gnu packages compression) 56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages disk) 57 #:use-module (gnu packages disk)
58 #:use-module (gnu packages flashing-tools)
58 #:use-module (gnu packages gawk) 59 #:use-module (gnu packages gawk)
59 #:use-module (gnu packages genimage)
60 #:use-module (gnu packages guile) 60 #:use-module (gnu packages guile)
61 #:autoload (gnu packages gnupg) (guile-gcrypt) 61 #:autoload (gnu packages gnupg) (guile-gcrypt)
62 #:use-module (gnu packages hurd) 62 #:use-module (gnu packages hurd)