diff options
Diffstat (limited to 'gnu/packages/bootloaders.scm')
-rw-r--r-- | gnu/packages/bootloaders.scm | 145 |
1 files changed, 87 insertions, 58 deletions
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index c750339a55..54e47059ee 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Leo Famulari <leo@famulari.name> ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> @@ -114,6 +114,8 @@ ;; calling the ‘true’ binary instead. Python is only needed during ;; bootstrapping (for genptl.py), not when building from a release. (list "PYTHON=true") + ;; Grub fails to load modules stripped with --strip-unneeded. + #:strip-flags '("--strip-debug" "--enable-deterministic-archives") #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-stuff (lambda* (#:key native-inputs inputs #:allow-other-keys) @@ -140,9 +142,9 @@ ;; Give the absolute file name of 'ckbcomp'. (substitute* "util/grub-kbdcomp.in" (("^ckbcomp ") - (string-append (assoc-ref inputs "console-setup") - "/bin/ckbcomp "))) - #t)) + (string-append + (search-input-file inputs "/bin/ckbcomp") + " "))))) (add-after 'unpack 'set-freetype-variables ;; These variables need to be set to the native versions ;; of the dependencies because they are used to build @@ -261,11 +263,11 @@ menu to select one of the installed operating systems.") (inherit grub) (name "grub-minimal") (inputs - (fold alist-delete (package-inputs grub) - '("lvm2" "mdadm" "fuse" "console-setup"))) + (modify-inputs (package-inputs grub) + (delete "lvm2" "mdadm" "fuse" "console-setup"))) (native-inputs - (fold alist-delete (package-native-inputs grub) - '("help2man" "texinfo" "parted" "qemu" "xorriso"))) + (modify-inputs (package-native-inputs grub) + (delete "help2man" "texinfo" "parted" "qemu" "xorriso"))) (arguments (substitute-keyword-arguments (package-arguments grub) ((#:configure-flags _ ''()) @@ -293,9 +295,8 @@ menu to select one of the installed operating systems.") (name "grub-efi") (synopsis "GRand Unified Boot loader (UEFI version)") (inputs - `(("efibootmgr" ,efibootmgr) - ("mtools" ,mtools) - ,@(package-inputs grub))) + (modify-inputs (package-inputs grub) + (prepend efibootmgr mtools))) (arguments `(;; TODO: Tests need a UEFI firmware for qemu. There is one at ;; https://github.com/tianocore/edk2/tree/master/OvmfPkg . @@ -316,9 +317,8 @@ menu to select one of the installed operating systems.") (lambda* (#:key inputs #:allow-other-keys) (substitute* "grub-core/osdep/unix/platform.c" (("efibootmgr") - (string-append (assoc-ref inputs "efibootmgr") - "/sbin/efibootmgr"))) - #t)) + (search-input-file inputs + "/sbin/efibootmgr"))))) (add-after 'patch-stuff 'use-absolute-mtools-path (lambda* (#:key inputs #:allow-other-keys) (let ((mtools (assoc-ref inputs "mtools"))) @@ -343,8 +343,8 @@ menu to select one of the installed operating systems.") (name "grub-hybrid") (synopsis "GRand Unified Boot loader (hybrid version)") (inputs - `(("grub" ,grub) - ,@(package-inputs grub-efi))) + (modify-inputs (package-inputs grub-efi) + (prepend grub))) (arguments (substitute-keyword-arguments (package-arguments grub-efi) ((#:modules modules `((guix build utils) (guix build gnu-build-system))) @@ -353,8 +353,8 @@ menu to select one of the installed operating systems.") `(modify-phases ,phases (add-after 'install 'install-non-efi (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((input-dir (string-append (assoc-ref inputs "grub") - "/lib/grub")) + (let ((input-dir (search-input-directory inputs + "/lib/grub")) (output-dir (string-append (assoc-ref outputs "out") "/lib/grub"))) (for-each @@ -379,7 +379,10 @@ menu to select one of the installed operating systems.") (file-name (git-file-name name version)) (sha256 (base32 - "0k8dvafd6410kqxf3kyr4y8jzmpmrih6wbjqg6gklak7945yflrc")))) + "0k8dvafd6410kqxf3kyr4y8jzmpmrih6wbjqg6gklak7945yflrc")) + (patches + (search-patches "syslinux-gcc10.patch" + "syslinux-strip-gnu-property.patch")))) (build-system gnu-build-system) (native-inputs `(("nasm" ,nasm) @@ -399,6 +402,7 @@ menu to select one of the installed operating systems.") (string-append "MANDIR=" %output "/share/man") "PERL=perl" "bios") + #:strip-flags '("--strip-debug" "--enable-deterministic-archives") #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-files @@ -450,14 +454,14 @@ menu to select one of the installed operating systems.") "0wrl43rvd8nnm1v1wyfdr17vk8q7ymib62vli6da8n9ni4lwbkk5")))) (build-system gnu-build-system) (native-inputs - `(("bison" ,bison) - ("flex" ,flex) - ("libyaml" ,libyaml) - ("pkg-config" ,pkg-config) - ("swig" ,swig) - ("valgrind" ,valgrind))) + (list bison + flex + libyaml + pkg-config + swig + valgrind)) (inputs - `(("python" ,python))) + (list python)) (arguments `(#:make-flags (list (string-append "CC=" ,(cc-for-target)) @@ -499,21 +503,34 @@ tree binary files. These are board description files used by Linux and BSD.") ;; https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/1937246 (search-patch "u-boot-sifive-prevent-reloc-initrd-fdt.patch")) +(define %u-boot-allow-disabling-openssl-patch + ;; Fixes build of u-boot 2021.10 without openssl + ;; https://lists.denx.de/pipermail/u-boot/2021-October/462728.html + (search-patch "u-boot-allow-disabling-openssl.patch")) + +(define %u-boot-rk3399-enable-emmc-phy-patch + ;; Fix emmc boot on rockpro64 and pinebook-pro, this was a regression + ;; therefore should hopefully be fixed when updating u-boot. + ;; https://lists.denx.de/pipermail/u-boot/2021-November/466329.html + (search-patch "u-boot-rk3399-enable-emmc-phy.patch")) + (define u-boot (package (name "u-boot") - (version "2021.07") + (version "2021.10") (source (origin (patches (list %u-boot-rockchip-inno-usb-patch - %u-boot-sifive-prevent-relocating-initrd-fdt)) + %u-boot-allow-disabling-openssl-patch + %u-boot-sifive-prevent-relocating-initrd-fdt + %u-boot-rk3399-enable-emmc-phy-patch)) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" "u-boot-" version ".tar.bz2")) (sha256 (base32 - "0zm7igkdnz0w4ir8rfl2dislfrl0ip104grs5hvd30a5wkm7wari")))) + "1m0bvwv8r62s4wk4w3cmvs888dhv9gnfa98dczr4drk2jbhj7ryd")))) (native-inputs `(("bc" ,bc) ("bison" ,bison) @@ -529,7 +546,7 @@ tree binary files. These are board description files used by Linux and BSD.") (build-system gnu-build-system) (home-page "https://www.denx.de/wiki/U-Boot/") (synopsis "ARM bootloader") - (description "U-Boot is a bootloader used mostly for ARM boards. It + (description "U-Boot is a bootloader used mostly for ARM boards. It also initializes the boards (RAM etc).") (license license:gpl2+))) @@ -538,8 +555,8 @@ also initializes the boards (RAM etc).") (inherit u-boot) (name "u-boot-tools") (native-inputs - `(("sdl2" ,sdl2) - ,@(package-native-inputs u-boot))) + (modify-inputs (package-native-inputs u-boot) + (prepend sdl2))) (arguments `(#:make-flags '("HOSTCC=gcc") #:test-target "tcheck" @@ -585,7 +602,7 @@ def test_ctrl_c")) ;; See https://bugs.gnu.org/34717 for ;; details. (("CONFIG_FIT_SIGNATURE=y") - "CONFIG_FIT_SIGNATURE=n\nCONFIG_UT_LIB_ASN1=n") + "CONFIG_FIT_SIGNATURE=n\nCONFIG_UT_LIB_ASN1=n\nCONFIG_TOOLS_LIBCRYPTO=n") ;; This test requires a sound system, which is un-used ;; in u-boot-tools. (("CONFIG_SOUND=y") "CONFIG_SOUND=n"))) @@ -684,6 +701,12 @@ board-independent tools."))) suffix-len)))) (sort entries string-ci<))) (error "Invalid boardname ~s." ,board)))))) + (add-after 'configure 'disable-tools-libcrypto + ;; Disable libcrypto due to GPL and OpenSSL license + ;; incompatibilities + (lambda _ + (substitute* ".config" + (("CONFIG_TOOLS_LIBCRYPTO=.*$") "CONFIG_TOOLS_LIBCRYPTO=n")))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -722,7 +745,7 @@ board-independent tools."))) (package (inherit base) (name "u-boot-am335x-boneblack") - (description "U-Boot is a bootloader used mostly for ARM boards. It + (description "U-Boot is a bootloader used mostly for ARM boards. It also initializes the boards (RAM etc). This U-Boot is built for the BeagleBone Black, which was removed upstream, @@ -842,7 +865,7 @@ device while it's being turned on (and a while longer).") (let ((base (make-u-boot-package "novena" "arm-linux-gnueabihf"))) (package (inherit base) - (description "U-Boot is a bootloader used mostly for ARM boards. It + (description "U-Boot is a bootloader used mostly for ARM boards. It also initializes the boards (RAM etc). This U-Boot is built for Novena. Be advised that this version, contrary @@ -875,9 +898,8 @@ to Novena upstream, does not load u-boot.img from the first partition.") `(modify-phases ,phases (add-after 'unpack 'set-environment (lambda* (#:key inputs #:allow-other-keys) - (setenv "BL31" (string-append (assoc-ref inputs "firmware") - "/bl31.elf")) - #t)) + (setenv "BL31" + (search-input-file inputs "/bl31.elf")))) ;; Phases do not succeed on the bl31 ELF. (delete 'strip) (delete 'validate-runpath))))) @@ -895,13 +917,28 @@ to Novena upstream, does not load u-boot.img from the first partition.") (source (origin (inherit (package-source u-boot)) (patches - (search-patches "u-boot-riscv64-fix-extlinux.patch"))))))) + (search-patches "u-boot-riscv64-fix-extlinux.patch" + %u-boot-allow-disabling-openssl-patch))))))) (define-public u-boot-sifive-unleashed (make-u-boot-package "sifive_unleashed" "riscv64-linux-gnu")) (define-public u-boot-sifive-unmatched - (make-u-boot-package "sifive_unmatched" "riscv64-linux-gnu")) + (let ((base (make-u-boot-package "sifive_unmatched" "riscv64-linux-gnu"))) + (package + (inherit base) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'set-environment + (lambda* (#:key inputs #:allow-other-keys) + (let ((opensbi (string-append (assoc-ref inputs "firmware") + "/fw_dynamic.bin"))) + (setenv "OPENSBI" opensbi)))))))) + (inputs + `(("firmware" ,opensbi-generic) + ,@(package-inputs base)))))) (define-public u-boot-rock64-rk3328 (let ((base (make-u-boot-package "rock64-rk3328" "aarch64-linux-gnu"))) @@ -913,10 +950,8 @@ to Novena upstream, does not load u-boot.img from the first partition.") `(modify-phases ,phases (add-after 'unpack 'set-environment (lambda* (#:key inputs #:allow-other-keys) - (let ((bl31 (string-append (assoc-ref inputs "firmware") - "/bl31.elf"))) - (setenv "BL31" bl31)) - #t)))))) + (let ((bl31 (search-input-file inputs "/bl31.elf"))) + (setenv "BL31" bl31)))))))) (native-inputs `(("firmware" ,arm-trusted-firmware-rk3328) ,@(package-native-inputs base)))))) @@ -931,9 +966,7 @@ to Novena upstream, does not load u-boot.img from the first partition.") `(modify-phases ,phases (add-after 'unpack 'set-environment (lambda* (#:key inputs #:allow-other-keys) - (setenv "BL31" (string-append (assoc-ref inputs "firmware") - "/bl31.elf")) - #t)) + (setenv "BL31" (search-input-file inputs "/bl31.elf")))) ;; Phases do not succeed on the bl31 ELF. (delete 'strip) (delete 'validate-runpath))))) @@ -951,9 +984,8 @@ to Novena upstream, does not load u-boot.img from the first partition.") `(modify-phases ,phases (add-after 'unpack 'set-environment (lambda* (#:key inputs #:allow-other-keys) - (setenv "BL31" (string-append (assoc-ref inputs "firmware") - "/bl31.elf")) - #t)) + (setenv "BL31" + (search-input-file inputs "/bl31.elf")))) ;; Phases do not succeed on the bl31 ELF. (delete 'strip) (delete 'validate-runpath))))) @@ -971,9 +1003,8 @@ to Novena upstream, does not load u-boot.img from the first partition.") `(modify-phases ,phases (add-after 'unpack 'set-environment (lambda* (#:key inputs #:allow-other-keys) - (setenv "BL31" (string-append (assoc-ref inputs "firmware") - "/bl31.elf")) - #t)) + (setenv "BL31" + (search-input-file inputs "/bl31.elf")))) ;; Phases do not succeed on the bl31 ELF. (delete 'strip) (delete 'validate-runpath))))) @@ -1073,14 +1104,14 @@ tools, and more.") (define-public os-prober (package (name "os-prober") - (version "1.78") + (version "1.79") (source (origin (method url-fetch) (uri (string-append "mirror://debian/pool/main/o/os-prober/os-prober_" version ".tar.xz")) (sha256 - (base32 "1sahk72blsrlirly4xlwa8jfxrpwagyn7b81p92q2s9m218rz43f")))) + (base32 "1vhhk0bl2j4910513gn5h3z8nsaavyv3c8764bim2klc0xyk3rmb")))) (build-system gnu-build-system) (arguments `(#:modules ((guix build gnu-build-system) @@ -1245,9 +1276,7 @@ order to add a suitable bootloader menu entry.") (lambda _ (chdir "..") #t))) #:tests? #f)) ; no test suite (native-inputs - `(("perl" ,perl) - ("syslinux" ,syslinux) - ("xorriso" ,xorriso))) + (list perl syslinux xorriso)) (home-page "https://ipxe.org") (synopsis "PXE-compliant network boot firmware") (description "iPXE is a network boot firmware. It provides a full PXE |