Commit graph

58 commits

Author SHA1 Message Date
Mathieu Othacehe
4473be9858
installer: Detect mapped installation devices.
Fixes: <https://issues.guix.gnu.org/59823>

* gnu/installer/parted.scm (mapped-device?,
mapped-device-parent-partition): New procedures.
(eligible-devices): Detect mapped installation devices using the new
procedures.
2022-12-10 11:24:07 +01:00
Mathieu Othacehe
ab974ed709
installer: parted: Retry failing read-partition-uuid call.
Fixes: <https://issues.guix.gnu.org/53541>.

* gnu/installer/parted.scm (read-partition-uuid/retry): New procedure.
(check-user-partitions): Use it.
2022-10-31 09:34:13 +01:00
Josselin Poiret
fd942712d8
installer: Ensure luks devices are open when mounting partitions.
Partially-Fixes: <https://issues.guix.gnu.org/57983>

* gnu/installer/parted.scm (luks-ensure-open): New procedure.
(unmount-user-partitions): Ensure luks devices are open.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-09-22 16:27:19 +02:00
Josselin Poiret
4814ec284f
installer: Move <secret> to utils and use it for crypt passwords.
* gnu/installer/user.scm (<secret>, secret?, make-secret, secret-content): Move
to utils.scm.
* gnu/installer/utils.scm (<secret>, secret?, make-secret, secret-content):
Moved from user.scm.
* gnu/installer/newt/partition.scm (prompt-luks-passwords): Make password a
<secret>.
* gnu/installer/parted.scm (luks-format-and-open): Unwrap secret.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-09-22 16:00:29 +02:00
Josselin Poiret
4989f6acff
installer: Fix segfault on double logical partition removal.
* gnu/installer/parted.scm (auto-partition!): Avoid removing logical
partitions twice.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-09-01 18:43:28 +02:00
Tobias Geerinckx-Rice
d59442f24e
installer: parted: Don't export WITH-DELAY-DEVICE-IN-USE?.
* gnu/installer/parted.scm: Remove WITH-DELAY-DEVICE-IN-USE? from the
module's export list.
2022-08-14 02:00:02 +02:00
Ludovic Courtès
ff9522fb69
installer: Add comments and vertical space to the generated config.
* gnu/installer/parted.scm (user-partitions->configuration): Introduce
vertical space and a comment.
* gnu/installer/services.scm (G_): New macro.
(%system-services): Add comment for OpenSSH.
(system-services->configuration): Add vertical space and comments.
* gnu/installer/user.scm (users->configuration): Add comment.
* gnu/installer/steps.scm (format-configuration): Add comment.
(configuration->file): Expound leading comment.  Pass #:format-comment
to 'pretty-print-with-comments/splice'.
2022-08-08 11:54:25 +02:00
Mathieu Othacehe
3c381af76a
installer: parted: Call set-system before set-flags.
Parted 3.5 introduces the following regression:

- partition-set-flag sets the BIOS_GRUB flag. The partition type is set to
PARTITION_BIOS_GRUB_GUID.

- partition-set-system resets the partition type to PARTITION_LINUX_DATA_GUID
undoing what's done by partition-set-flag.

To prevent it, reverse the call order.

Fixes: <https://issues.guix.gnu.org/55549>.

* gnu/installer/parted.scm (mkpart): Call partition-set-system before
partition-set-flag.
2022-08-05 08:57:20 +02:00
Mathieu Othacehe
eb0277e7e3
installer: parted: Log partition flags.
* gnu/installer/parted.scm (mkpart): Log them.
2022-08-05 08:57:20 +02: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
Josselin Poiret
0a74509a69
installer: Raise condition when mklabel fails.
* gnu/installer/parted.scm (mklabel): Do it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-02-02 16:46:43 +01:00
Josselin Poiret
af59e53631
installer: Use run-command-in-installer in (gnu installer parted).
* gnu/installer/parted.scm (remove-logical-devices,
create-btrfs-file-system, create-ext4-file-system,
create-fat16-file-system, create-fat32-file-system,
create-jfs-file-system, create-ntfs-file-system,
create-xfs-file-system, create-swap-partition, luks-format-and-open,
luks-close): Use run-command-in-installer.
(with-null-output-ports): Remove.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-02-02 16:46:43 +01:00
Josselin Poiret
4f2fd33b4f
installer: Use new installer-log-line everywhere.
* gnu/installer.scm (installer-program)
* gnu/installer/final.scm (install-locale)
* gnu/installer/newt.scm (init)
* gnu/installer/newt/final.scm (run-final-page)
* gnu/installer/newt/page.scm (run-form-with-clients)
* gnu/installer/newt/partition.scm (run-partitioning-page)
* gnu/installer/parted.scm (eligible-devices, mkpart,
luks-format-and-open, luks-close, mount-user-partitions,
umount-user-partitions, free-parted):
* gnu/installer/steps.scm (run-installer-steps):
* gnu/installer/utils.scm (run-command, send-to-clients): Use it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-02-02 16:46:43 +01:00
Mathieu Othacehe
c6910baf36
installer: Ignore small devices.
Filter the devices that are smaller than 2GiB in the device selection list.

* gnu/installer/parted.scm (%min-device-size): New variable.
(non-install-devices): Rename it ...
(eligible-devices): ... this way. Filter the install device as well as the
small devices.
* gnu/installer/newt/partition.scm (run-partitioning-page): Adapt it.
2022-01-14 14:29:08 +01:00
Mathieu Othacehe
32750e8c3e
Merge remote-tracking branch 'signed/master' into core-updates 2021-12-10 21:49:25 +01:00
Tobias Geerinckx-Rice
e5e307b676
Revert "installer: Make LUKS2 the default format for encrypted devices"
This reverts commit a82e9f45fd at the
author's request.  We are not quite ready to boot all resulting
systems.

See <https://logs.guix.gnu.org/guix/2021-12-08.log#231815>.
2021-12-08 23:23:19 +01:00
Ricardo Wurmus
9bc0f45df5
Merge remote-tracking branch 'origin/master' into core-updates-frozen 2021-12-05 19:17:41 +01:00
Mathieu Othacehe
d64b78ef0c
installer: parted: Use the swap-space record.
* gnu/installer/parted.scm (user-partitions->configuration): Use the
swap-space record.
2021-12-01 20:59:06 +01:00
Josselin Poiret
a82e9f45fd
installer: Make LUKS2 the default format for encrypted devices
* gnu/installer/parted.scm (luks-format-and-open): Change it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-12-01 17:51:37 +01:00
Josselin Poiret
b90504cdb5
installer: Rework installation device detection.
* gnu/installer/parted.scm (installation-device): Remove it.
* gnu/installer/parted.scm (installer-root-partition-path): Add it.
* gnu/installer/parted.scm (non-install-devices): Add installation-device?
predicate.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-11-26 10:52:02 +00:00
Tobias Geerinckx-Rice
f1a3c11407
installer: Fix typo in docstrings.
* gnu/packages/gnu/installer/parted.scm
(force-user-partitions-formatting, format-user-partitions):
Fix ‘formating’ docstring typo.
2021-10-01 21:27:36 +02:00
Tobias Geerinckx-Rice
f34b808741
installer: Support XFS.
* gnu/installer/newt/partition.scm (run-fs-type-page): Add ‘xfs’ to the
list box.
* gnu/installer/parted.scm (user-fs-type-name, user-fs-type->mount-type)
(partition-filesystem-user-type): Add ‘xfs’ mapping.
(create-xfs-file-system): New procedure.
(format-user-partitions): Use it.
* gnu/installer.scm (set-installer-path): Add xfsprogs.
2021-09-23 18:17:18 +02:00
Maxim Cournoyer
da4e409483
Migrate to the new 'targets' field of bootloader-configuration.
The old 'target' field is deprecated; adjust the sources to use the new
'targets' one instead.

* doc/guix-cookbook.texi<target>: Replace by 'targets'.
* gnu/bootloader/grub.scm: Likewise.
* gnu/installer/parted.scm: Likewise.
* gnu/machine/digital-ocean.scm: Likewise.
* gnu/system/examples/asus-c201.tmpl: Likewise
* gnu/system/examples/bare-bones.tmpl: Likewise
* gnu/system/examples/bare-hurd.tmpl: Likewise
* gnu/system/examples/beaglebone-black.tmpl: Likewise
* gnu/system/examples/desktop.tmpl: Likewise
* gnu/system/examples/docker-image.tmpl: Likewise
* gnu/system/examples/lightweight-desktop.tmpl: Likewise
* gnu/system/examples/vm-image.tmpl: Likewise
* gnu/system/examples/yggdrasil.tmpl: Likewise
* gnu/system/hurd.scm: Likewise
* gnu/system/images/hurd.scm: Likewise
* gnu/system/images/novena.scm: Likewise
* gnu/system/images/pine64.scm: Likewise
* gnu/system/images/pinebook-pro.scm: Likewise
* gnu/system/images/rock64.scm: Likewise
* gnu/system/install.scm: Likewise
* gnu/system/vm.scm: Likewise
* gnu/tests.scm: Likewise
* gnu/tests/ganeti.scm: Likewise
* gnu/tests/install.scm: Likewise
* gnu/tests/nfs.scm: Likewise
* gnu/tests/telephony.scm: Likewise
* tests/boot-parameters.scm: Likewise
* tests/system.scm: Likewise
2021-08-29 01:05:26 -04:00
Mathieu Othacehe
e12be802e0
installer: Improve the installation device detection method.
Fixes: <https://issues.guix.gnu.org/47780>.

* gnu/installer/parted.scm (installation-device): New method.
(non-install-devices): Remove devices which are reported as read-only by
parted or which path is identical to the installation device path returned by
the above method.
2021-06-17 11:00:26 +02:00
Mathieu Othacehe
245cab2abc
installer: Fix FAT16 partition mounting.
The "fat" file-system mount type doesn't exist in Linux. Trying to mount a
FAT16 partition with "fat" file-system type returns -ENODEV.

Fixes: <https://issues.guix.gnu.org/48419>.

* gnu/installer/parted.scm (user-fs-type->mount-type): Use the "vfat"
file-system for FAT16 partitions.
2021-06-13 14:11:59 +02:00
Mathieu Othacehe
154a4e0462
installer: Improve install device detection.
* gnu/installer/parted.scm (non-install-devices): Improve the detection by
assuming that any device with the ISO9660 label is the installation device.
2021-06-12 18:40:39 +02:00
Mathieu Othacehe
f5d9d6ec68
installer: Check partitions UUIDs.
* gnu/installer/parted.scm (&cannot-read-uuid): New condition.
(cannot-read-uuid?, cannot-read-uuid-partition): New procedures.
(check-user-partitions): Check that all user-partitions have a valid UUID,
raide the above condition otherwise.
* gnu/installer/newt/partition.scm (run-disk-page): Run an error page if the
&cannot-read-uuid condition is raised.
2021-06-12 09:31:33 +02:00
Mathieu Othacehe
af7a615c5b
installer: Add MSDOS disk label support on UEFI systems.
Fixes: <https://issues.guix.gnu.org/47889>.

* gnu/installer/parted.scm (esp-partition?): Remove the MSDOS check.
(auto-partition!): On MSDOS disks, check if an ESP partition is present. If
that's the case, do not remove it. Otherwise, if UEFI is supported, create
one.
2021-04-28 15:50:02 +02:00
Mathieu Othacehe
3d3ffb30f9
installer: Fix device synchronization.
Reported by Florian Pelz:
https://lists.gnu.org/archive/html/guix-devel/2020-11/msg00326.html.

* gnu/installer/utils.scm (call-with-time): New procedure,
(let/time): new macro.
* gnu/installer/parted.scm (with-delay-device-in-use?): Increase the retry
count to 16.
(non-install-devices): Remove the call to with-delay-device-in-use? as it
doesn't return the expected result, and would block much longer now.
(free-parted): Log the time required to sync each device.
2020-11-17 19:10:14 +01:00
Mathieu Othacehe
8c287bb2fb
installer: parted: Add debug output.
* gnu/installer/parted.scm (mkpart): Log partition creation.
2020-11-08 19:41:12 +01:00
Ludovic Courtès
8f71305e8f
installer: parted: Internationalize the partition handling code.
* gnu/installer/parted.scm (user-partition-description): Use 'format'
and 'G_' for i18n.
2020-11-01 23:56:29 +01:00
Ludovic Courtès
1c6d985331
installer: Use UUIDs in the 'swap-devices' field.
Note: This change requires an updated 'guix' package that contains
Linux-swap support in (gnu build file-systems).

* gnu/installer/parted.scm (user-partitions->configuration): Use UUIDs
in the 'swap-devices' field.
* gnu/installer/newt/final.scm (run-final-page)[wait-for-clients]: New
procedure.   Use it.
* gnu/installer/tests.scm (choose-partitioning): Wait for
'starting-final-step' message and move configuration file dialog
handling to...
(conclude-installation): ... here.  Send over PORT the reply
corresponding to 'starting-final-step'.
* gnu/tests/install.scm (gui-test-program): When ENCRYPTED? is false,
invoke 'swaplabel' in the marionette.
(installation-target-os-for-gui-tests): When ENCRYPTED? is false, except
a fixed UUID.
2020-10-30 01:14:21 +01:00
Miguel Ángel Arruga Vivas
19c14d95b3
installer: Create bios_grub partition when it is needed.
* gnu/installer/parted.scm (auto-partition!): Only check for ESP on EFI
installations.
2020-10-19 21:54:25 +02:00
Tobias Geerinckx-Rice
e1f3788944
installer: Fix docstring typoes.
* gnu/installer/connman.scm (connman-state, run-locale-page)
(start-swapping, stop-swapping, run-installer-steps): Fix typo in
docstring.
2020-09-21 00:31:15 +02:00
Mathieu Othacehe
5697a524a7
installer: Remove logical devices.
If a device contains an active logical volume, BLKRRPART will report that the
device is busy. This will cause this device to be filtered by
"non-install-devices" procedure, which is not desired.

Make sure to deactivate all logical volumes before device probing.

Fixes <https://issues.guix.gnu.org/42683>.

* gnu/installer.scm (installer-program): Add lvm2-static to the inputs.
* gnu/installer/parted.scm (remove-logical-devices): New procedure,
(init-parted): call it.
2020-08-06 11:31:38 +02:00
Mathieu Othacehe
218a67dfab
installer: Add NTFS support.
This adds support for creating and editing NTFS partitions. It is however not
possible yet to create root NTFS partitions, as overlaying on top of a fuse
partition does not seem supported.

* gnu/installer.scm (installer-program): Add "ntfs-3g" to the inputs.
* gnu/installer/parted.scm (user-fs-type-name, user-fs-type->mount-type,
partition-filesystem-user-type, create-ntfs-file-system,
format-user-partitions): Add NTFS support.
* gnu/installer/newt/partition.scm (run-fs-type-page): Add NTFS support.
2020-07-26 18:35:10 +02:00
Ludovic Courtès
5c04b00cf4
installer: Log important bits to syslog.
* gnu/installer.scm (installer-program): Log crashes with 'syslog'.
* gnu/installer/parted.scm (luks-format-and-open, luks-close)
(mount-user-partitions, umount-user-partitions): Add 'syslog' calls.
* gnu/installer/steps.scm (run-installer-steps): Log the running step
with 'syslog'.
* gnu/installer/utils.scm (run-shell-command): Add calls to 'syslog'.
2020-02-22 00:45:42 +01:00
Tobias Geerinckx-Rice
8fec416cec
installer: Add JFS support.
* gnu/installer/newt/partition.scm (run-fs-type-page): Add ‘jfs’ to the
list box.
* gnu/installer/parted.scm (user-fs-type-name, user-fs-type->mount-type)
(partition-filesystem-user-type): Add ‘jfs’ mapping
(create-jfs-file-system): New procedure.
(format-user-partitions): Use it.
* gnu/installer.scm (set-installer-path): Add jfsutils.
2020-01-05 02:40:07 +01:00
Tobias Geerinckx-Rice
1133596b42
installer: Fix typo.
* gnu/installer/parted.scm (create-btrfs-file-system): Fix typo in docstring.
2020-01-05 02:40:07 +01:00
Mathieu Othacehe
70c7b7c799
installer: Update to Guile-Parted 0.0.2 release.
* gnu/installer/parted.scm (data-partition?, metadata-partition?,
freespace-partition?, normal-partition?, extended-partition?,
logical-partition?): Remove, as now provided by Guile-Parted.
* gnu/installer/newt/partition.scm (run-disk-page): Remove disk-destroy calls,
replace disk-delete-all by disk-remove-all-partitions and
disk-delete-partition by disk-remove-partition*.
2019-09-25 16:03:23 +02:00
Ludovic Courtès
0b051bacb3
installer: Always add '%base-initrd-modules' to 'initrd-modules'.
Fixes <https://bugs.gnu.org/36099>.
Reported by Jonathan Brielmaier <jonathan.brielmaier@web.de>.

* gnu/installer/parted.scm (initrd-configuration): Add
%BASE-INITRD-MODULES to the 'initrd-modules' field.
2019-06-05 17:27:22 +02:00
Ludovic Courtès
d68de958b6
installer: Fix Guile-Parted crash on i686.
Fixes <https://bugs.gnu.org/35783>.
This is a followup to 7d567af46b.

* gnu/installer/parted.scm (auto-partition!): Append ESP-PARTITION, when
it is true, to the result of 'create-adjacent-partitions!'.
* gnu/installer/newt/partition.scm (run-partioning-page): Remove
'initial-partitions' variable, and remove call to
'create-special-user-partitions'.

Co-authored-by: Mathieu Othacehe <m.othacehe@gmail.com>
2019-05-19 11:58:36 +02:00
Ludovic Courtès
1537464819
installer: Rename 'auto-partition' to 'auto-partition!'.
This is a followup to 7d567af46b.

* gnu/installer/parted.scm (create-adjacent-partitions): Rename to...
(create-adjacent-partitions!): ... this.  Make private.
(auto-partition): Rename to...
(auto-partition!): ... this.
* gnu/installer/newt/partition.scm (run-partioning-page): Adjust
accordingly.
2019-05-15 16:36:20 +02:00
Danny Milosavljevic
b7488b321d
installer: Fix docstring.
* gnu/installer/parted.scm (create-fat32-file-system): Fix docstring.
2019-05-14 18:01:09 +02:00
Danny Milosavljevic
628d09ae53
installer: Add fat16.
* gnu/installer/parted.scm (user-fs-type-name): Add fat16.
(user-fs-type->mount-type): Add fat16.
(create-fat16-file-system): New procedure.
(format-user-partitions): Use it.
2019-05-14 18:01:08 +02:00
Danny Milosavljevic
c5b1377840
installer: Create btrfs file system.
Fixes <https://bugs.gnu.org/35655>.

* gnu/installer/parted.scm (create-btrfs-file-system): New procedure.
(format-user-partitions): Use it.
2019-05-14 00:44:03 +02:00
Ludovic Courtès
50247be5f4
installer: Produce an 'initrd-modules' field if needed.
* gnu/installer/parted.scm (root-user-partition?): New procedure.
(bootloader-configuration): Use it.
(user-partition-missing-modules, initrd-configuration): New procedures.
(user-partitions->configuration): Call 'initrd-configuration'.o
* gnu/installer.scm (not-config?): Rename to...
(module-to-import?): ... this.  Add cases to exclude non-installer and
non-build (gnu …) modules.
(installer-program)[installer-builder]: Add GUIX to the extension list.
2019-03-27 11:54:05 +01:00
Ludovic Courtès
54043bf23f
installer: Emit 'bootloader' field before 'swap-devices'.
* gnu/installer/parted.scm (user-partitions->configuration): Move
'bootloader' section above 'swap-devices'.
2019-03-27 11:54:05 +01:00
Ludovic Courtès
3191b5f6ba
installer: Set the system's 'keyboard-layout' field.
* gnu/installer/newt/keymap.scm (keyboard-layout->configuration): New
procedure.
* gnu/installer.scm (compute-keymap-step): Return RESULT.
(installer-steps) <'keymap>: Add 'configuration-formatter' field.
(installer-program): Use (gnu installer newt keymap).
* gnu/installer/parted.scm (bootloader-configuration): Set
'keyboard-layout'.
2019-03-25 23:37:05 +01:00
Tobias Geerinckx-Rice
b83e4a93a2
gnu: Fix some typos in the installer.
* gnu/installer/connman.scm (connman-connect-with-auth): Fix typo in
documentation.
* gnu/installer/newt/keymap.scm (sort-variants): Likewise.
* gnu/installer/newt/page.scm (run-listbox-selection-page): Likewise.
* gnu/installer/parted.scm (mkpart): Likewise.
* gnu/installer/newt/utils.scm (destroy-form-and-pop): Likewise.
* gnu/installer/newt/wifi.scm (run-unknown-error-page): Fix typo.
(wifi-listbox-heigth): Rename to…
(wifi-listbox-height): …this, and adjust caller.
* gnu/installer/timezone.scm (locate-childrens): Rename to…
(locate-children): …this.  Adjust all callers.
2019-02-18 01:52:47 +01:00