;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2016 Christine Lemmer-Webber ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2020, 2022 Tobias Geerinckx-Rice ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2022 Pavel Shlyak ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; ;;; 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
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-07-29 13:55:58 +0300
committerEfraim Flashner <efraim@flashner.co.il>2021-07-29 14:43:38 +0300
commit6752fc153a564b7ed801d42cb3296e03e13239be (patch)
treea4e40ea4af9d0c8e312e002642b9414cc3517bbf /gnu/bootloader.scm
parent0f15f774649362966be5d498ba2038f7aca9af38 (diff)
downloadguix-6752fc153a564b7ed801d42cb3296e03e13239be.tar.gz
guix-6752fc153a564b7ed801d42cb3296e03e13239be.zip
gnu: julia-imageinterminal: Udate to 0.4.7.
* gnu/packages/julia-xyz.scm (julia-imageinterminal): Update to 0.4.7. [propagated-inputs]: Add julia-imagebase, julia-requires. Remove julia-imagetransformations.
Diffstat (limited to 'gnu/bootloader.scm')
0 files changed, 0 insertions, 0 deletions
#:key (schema (sql-schema)) (wal-mode? #t)) "Register CLOSURE in PREFIX, where PREFIX is the directory name of the target store and CLOSURE is the name of a file containing a reference graph as produced by #:references-graphs. Pass WAL-MODE? to call-with-database." (let ((items (call-with-input-file closure read-reference-graph))) (parameterize ((sql-schema schema)) (with-database (store-database-file #:prefix prefix) db #:wal-mode? wal-mode? (register-items db items #:prefix prefix #:registration-time %epoch))))) (define* (initialize-efi-partition root #:key grub-efi #:allow-other-keys) "Install in ROOT directory, an EFI loader using GRUB-EFI." (install-efi-loader grub-efi root)) (define* (initialize-efi32-partition root #:key grub-efi32 #:allow-other-keys) "Install in ROOT directory, an EFI 32bit loader using GRUB-EFI32." (install-efi-loader grub-efi32 root #:targets (cond ((target-x86?) '("i386-efi" . "BOOTIA32.EFI")) ((target-arm?) '("arm-efi" . "BOOTARM.EFI"))))) (define* (initialize-root-partition root #:key bootcfg bootcfg-location bootloader-package bootloader-installer (copy-closures? #t) (deduplicate? #t) references-graphs (register-closures? #t) system-directory make-device-nodes (wal-mode? #t) #:allow-other-keys) "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to install the bootloader configuration. If COPY-CLOSURES? is true, copy all of REFERENCES-GRAPHS to the partition. If REGISTER-CLOSURES? is true, register REFERENCES-GRAPHS in the store. If DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the rest of the store when registering the closures. SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation. Pass WAL-MODE? to register-closure." (define root-store (string-append root (%store-directory))) (define tmp-store ".tmp-store") (populate-root-file-system system-directory root) (when copy-closures? (populate-store references-graphs root #:deduplicate? deduplicate?)) ;; Populate /dev. (when make-device-nodes (make-device-nodes root)) (when register-closures? (unless copy-closures? ;; XXX: 'register-closure' wants to palpate the things it registers, so ;; create a symlink to the store. (rename-file root-store tmp-store) (symlink (%store-directory) root-store)) (for-each (lambda (closure) (register-closure root closure #:wal-mode? wal-mode?)) references-graphs) (unless copy-closures? (delete-file root-store) (rename-file tmp-store root-store))) ;; There's no point installing a bootloader if we do not populate the store. (when copy-closures? (when bootloader-installer (display "installing bootloader...\n") (bootloader-installer bootloader-package #f root)) (when bootcfg (install-boot-config bootcfg bootcfg-location root)))) (define* (make-iso9660-image xorriso grub-mkrescue-environment grub bootcfg system-directory root target #:key (volume-id "Guix_image") (volume-uuid #f) register-closures? (references-graphs '()) (compression? #t)) "Given a GRUB package, creates an iso image as TARGET, using BOOTCFG as GRUB configuration and OS-DRV as the stuff in it." (define grub-mkrescue (string-append grub "/bin/grub-mkrescue")) (define grub-mkrescue-sed.sh (string-append (getcwd) "/" "grub-mkrescue-sed.sh")) ;; Use a modified version of grub-mkrescue-sed.sh, see below. (copy-file (string-append xorriso "/bin/grub-mkrescue-sed.sh") grub-mkrescue-sed.sh) ;; Force grub-mkrescue-sed.sh to use the build directory instead of /tmp ;; that is read-only inside the build container. (substitute* grub-mkrescue-sed.sh (("/tmp/") (string-append (getcwd) "/")) (("MKRESCUE_SED_XORRISO_ARGS \\$x") (format #f "MKRESCUE_SED_XORRISO_ARGS $(echo $x | sed \"s|/tmp|~a|\")" (getcwd)))) ;; 'grub-mkrescue' calls out to mtools programs to create 'efi.img', a FAT ;; file system image, and mtools honors SOURCE_DATE_EPOCH for the mtime of ;; those files. The epoch for FAT is Jan. 1st 1980, not 1970, so choose ;; that. (setenv "SOURCE_DATE_EPOCH" (number->string (time-second (date->time-utc (make-date 0 0 0 0 1 1 1980 0))))) ;; Our patched 'grub-mkrescue' honors this environment variable and passes ;; it to 'mformat', which makes it the serial number of 'efi.img'. This ;; allows for deterministic builds. (setenv "GRUB_FAT_SERIAL_NUMBER" (number->string (if volume-uuid ;; On 32-bit systems the 2nd argument must be ;; lower than 2^32. (string-hash (iso9660-uuid->string volume-uuid) (- (expt 2 32) 1)) #x77777777) 16)) (setenv "MKRESCUE_SED_MODE" "original") (setenv "MKRESCUE_SED_XORRISO" (string-append xorriso "/bin/xorriso")) (setenv "MKRESCUE_SED_IN_EFI_NO_PT" "yes") (for-each (match-lambda ((name . value) (setenv name value))) grub-mkrescue-environment) (apply invoke grub-mkrescue (string-append "--xorriso=" grub-mkrescue-sed.sh) "-o" target (string-append "boot/grub/grub.cfg=" bootcfg) root "--" ;; Set all timestamps to 1. "-volume_date" "all_file_dates" "=1" `(,@(if compression? '(;; ‘zisofs’ compression reduces the total image size by ;; ~60%. "-zisofs" "level=9:block_size=128k" ; highest compression ;; It's transparent to our Linux-Libre kernel but not to ;; GRUB. Don't compress the kernel, initrd, and other ;; files read by grub.cfg, as well as common ;; already-compressed file names. "-find" "/" "-type" "f" ;; XXX Even after "--" above, and despite documentation ;; claiming otherwise, "-or" is stolen by grub-mkrescue ;; which then chokes on it (as ‘-o …’) and dies. Don't use ;; "-or". "-not" "-wholename" "/boot/*" "-not" "-wholename" "/System/*" "-not" "-name" "unicode.pf2" "-not" "-name" "bzImage" "-not" "-name" "*.gz" ; initrd & all man pages "-not" "-name" "*.png" ; includes grub-image.png "-exec" "set_filter" "--zisofs" "--") '()) "-volid" ,(string-upcase volume-id) ,@(if volume-uuid `("-volume_date" "uuid" ,(string-filter (lambda (value) (not (char=? #\- value))) (iso9660-uuid->string volume-uuid))) '()))))