aboutsummaryrefslogtreecommitdiff
;;; 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>
;;;
;;; 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)
          ,@%gnu-build-system-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")
                 (("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))))
FONT_TER16x32=y, and CONFIG_FONT_6x10=y. Tobias Geerinckx-Rice 2019-12-18gnu: linux-libre: Update to 5.4.5....* gnu/packages/aux-files/linux-libre/5.3-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.3-arm.conf, gnu/packages/aux-files/linux-libre/5.3-arm64.conf, gnu/packages/aux-files/linux-libre/5.3-i686.conf, gnu/packages/aux-files/linux-libre/5.3-x86_64.conf: Delete files. * gnu/packages/aux-files/linux-libre/5.4-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.4-arm.conf, gnu/packages/aux-files/linux-libre/5.4-arm64.conf, gnu/packages/aux-files/linux-libre/5.4-i686.conf, gnu/packages/aux-files/linux-libre/5.4-x86_64.conf: New files. * Makefile.am (AUX_FILES): Update accordingly. * gnu/packages/patches/linux-libre-active-entropy.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. * gnu/packages/linux.scm (deblob-scripts-5.3, linux-libre-5.3-version) (linux-libre-5.3-pristine-source, linux-libre-5.3-source) (linux-libre-headers-5.3, linux-libre-5.3): Remove variables. (deblob-scripts-5.4, linux-libre-5.4-version) (linux-libre-5.4-pristine-source, linux-libre-5.4-source) (linux-libre-headers-5.4, linux-libre-5.4): New variables. (linux-libre-version, linux-libre-pristine-source) (linux-libre-source, linux-libre): Point to linux-libre-5.4*. Mark H Weaver 2019-12-18gnu: linux-libre: Remove orphaned 5.2.x kernel configurations....This is a followup to commit 4845dee706a1aee89917e5c7f25d3bce64f7e11c. * gnu/packages/aux-files/linux-libre/5.2-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.2-arm.conf, gnu/packages/aux-files/linux-libre/5.2-arm64.conf, gnu/packages/aux-files/linux-libre/5.2-i686.conf, gnu/packages/aux-files/linux-libre/5.2-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove them. Mark H Weaver 2019-12-04gnu: emacs: Use load-path instead of EMACSLOADPATH....This enables the use of the subdirs.el feature of Emacs, where specifying a directory in EMACSLOADPATH translates into a `load-path' variable containing the directory and all its sub-directories. * gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs-autoload-packages): Use `load-path' directly instead of parsing EMACSLOADPATH. Reported-by: Leo Prikler <leo.prikler@student.tugraz.at> Signed-off-by: Clément Lassieur <clement@lassieur.org> Maxim Cournoyer 2019-12-04gnu: emacs: Fix guix-emacs.el indentation....* gnu/packages/aux-files/emacs/guix-emacs.el: Fix indentation. Signed-off-by: Clément Lassieur <clement@lassieur.org> Maxim Cournoyer 2019-11-18gnu: emacs: Adapt the autoloads auxiliary code to use EMACSLOADPATH....The Elisp directories to scan for autoloads are now taken from EMACSLOADPATH instead of from the user profile, environment profile or system profile. Manually adding the Elisp directories to the `load-path' is no longer necessary, as this is covered by Emacs when they are in EMACSLOADPATH. The caching logic is also removed, as this code is not typically run often and the gain is marginal (loading autoloads files is cheap). * gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs-directory) (guix-emacs-subdirs, guix-emacs-directories): Remove procedures. (guix-emacs-find-autoloads): Filter the directory entries by passing the regexp to `directory-files' directly, which is ten times faster. Remove deduplication. (guix-emacs-autoloads-regexp): Remove the group, which used to filter out the file extension; it no longer works this way due to passing the regexp to the `directory-files' procedure directly, which doesn't care about groups. (guix-emacs-autoload-packages): Update doc. Search package directories from EMACSLOADPATH. Do not populate the load-path. Remove cache. Maxim Cournoyer 2019-10-01gnu: linux-libre: Add version 5.3.1....* gnu/packages/linux.scm (linux-libre-5.3-version) (linux-libre-5.3-pristine-source, linux-libre-5.3-source) (linux-libre-headers-5.3, linux-libre-5.3): New public variables. * gnu/packages/aux-files/linux-libre/5.3-arm.conf, gnu/packages/aux-files/linux-libre/5.3-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.3-arm64.conf, gnu/packages/aux-files/linux-libre/5.3-i686.conf, gnu/packages/aux-files/linux-libre/5.3-x86_64.conf: New files. * Makefile.am (AUX_FILES): Add them. Tobias Geerinckx-Rice 2019-09-18gnu: linux-libre: Enable all nftables families....* gnu/packages/aux-files/linux-libre/4.19-arm.conf, gnu/packages/aux-files/linux-libre/4.19-arm64.conf, gnu/packages/aux-files/linux-libre/4.19-i686.conf, gnu/packages/aux-files/linux-libre/4.19-x86_64.conf, gnu/packages/aux-files/linux-libre/5.2-arm.conf, gnu/packages/aux-files/linux-libre/5.2-arm64.conf, gnu/packages/aux-files/linux-libre/5.2-i686.conf, gnu/packages/aux-files/linux-libre/5.2-x86_64.conf: Set CONFIG_NF_TABLES_INET, CONFIG_NF_TABLES_NETDEV, CONFIG_NF_TABLES_IPV4, CONFIG_NF_TABLES_IPV6 and CONFIG_NF_TABLES_BRIDGE to 'y', and related options to 'm'. 宋文武 2019-09-04gnu: linux-libre: Enable built-in ext4 support....When running qemu-img from (gnu system vm) with an aarch64 kernel, mounting ext4 partitions fails because no modprobe of ext4 module is made. Like for other kernel configs, provide built-in support for ext4 partitions. * gnu/packages/aux-files/linux-libre/5.2-arm64.conf: Enable built-in ext4, like in intel and armhf configs. Mathieu Othacehe 2019-09-04gnu: ungoogled-chromium: Allow microphone access....Fixes <https://bugs.gnu.org/36961>. * gnu/packages/aux-files/chromium/master-preferences.json: Remove "audio_capture_enabled" flag. Marius Bakke 2019-07-14gnu: linux-libre: Update to 5.2....* gnu/packages/linux.scm (%linux-libre-version): Update to 5.2. (%linux-libre-hash): Update hash. * linux-libre-5.1: Rename to ... * linux-libre-5.2: ... this. Use %linux-libre-5.2-patches. * linux-libre: Switch to linux-libre-5.2. * linux-libre-arm-veyron, linux-libre-arm-generic, linux-libre-arm-omap2plus: Use %linux-libre-5.2-patches. * linux-libre-headers-5.1: Rename to ... * linux-libre-headers-5.2: ... this. * %linux-libre-5.1-patches: Rename to ... * %linux-libre-5.2-patches: ... this. * gnu/packages/aux-files/linux-libre/5.1-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.1-arm.conf, gnu/packages/aux-files/linux-libre/5.1-arm64.conf, gnu/packages/aux-files/linux-libre/5.1-i686.conf, gnu/packages/aux-files/linux-libre/5.1-x86_64.conf: Delete files. * gnu/packages/aux-files/linux-libre/5.2-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.2-arm.conf, gnu/packages/aux-files/linux-libre/5.2-arm64.conf, gnu/packages/aux-files/linux-libre/5.2-i686.conf, gnu/packages/aux-files/linux-libre/5.2-x86_64.conf: New files. * Makefile.am (AUX_FILES): Update accordingly. Mark H Weaver 2019-05-10gnu: linux-libre: Update to 5.1....* gnu/packages/linux.scm (%linux-libre-version): Update to 5.1. (%linux-libre-hash): Update hash. (%linux-libre-5.0-patches): Rename to ... (%linux-libre-5.1-patches): ... this. (linux-libre, linux-libre-arm-generic, linux-libre-arm-veyron) (linux-libre-arm-omap2plus): Use %linux-libre-5.1-patches. (vhba-module): Move definition below the kernel packages. * gnu/packages/aux-files/linux-libre/5.0-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.0-arm.conf, gnu/packages/aux-files/linux-libre/5.0-arm64.conf, gnu/packages/aux-files/linux-libre/5.0-i686.conf, gnu/packages/aux-files/linux-libre/5.0-x86_64.conf: Delete files. * gnu/packages/aux-files/linux-libre/5.1-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.1-arm.conf, gnu/packages/aux-files/linux-libre/5.1-arm64.conf, gnu/packages/aux-files/linux-libre/5.1-i686.conf, gnu/packages/aux-files/linux-libre/5.1-x86_64.conf: New files. * Makefile.am (AUX_FILES): Adjust accordingly. Mark H Weaver