Commit graph

57 commits

Author SHA1 Message Date
Tobias Geerinckx-Rice d553249f72
linux-boot: Don't create /root before it's used.
* gnu/build/linux-boot.scm (boot-system): Postpone the MKDIR of /root.

Change-Id: I589316a5ddf41cada02173ed4dd5b7df09b795e8
2023-11-19 01:00:00 +01:00
Jack Hill ec16f88522
linux-boot: Resume from hibernation after pre-boot.
* gnu/build/linux-boot.scm (boot-system): Call resume-if-hibernated
after pre-mount.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2022-09-04 02:00:00 +02:00
Maxim Cournoyer 6d9d616113
initrd: Honor rootfstype and rootflags command-line parameters.
* gnu/build/linux-boot.scm (boot-system): Honor rootfstype and rootflags
arguments.  Update doc.  Error out in case there is insufficient information
with regard to the root file system.
Restore the behavior of inferring the root device from the root file system
from the operating system in case the root argument is not provided.
* doc/guix.texi (Initial RAM Disk): Document the new command-line parameters.
2022-03-01 10:30:18 -05:00
Maxim Cournoyer 0dc019e19a
initrd: Use non-hyphenated kernel command-line parameter names.
This is to make it less surprising, given the common convention sets forth by
the kernel Linux command-line parameters.

* gnu/build/linux-boot.scm (boot-system): Rename '--load', '--repl', '--root'
and '--system' to 'gnu.load', 'gnu.repl', 'root' and 'gnu.system',
respectively.  Adjust doc.
(find-long-option): Adjust doc.
* gnu/installer/parted.scm (installer-root-partition-path): Adjust accordingly.
* gnu/system.scm (bootable-kernel-arguments): Add a VERSION argument and
update doc.  Use VERSION to conditionally return old style vs new style initrd
arguments.
(%boot-parameters-version): Increment to 1.
(operating-system-boot-parameters): Adjust doc.
(operating-system-boot-parameters-file): Likewise.
* gnu/system/linux-initrd.scm (raw-initrd, base-initrd): Likewise.
* doc/guix.texi: Adjust doc.
* gnu/build/activation.scm (boot-time-system): Adjust accordingly.
* gnu/build/hurd-boot.scm (boot-hurd-system): Likewise.
* gnu/packages/commencement.scm (%final-inputs-riscv64): Adjust comment.
2022-03-01 10:30:17 -05:00
Maxim Cournoyer e9f9f291ed
build: linux-boot: Expound docstring of the 'boot-system' procedure.
* gnu/build/linux-boot.scm (boot-system): Document the Linux command-line
parameters it understands and split a long string over two lines.
2022-02-17 13:39:02 -05:00
Tobias Geerinckx-Rice 348f0c61ef
syscalls: Deduplicate device number conversion.
* guix/cpio.scm (device-number, device->major+minor):
Move to, and subsequently import from, …
* guix/build/syscalls.scm (device-number, device-number->major+minor):
…here.  Note the slight name change.
(mounts): Replace 16-bit open code with a DEVICE-NUMBER call.
* gnu/build/linux-boot.scm (device-number):
Remove duplicate 16-bit implementation in favour of the one above.
(resume-if-hibernated): Reuse DEVICE-NUMBER->MAJOR+MINOR.
2021-09-23 18:17:16 +02:00
Tobias Geerinckx-Rice a75a3d7132
linux-boot: Honour fsck.mode & fsck.repair.
* gnu/build/linux-boot.scm (boot-system): Honour ‘fsck.mode=’ and
‘fsck.repair=’ kernel command line options.
* doc/guix.texi (Initial RAM Disk): Document both.
2021-09-23 18:17:16 +02:00
Tobias Geerinckx-Rice 602994847b
file-systems: Support forced checks & repairs.
* gnu/build/file-systems.scm (check-ext2-file-system)
(check-bcachefs-file-system, check-btrfs-file-system)
(check-fat-file-system, check-jfs-file-system, check-f2fs-file-system)
(check-ntfs-file-system, check-file-system): Take and honour new FORCE?
and REPAIR arguments.  Update the docstring.  Adjust all callers.
* gnu/system/file-systems.scm <file-system>: Add new SKIP-CHECK-IF-CLEAN?
and REPAIR fields.
(file-system->spec, spec->file-system): Adjust accordingly.
* gnu/build/linux-boot.scm (mount-root-file-system): Take new
SKIP-CHECK-IF-CLEAN? and REPAIR keyword arguments.  Thread them through
to CHECK-FILE-SYSTEM.
* doc/guix.texi (File Systems): Document both new <file-system> options.
2021-09-23 18:17:15 +02:00
Tobias Geerinckx-Rice ca23fd62f1
linux-boot: Remove mummified comment.
* gnu/build/linux-boot.scm (configure-qemu-networking): Delete 2014
comment about not doing something here.
2021-09-12 14:12:29 +02:00
Tobias Geerinckx-Rice 9c28fdcae3
gnu: Respect ‘rootdelay’ kernel command-line argument.
* gnu/build/linux-boot.scm (boot-system): Sleep for "rootdelay=SECONDS"
when specified on the kernel command line.
2021-06-16 12:13:40 +02:00
Tobias Geerinckx-Rice 169cbd808a
gnu: Respect the root file-system's CHECK? field.
* gnu/build/linux-boot.scm (mount-root-file-system): Take a new #:CHECK?
keyword argument.  Add it to the docstring.  Conditionally call
CHECK-FILE-SYSTEM.
(boot-system): Adjust its only caller to pass the <file-system>'s CHECK?
option through, if available.
2021-05-23 23:38:52 +02:00
Tobias Geerinckx-Rice 2072f617ad
linux-boot: Fix noresume argument parsing.
* gnu/build/linux-boot.scm (boot-system): Check for "hibernate=noresume"
in addition to "noresume".
2020-12-17 23:01:23 +01:00
Tobias Geerinckx-Rice b9abb301d0
linux-boot: Resume from hibernation.
* gnu/build/linux-boot.scm (resume-if-hibernated): New procedure.
(boot-system): Call it.
2020-11-07 13:40:46 +01:00
Stefan 1c3b709edb
linux-boot: Handle nfs-root device strings.
* gnu/build/linux-boot.scm (device-string->file-system-device): Support
nfs-root "device" strings.
* gnu/build/file-systems.scm (canonicalize-device-spec): Support nfs-root
"device" strings.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Avoid
checking of NFS file systems.
* gnu/system.scm (read-boot-parameters, device-sexp->device): Support
nfs-root "device" strings.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-09-07 11:00:48 +02:00
Jan (janneke) Nieuwenhuizen b37c544196
hurd-boot: Further cleanup of "rc".
* gnu/packages/hurd.scm (hurd-rc-script): Move implementation to ...
* gnu/build/hurd-boot.scm (boot-hurd-system): ...here, new file.
* gnu/build/linux-boot.scm (make-hurd-device-nodes): Move there likewise.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2020-06-08 14:26:14 +02:00
Jan (janneke) Nieuwenhuizen 6cea61f2fa
linux-boot: Update 'make-hurd-device-nodes'.
* gnu/build/linux-boot.scm (make-hurd-device-nodes): Avoid de-duplication of
device mount points; also create mount points for /servers/.
2020-06-08 13:51:18 +02:00
Maxim Cournoyer 281d80d8e5
linux-boot: Refactor boot-system.
The --root option can now be omitted, and inferred from the root file system
declaration instead.

* gnu/build/file-systems.scm (canonicalize-device-spec): Extend to support NFS
directly, and...
* gnu/build/linux-boot.scm (boot-system): ...remove NFS special casing from
here.  Remove nested definitions for root-fs-type, root-fs-flags and
root-fs-options, and bind those inside the let* instead.  Make "--root" take
precedence over the device field string representation of the root file
system.
* doc/guix.texi (Initial RAM Disk): Document that "--root" can be left
unspecified.
2020-05-20 08:30:34 -04:00
Marius Bakke 50e6c1bf2e
Merge branch 'master' into core-updates 2020-05-02 17:31:28 +02:00
Stefan afc57916e5
linux-boot: Allow the root file system to be mounted via NFS.
* gnu/build/linux-boot.scm (boot-system) Treat a root option with ":/" as an nfs source
and avoid to call 'canonicalize-device-spec' for it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-02 16:49:30 +02:00
Ludovic Courtès ac61e876a4
linux-boot: Add 'make-hurd-device-nodes'.
* gnu/build/linux-boot.scm (make-hurd-device-nodes): New procedure.
2020-04-11 20:59:20 +02:00
Ludovic Courtès 683cba75ea
linux-boot: 'make-essential-device-nodes' root parameter is optional.
* gnu/build/linux-boot.scm (make-essential-device-nodes): Change 'root'
to an optional parameter.
* gnu/build/vm.scm (root-partition-initializer): Adjust accordingly.
2020-04-11 20:48:12 +02:00
Maxim Cournoyer cc9b889e8f
linux-boot: Ensure volatile root is mounted read-only.
* gnu/build/linux-boot.scm (mount-root-file-system): Ensure MS_RDONLY is
present among the root file system flags when VOLATILE-ROOT? is #t.
2020-03-02 23:24:47 -05:00
Guillaume Le Vaillant 55e21617d6
linux-boot: Don't ignore flags when mounting root file system.
* gnu/build/linux-boot.scm (mount-root-file-system): Add the 'flags' keyword
  argument and use it when mounting the root file system.
  (boot-system): Pass the root file system flags to 'mount-root-file-system'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-12-12 17:56:33 +01:00
Guillaume Le Vaillant 900ef20b1d
linux-boot: Don't ignore options when mounting root file system.
Fixes <https://bugs.gnu.org/37977>.

* gnu/build/linux-boot.scm (mount-root-file-system): Add the 'options'
  keyword argument and use it when mounting the root file system.
  (boot-system): Pass the root file system options to
  'mount-root-file-system'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-11-18 12:18:42 +01:00
Maxim Cournoyer c09903acae
linux-boot: Fix indentation.
* gnu/build/linux-boot.scm (boot-system): Re-indent.
2019-11-18 13:22:16 +09:00
Maxim Cournoyer 41e03c4bee
linux-boot: Fix typo.
* gnu/build/linux-boot.scm (mount-root-file-system): Fix typo.
2019-09-25 12:18:25 +09:00
Ludovic Courtès e1a9a7f275
linux-modules: Add 'load-linux-modules-from-directory'.
* gnu/build/linux-modules.scm (load-linux-modules-from-directory): New
procedure.
* gnu/build/linux-boot.scm (boot-system)[lookup-module]: Remove.
Use 'load-linux-modules-from-directory' instead.
2019-08-16 23:00:27 +02:00
Danny Milosavljevic aa901521e4
linux-boot: Fix e2fsck warning.
* gnu/build/linux-boot.scm (boot-system): Fix e2fsck warning.
2019-06-03 18:08:56 +02:00
Ludovic Courtès ae7a316b9d
system: Initialize console keyboard layout in the initrd.
Partially fixes <https://bugs.gnu.org/25453>.

* gnu/system.scm (<operating-system>)[keyboard-layout]: New field.
(operating-system-initrd-file): Pass #:keyboard-layout to MAKE-INITRD.
* gnu/system/linux-initrd.scm (raw-initrd): Add #:keyboard-layout.
Pass #:keymap-file to 'boot-system'.
(base-initrd): Add #:keyboard-layout.
[helper-packages]: Add LOADKEYS-STATIC when KEYBOARD-LAYOUT is true.
Pass #:keyboard-layout to 'raw-initrd'.
* gnu/build/linux-boot.scm (boot-system): Add #:keymap-file and honor
it.
* doc/guix.texi (operating-system Reference): Document the
'keyboard-layout' field.
(Initial RAM Disk): Update 'raw-initrd' and 'base-initrd' documentation.
2019-03-24 23:06:12 +01:00
Ludovic Courtès a5acc17a3c
file-systems: Remove 'title' field and add <file-system-label>.
The 'title' field was easily overlooked and was an endless source of
confusion.  Now, the value of the 'device' field is self-contained.

* gnu/system/file-systems.scm (<file-system>): Change constructor name
to '%file-system'.
[title]: Remove.
(<file-system-label>): New record type with printer.
(report-deprecation, device-expression)
(process-file-system-declaration, file-system): New macros.
(file-system-title): New procedure.
(file-system->spec, spec->file-system): Adjust to handle
<file-system-label>.
* gnu/system.scm (bootable-kernel-arguments): Add case for
'file-system-label?'.
(read-boot-parameters): Likewise.
(mapped-device-user): Avoid 'file-system-title'.
(fs->boot-device): Remove.
(operating-system-boot-parameters): Use 'file-system-device' instead of
'fs->boot-device'.
(device->sexp): Add case for 'file-system-label?'.
* gnu/bootloader/grub.scm (grub-root-search): Add case for
'file-system-label?'.
* gnu/system/examples/bare-bones.tmpl,
gnu/system/examples/beaglebone-black.tmpl,
gnu/system/examples/lightweight-desktop.tmpl,
gnu/system/examples/vm-image.tmpl: Remove uses of 'title'.
* gnu/system/vm.scm (virtualized-operating-system): Remove uses of
'file-system-title'.
* guix/scripts/system.scm (check-file-system-availability): Likewise,
and adjust fix-it hint.
(check-initrd-modules)[file-system-/dev]: Likewise.
* gnu/build/file-systems.scm (canonicalize-device-spec): Remove 'title'
parameter.
[canonical-title]: Remove.
Match on SPEC's type rather than on CANONICAL-TITLE.
(mount-file-system): Adjust caller.
* gnu/build/linux-boot.scm (boot-system): Interpret ROOT here.
* gnu/services/base.scm (file-system->fstab-entry): Remove use of
'file-system-title'.
* doc/guix.texi (File Systems): Remove documentation of the 'title'
field.  Rewrite documentation of 'device' and document
'file-system-label'.
2018-05-28 13:24:11 +02:00
Christopher Baines 8db8bf921d
gnu: build: linux-boot: Remove bind-mount export.
bind-mount is not contained within this module.

* gnu/build/linux-boot.scm: Remove bind-mount export.
2018-02-06 17:19:28 +00:00
Danny Milosavljevic 015d0a8418
linux-boot: Add find-long-options.
* gnu/build/linux/boot.scm (find-long-options): New variable.
2018-02-01 00:11:10 +01:00
Tobias Geerinckx-Rice 162a137400
gnu: Consistently Write ‘file system(s)’.
It is the GNU way.

* doc/guix.texi (Build Systems, DNS Services): Write ‘file system(s)’.
* gnu/build/vm.scm (create-ext-file-system, create-fat-file-system):
Likewise.
* gnu/packages/backup.scm (dirvish, rsnapshot)[description]: Likewise.
* gnu/packages/check.scm (python-testpath)[description]: Likewise.
* gnu/packages/disk.scm (pydf)[description]: Likewise.
* gnu/packages/file-systems.scm (disorderfs)[synopsis, description]: Likewise.
(glusterfs)[description]: Likewise.
* gnu/packages/haskell.scm (ghc-directory, ghc-system-fileio-bootstrap)
(ghc-system-fileio)[synopsis]: Likewise.
(ghc-fsnotify)[description]: Likewise.
* gnu/packages/linux.scm (proot)[description]: Likewise.
(jmtpfs)[synopsis, description]: Likewise.
* gnu/packages/mate.scm (caja, caja-extensions)[description]: Likewise.
* gnu/packages/storage.scm (ceph)[description]: Likewise.
* gnu/packages/sync.scm (lsyncd)[description]: Likewise.
* gnu/packages/syncthing.scm (syncthing)[synopsis]: Likewise.
(go-github-com-zillode-notify)[description]: Likewise.
* gnu/services/nfs.scm (pipefs-service-type): Likewise.
* guix/scripts/system.scm (perform-action): Likewise.
2018-01-19 17:28:31 +01:00
Ludovic Courtès aeed74f370
linux-boot: Add #:on-error for initrd error handling.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>
in <https://bugs.gnu.org/29922>.

* gnu/build/linux-boot.scm (boot-system): Add #:on-error parameter and
pass it to 'call-with-error-handling'.
* gnu/system/linux-initrd.scm (raw-initrd): Add #:on-error and pass it.
(base-initrd): Likewise.
2018-01-08 23:44:07 +01:00
Danny Milosavljevic 97817e7f18
linux-boot: Add make-static-device-nodes.
* gnu/build/linux-boot.scm (make-static-device-nodes): New variable.
(<device-node>): New variable.
(read-static-device-nodes): New variable.
(report-system-error): New variable.
(catch-system-error): New variable.
(create-device-node): New variable.
(mkdir-p*): New variable.

Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
2017-12-16 07:33:09 +01:00
Ludovic Courtès 22bf86a671
linux-boot: Remove unneeded import.
* gnu/build/linux-boot.scm: Remove unnecessary autoload of (system base
compile).
2017-12-02 23:13:21 +01:00
Ludovic Courtès 748d4a84d1
linux-boot: Ensure /etc exists on the root file system.
Fixes a regression introduced in
c828969036 whereby /etc would no longer be
created as a result of calling 'mark-as-not-killable'.

This would affect ISO images because 'make-iso9660-image' does not
create /etc by default.  In particular, the ISO installation image as
created by the "iso-image-installer" test would fail to boot while
creating the /root/etc/mtab symlink:
<https://hydra.gnu.org/build/2352514/nixlog/9/raw>.

* gnu/build/linux-boot.scm (mount-root-file-system): Make sure /root/etc
exists.
2017-11-29 16:44:53 +01:00
Hartmut Goebel c828969036
build: Use overlayfs instead of unionfs.
Overlayfs is part of the kernel, while unionfs needs FUSE.  This also reduces
the size of the initrd by ca. 4.3% (487K).

* gnu/build/linux-boot.scm (mount-root-file-system): Remove optional parameter
  "unionfs"; mount using overlayfs instead of unionfs; new directory layout
  requied by overlayfs; update documentation.
  [mark-as-not-killable]: Remove now unused function

* gnu/system/linux-initrd.scm (file-system-packages): Remove now unused
  packages "unionfs-fuse/static" and thus unused related 'if'.
  (linux-modules): Replace "fuse" by "overlay".
2017-11-08 18:23:05 +01:00
Ludovic Courtès 1c65cca574
file-systems: 'mount-file-system' now takes a <file-system> object.
* gnu/build/file-systems.scm (mount-file-system): Rename 'spec' to 'fs'
and assume it's a <file-system>.
* gnu/build/linux-boot.scm (boot-system): Assume MOUNTS is a list of
<file-system> and adjust accordingly.
* gnu/build/linux-container.scm (mount-file-systems): Remove
'file-system->spec' call.
* gnu/services/base.scm (file-system-shepherd-service): Add
'spec->file-system' call.  Add (gnu system file-systems) to 'modules'.
* gnu/system/linux-initrd.scm (raw-initrd): Use (gnu system
file-systems).  Add 'spec->file-system' call for #:mounts.
2017-10-11 11:12:33 +02:00
Mathieu Othacehe a5e13c3be9
build: Fix compilation warnings.
* gnu/build/linux-boot.scm (define-module): Use (guix build syscalls).
* gnu/build/linux-modules.scm (define-module): Ditto.
* gnu/build/file-systems (define-module): Stop re-exporting mount, umount and
MS_* flags as this is now safe to include (guix build syscalls) instead.
(mount): Remove procedure.
(umount): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:26 +02:00
Alex Kost b8c02c18b4 Rename '/root/etc/dmd' directory and 'do-not-kill' file.
* gnu/services/base.scm (%do-not-kill-file): Rename to
  "/etc/shepherd/do-not-kill".
* gnu/build/linux-boot.scm (mount-root-file-system): Rename
  "/root/etc/dmd" to "/root/etc/shepherd".
2016-01-29 20:20:19 +03:00
Ludovic Courtès fb74174958 linux-boot: Remove verbose output for module loads.
* gnu/build/linux-boot.scm (boot-system): Leave
'current-module-debugging-port' unchanged.
* gnu/build/linux-modules.scm (load-linux-module*): Update comment about
'mmap'.
2016-01-05 00:28:42 +01:00
Ludovic Courtès cc0e575a94 linux-boot: Mount /dev as a devtmpfs from the start.
Suggested by Petter <petter@mykolab.ch>
and Mark H Weaver <mhw@netris.org>.
Reported by Duncan Keall <duncan@duncankeall.com>.

Partly fixes <http://bugs.gnu.org/19190> by populating /dev/mapper
early enough.

* gnu/build/linux-boot.scm (mount-essential-file-systems): Mount /dev as
  a devtmpfs.
  (move-essential-file-systems): Add /dev.
  (mount-root-file-system): Mount /rw-root/dev as a devtmpfs instead of
  calling 'make-essential-device-nodes'.
  (boot-system): Remove call to 'make-essential-device-nodes'.
* gnu/system/file-systems.scm (%devtmpfs-file-system): Remove.
* doc/guix.texi (File Systems): Adjust accordingly.
2015-09-20 22:05:36 +02:00
Ludovic Courtès 40245ef316 gnu: linux-boot: Remove outdated and misleading comment.
* gnu/build/linux-boot.scm (boot-system): Remove outdated comment.
2015-05-24 00:26:12 +02:00
Ludovic Courtès 01ed3c4fe5 linux-boot: Don't fail if /root/etc/mtab is a dangling symlink.
Reported Joshua Grant.
Patch suggested by Mark H Weaver.

* gnu/build/linux-boot.scm (mount-root-file-system): Use
  'false-if-exception' instead of 'when (file-exists? ...)' to account
  for dangling symlinks.
2015-01-28 21:32:58 +01:00
宋文武 9331ba5dd9 linux-boot: Make /etc/mtab a symlink to /proc/self/mounts.
Fixes <http://bugs.gnu.org/19491>.

* gnu/build/linux-boot.scm (mount-root-file-system): Make /root/etc/mtab
  a symlink to /proc/self/mounts.
* gnu/build/file-systems.scm (mount-file-system): Don't update /etc/mtab.
* guix/build/syscalls.scm (mount, umount): Have #:update-mtab? default to
  #f.
2015-01-05 22:24:00 +08:00
Ludovic Courtès 0e704a2d4e linux-boot: Load modules and their dependencies, à la 'modprobe'.
* gnu/build/linux-boot.scm: Use (gnu build linux-modules).
  (load-linux-module*): Remove.
  (boot-system): Add #:linux-module-directory parameter.
  [lookup-module]: New procedure.
  Call 'current-module-debugging-port'.  Pass #:lookup-module to
  'load-linux-module*'.  Map LOOKUP-MODULE on LINUX-MODULES.
* gnu/system/linux-initrd.scm (base-initrd): Adjust 'boot-system' call
  accordingly.  Adjust #:modules argument as well.
* gnu/system.scm (operating-system-activation-script)[%modules]: Likewise.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise.
2014-11-28 00:10:28 +01:00
Ludovic Courtès 67979e42c3 linux-boot: Call 'pre-mount' before 'mount-root-file-system'.
Partly fixes <http://bugs.gnu.org/19190>.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.

* gnu/build/linux-boot.scm (boot-system): Move PRE-MOUNT call before
  'mount-root-file-system' is called.
2014-11-26 11:58:06 +01:00
Ludovic Courtès 76bacc8264 linux-boot: Error out when 'pre-mount' returns #f.
* gnu/build/linux-boot.scm (boot-system): Call 'error' when PRE-MOUNT
  returns #f.
2014-11-26 11:54:21 +01:00
Ludovic Courtès 4dfbdcbcb4 linux-boot: Don't catch exceptions thrown by 'mount-root-file-system'.
* gnu/build/linux-boot.scm (mount-root-file-system): Remove 'catch #t'
  around body.  This was unneeded and even inconvenient because this
  procedure is called from within 'call-with-error-handling' already.
2014-11-20 22:43:47 +01:00