diff options
| author | Cayetano Santos <csantosb@inventati.org> | 2026-03-10 19:03:40 +0100 |
|---|---|---|
| committer | Cayetano Santos <csantosb@inventati.org> | 2026-03-13 19:29:31 +0100 |
| commit | 706541d384f5a2ee5ad3cd88909d22c0c13c4c27 (patch) | |
| tree | 38878bf4aaa3f3c55e30135cc67de80693055c0d | |
| parent | 2f61b27d367d16cf9fd3f022cba27cf2c7c2a251 (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
| -rw-r--r-- | gnu/local.mk | 2 | ||||
| -rw-r--r-- | gnu/packages/flashing-tools.scm | 124 | ||||
| -rw-r--r-- | gnu/packages/genimage.scm | 154 | ||||
| -rw-r--r-- | gnu/packages/patches/genimage-mke2fs-test.patch | 40 | ||||
| -rw-r--r-- | gnu/system/image.scm | 2 | ||||
| -rw-r--r-- | po/packages/POTFILES.in | 1 |
6 files changed, 124 insertions, 199 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 = \ %D%/packages/gd.scm \ %D%/packages/gdb.scm \ %D%/packages/genealogy.scm \ - %D%/packages/genimage.scm \ %D%/packages/geo.scm \ %D%/packages/gettext.scm \ %D%/packages/ghostscript.scm \ @@ -1430,7 +1429,6 @@ dist_patch_DATA = \ %D%/packages/patches/gemmi-fix-pegtl-usage.patch \ %D%/packages/patches/gemmi-fix-sajson-types.patch \ %D%/packages/patches/gemrb-remove-ifdef-and-externalize-path-setting-to-cmake.patch \ - %D%/packages/patches/genimage-mke2fs-test.patch \ %D%/packages/patches/geoclue-config.patch \ %D%/packages/patches/gettext-libunicode-update.patch \ %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 @@ ;;; Copyright © 2021 Martin Becze <mjbecze@riseup.net> ;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org> ;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io> -;;; Copyright © 2022 Danny Milosavljevic <dannym@scratchpost.org> +;;; Copyright © 2018, 2022 Danny Milosavljevic <dannym@scratchpost.org> ;;; Copyright © 2023 B. Wilson <x@wilsonb.com> ;;; Copyright © 2023 Maxim Cournoyer <maxim@guixotic.coop> ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com> @@ -20,6 +20,9 @@ ;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com> ;;; Copyright © 2025 Ian Eure <ian@retrospec.tv> ;;; Copyright © 2023 Thomas Albers Raviola <thomas@thomaslabs.org> +;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com> +;;; Copyright © 2025 Ashish SHUKLA <ashish.is@lostca.se> +;;; Copyright © 2026 Cayetano Santos <csantosb@inventati.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -59,8 +62,12 @@ #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages boost) + #:use-module (gnu packages bootloaders) + #:use-module (gnu packages cdrom) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages cpio) + #:use-module (gnu packages disk) #:use-module (gnu packages documentation) #:use-module (gnu packages electronics) #:use-module (gnu packages elf) @@ -74,6 +81,7 @@ #:use-module (gnu packages libftdi) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) + #:use-module (gnu packages mtools) #:use-module (gnu packages pciutils) #:use-module (gnu packages pciutils) #:use-module (gnu packages perl) @@ -83,7 +91,9 @@ #:use-module (gnu packages qt) #:use-module (gnu packages readline) #:use-module (gnu packages swig) + #:use-module (gnu packages textutils) #:use-module (gnu packages tls) + #:use-module (gnu packages virtualization) #:use-module (gnu packages xml) #:use-module (srfi srfi-26)) @@ -246,6 +256,118 @@ firmware from it.") (home-page "https://dfu-util.sourceforge.net/") (license license:gpl2+))) +(define-public genimage + (let ((commit "00009af6e29cfd46909bc8b4180147dda9f82ba8") + (revision "0")) + (package + (name "genimage") + (version (git-version "18" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pengutronix/genimage") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1mijyq79cb0yj4jm9ln9smpddq1f6r8cnsa568qca0krcv0p3zag")))) + (build-system gnu-build-system) + (arguments + `(#:modules + ((ice-9 match) + ,@%default-gnu-imported-modules) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'guixify + (lambda* (#:key inputs #:allow-other-keys) + (map (match-lambda + ((input directory regexp) + (substitute* "config.c" + (((format #f "\\.def = \"(~a)\"" regexp) _ command) + (string-append ".def = \"" (assoc-ref inputs input) + "/" directory "/" command "\""))))) + '(("cpio" "bin" "cpio") + ("coreutils" "bin" "dd") + ("e2fsprogs" "sbin" "debugfs|e2fsck|mke2fs|tune2fs") + ("genext2fs" "bin" "genext2fs") + ("cdrkit-libre" "bin" "genisoimage") + ("mtools" "bin" "mcopy|mmd") + ;; mkcramfs is obsolete. + ("dosfstools" "sbin" "mkdosfs") + ("mtd-utils" "sbin" "mkfs.(jffs2|ubifs)|ubinize") + ("f2fs-tools" "sbin" "(mkfs|sload).f2fs") + ("squashfs-tools" "bin" "mksquashfs") + ("qemu" "bin" "qemu-img") + ;; rauc and fiptool are unsupported. + ("tar" "bin" "tar") + ("u-boot-tools" "bin" "mkimage"))) + (substitute* "util.c" + (("\"/bin/sh\"") + (string-append "\"" (assoc-ref inputs "bash") "/bin/sh\""))))) + (add-before 'check 'disable-failing-tests + (lambda _ + ;; We don't have /etc/passwd so uid 0 is not known as "root". + ;; Thus patch it out. + (substitute* '("test/flash.test") + (("test_expect_success \"flash\"") + "test_expect_fail \"flash\"")) + (substitute* '("test/hdimage.test") + (("test_expect_success fdisk,sfdisk \"hdimage\"") + "test_expect_fail fdisk,sfdisk \"hdimage\"") + (("test_expect_success hexdump \"hdimage no-partition\"") + "test_expect_fail hexdump \"hdimage no-partition\"")))) + (add-before 'check 'fix-failing-tests + (lambda _ + ;; We don't have /etc/passwd so uid 0 is not known as "root". + ;; Thus patch it out. + (substitute* '("test/ext2test.2.dump" + "test/ext3test.2.dump" + "test/ext4test.2.dump" + "test/ext2test-percent.2.dump" + "test/mke2fs.2.dump" + "test/mke2fs.3.dump") + (("root") "unknown")))) + (add-before 'check 'setenv-check + (lambda _ + ;; Our container doesn't provide access to /etc/mtab + (setenv "EXT2FS_NO_MTAB_OK" "1") + ;; Make test reproducible + (setenv "GENIMAGE_MKFJFFS2" "mkfs.jffs2 -U") + (setenv "GENIMAGE_MKE2FS" "mke2fs -E no_copy_xattrs"))) + (replace 'check + (lambda _ + (invoke "make" "TEST_LOG_COMPILER=" "check")))))) + (native-inputs + (list autoconf + automake + ;;; Note: cramfs is obsolete. + dtc ; for the tests + pkg-config + util-linux)) ; for the tests + (inputs + `(("bash" ,bash) + ("cdrkit-libre" ,cdrkit-libre) + ("cpio" ,cpio) + ;; Note: invoked by final executable. + ("coreutils" ,coreutils) ; chmod, dd + ("dosfstools" ,dosfstools) + ("e2fsprogs" ,e2fsprogs) + ("f2fs-tools" ,f2fs-tools) + ("genext2fs" ,genext2fs) + ("libconfuse" ,libconfuse) + ("mtd-utils" ,mtd-utils) + ("mtools" ,mtools) + ("qemu" ,qemu-minimal) + ("squashfs-tools" ,squashfs-tools) + ("tar" ,tar) + ("u-boot-tools" ,u-boot-tools))) + (synopsis "Create Flash images according to specification") + (description "@command{genimage} creates Flash images according to a +specification file.") + (home-page "https://github.com/pengutronix/genimage") + (license license:gpl2)))) + (define-public teensy-loader-cli (package (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 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org> -;;; Copyright © 2021 Vincent Legoll <vincent.legoll@gmail.com> -;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2025 Ashish SHUKLA <ashish.is@lostca.se> -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. - -(define-module (gnu packages genimage) - #:use-module (guix utils) - #:use-module (guix packages) - #:use-module (guix git-download) - #:use-module ((guix licenses) #:prefix license:) - #:use-module (guix build-system gnu) - #:use-module (guix build utils) - #:use-module (gnu packages) - #:use-module (gnu packages autotools) - #:use-module (gnu packages base) - #:use-module (gnu packages bash) - #:use-module (gnu packages bootloaders) - #:use-module (gnu packages cdrom) - #:use-module (gnu packages compression) - #:use-module (gnu packages cpio) - #:use-module (gnu packages disk) - #:use-module (gnu packages linux) - #:use-module (gnu packages mtools) - #:use-module (gnu packages pkg-config) - #:use-module (gnu packages textutils) - #:use-module (gnu packages virtualization)) - -(define-public genimage - (let ((commit "00009af6e29cfd46909bc8b4180147dda9f82ba8") - (revision "0")) - (package - (name "genimage") - (version (git-version "18" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/pengutronix/genimage") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1mijyq79cb0yj4jm9ln9smpddq1f6r8cnsa568qca0krcv0p3zag")))) - (build-system gnu-build-system) - (arguments - `(#:modules - ((ice-9 match) - ,@%default-gnu-imported-modules) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'guixify - (lambda* (#:key inputs #:allow-other-keys) - (map (match-lambda - ((input directory regexp) - (substitute* "config.c" - (((format #f "\\.def = \"(~a)\"" regexp) _ command) - (string-append ".def = \"" (assoc-ref inputs input) - "/" directory "/" command "\""))))) - '(("cpio" "bin" "cpio") - ("coreutils" "bin" "dd") - ("e2fsprogs" "sbin" "debugfs|e2fsck|mke2fs|tune2fs") - ("genext2fs" "bin" "genext2fs") - ("cdrkit-libre" "bin" "genisoimage") - ("mtools" "bin" "mcopy|mmd") - ;; mkcramfs is obsolete. - ("dosfstools" "sbin" "mkdosfs") - ("mtd-utils" "sbin" "mkfs.(jffs2|ubifs)|ubinize") - ("f2fs-tools" "sbin" "(mkfs|sload).f2fs") - ("squashfs-tools" "bin" "mksquashfs") - ("qemu" "bin" "qemu-img") - ;; rauc and fiptool are unsupported. - ("tar" "bin" "tar") - ("u-boot-tools" "bin" "mkimage"))) - (substitute* "util.c" - (("\"/bin/sh\"") - (string-append "\"" (assoc-ref inputs "bash") "/bin/sh\""))))) - (add-before 'check 'disable-failing-tests - (lambda _ - ;; We don't have /etc/passwd so uid 0 is not known as "root". - ;; Thus patch it out. - (substitute* '("test/flash.test") - (("test_expect_success \"flash\"") - "test_expect_fail \"flash\"")) - (substitute* '("test/hdimage.test") - (("test_expect_success fdisk,sfdisk \"hdimage\"") - "test_expect_fail fdisk,sfdisk \"hdimage\"") - (("test_expect_success hexdump \"hdimage no-partition\"") - "test_expect_fail hexdump \"hdimage no-partition\"")))) - (add-before 'check 'fix-failing-tests - (lambda _ - ;; We don't have /etc/passwd so uid 0 is not known as "root". - ;; Thus patch it out. - (substitute* '("test/ext2test.2.dump" - "test/ext3test.2.dump" - "test/ext4test.2.dump" - "test/ext2test-percent.2.dump" - "test/mke2fs.2.dump" - "test/mke2fs.3.dump") - (("root") "unknown")))) - (add-before 'check 'setenv-check - (lambda _ - ;; Our container doesn't provide access to /etc/mtab - (setenv "EXT2FS_NO_MTAB_OK" "1") - ;; Make test reproducible - (setenv "GENIMAGE_MKFJFFS2" "mkfs.jffs2 -U") - (setenv "GENIMAGE_MKE2FS" "mke2fs -E no_copy_xattrs"))) - (replace 'check - (lambda _ - (invoke "make" "TEST_LOG_COMPILER=" "check")))))) - (native-inputs - (list autoconf - automake - ;;; Note: cramfs is obsolete. - dtc ; for the tests - pkg-config - util-linux)) ; for the tests - (inputs - `(("bash" ,bash) - ("cdrkit-libre" ,cdrkit-libre) - ("cpio" ,cpio) - ;; Note: invoked by final executable. - ("coreutils" ,coreutils) ; chmod, dd - ("dosfstools" ,dosfstools) - ("e2fsprogs" ,e2fsprogs) - ("f2fs-tools" ,f2fs-tools) - ("genext2fs" ,genext2fs) - ("libconfuse" ,libconfuse) - ("mtd-utils" ,mtd-utils) - ("mtools" ,mtools) - ("qemu" ,qemu-minimal) - ("squashfs-tools" ,squashfs-tools) - ("tar" ,tar) - ("u-boot-tools" ,u-boot-tools))) - (synopsis "Create Flash images according to specification") - (description "@command{genimage} creates Flash images according to a -specification file.") - (home-page "https://github.com/pengutronix/genimage") - (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 @@ -diff --git a/test/mke2fs.dump b/test/mke2fs.dump -index 8e63662..0c25798 100644 ---- a/test/mke2fs.0.dump -+++ b/test/mke2fs.0.dump -@@ -11,7 +11,7 @@ - Inode count: 8192 - Block count: 32768 - Reserved block count: 1638 --Free blocks: 26568 -+Free blocks: 26566 - Free inodes: 8141 - First block: 1 - Block size: 1024 -@@ -29,7 +29,7 @@ - Maximum mount count: -1 - Last checked: Sat Jan 1 00:00:00 2000 - Check interval: 0 (<none>) --Lifetime writes: 141 kB -+Lifetime writes: 143 kB - Reserved blocks uid: 0 (user root) - Reserved blocks gid: 0 (group root) - First inode: 11 -@@ -51,13 +51,13 @@ - Journal start: 0 - - --Group 0: (Blocks 1-8192) csum 0x74a0 [ITABLE_ZEROED] -+Group 0: (Blocks 1-8192) csum 0x3f30 [ITABLE_ZEROED] - Primary superblock at 1, Group descriptors at 2-2 -- Block bitmap at 3 (+2), csum 0x16cec4db -+ Block bitmap at 3 (+2), csum 0x8d67cdef - Inode bitmap at 7 (+6), csum 0xb1052088 - Inode table at 11-522 (+10) -- 6093 free blocks, 1997 free inodes, 18 directories, 1997 unused inodes -- Free blocks: 2100-8192 -+ 6091 free blocks, 1997 free inodes, 18 directories, 1997 unused inodes -+ Free blocks: 2102-8192 - Free inodes: 52-2048 - Group 1: (Blocks 8193-16384) csum 0x8fde [INODE_UNINIT, BLOCK_UNINIT, ITABLE_ZEROED] - 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 @@ #:use-module (gnu packages cdrom) #:use-module (gnu packages compression) #:use-module (gnu packages disk) + #:use-module (gnu packages flashing-tools) #:use-module (gnu packages gawk) - #:use-module (gnu packages genimage) #:use-module (gnu packages guile) #:autoload (gnu packages gnupg) (guile-gcrypt) #:use-module (gnu packages hurd) diff --git a/po/packages/POTFILES.in b/po/packages/POTFILES.in index 4496be63a2a..cd4d052cb70 100644 --- a/po/packages/POTFILES.in +++ b/po/packages/POTFILES.in @@ -168,7 +168,6 @@ gnu/packages/gawk.scm gnu/packages/gcc.scm gnu/packages/gd.scm gnu/packages/gdb.scm -gnu/packages/genimage.scm gnu/packages/gettext.scm gnu/packages/gkrellm.scm gnu/packages/gnome-circle.scm |
