diff options
| author | Janneke Nieuwenhuizen <janneke@gnu.org> | 2024-10-16 08:59:13 +0200 |
|---|---|---|
| committer | Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | 2024-11-11 07:28:34 +0100 |
| commit | cca544513b7c01e1cff33ac0c690031406dceac6 (patch) | |
| tree | 087d5a0eb602fcb3112b538161a83263d41cc41e /gnu | |
| parent | e57bc3bcde9fc200c9196e94b29bf7b5b427411e (diff) | |
installer: Use `%' for parameter %run-command-in-installer.
* gnu/installer/utils.scm (run-command-in-installer): Rename to...
(%run-command-in-installer): ...this.
* gnu/installer.scm (installer-program): Update accordingly.
* 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-ensure-open, luks-close):
Update accordingly.
Change-Id: I96ebc59ebc85fd8ebccb0cc57130b4e7532d287f
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/installer.scm | 2 | ||||
| -rw-r--r-- | gnu/installer/parted.scm | 27 | ||||
| -rw-r--r-- | gnu/installer/utils.scm | 6 |
3 files changed, 18 insertions, 17 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm index 3a05843cabd..21809e4259a 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm | |||
| @@ -465,7 +465,7 @@ purposes." | |||
| 465 | (installer-init current-installer) | 465 | (installer-init current-installer) |
| 466 | (lambda () | 466 | (lambda () |
| 467 | (parameterize | 467 | (parameterize |
| 468 | ((run-command-in-installer | 468 | ((%run-command-in-installer |
| 469 | (installer-run-command current-installer))) | 469 | (installer-run-command current-installer))) |
| 470 | (catch #t | 470 | (catch #t |
| 471 | (lambda () | 471 | (lambda () |
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index dbdec1bba82..e59df3d8e63 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | ;;; Copyright © 2019-2020, 2022, 2024 Ludovic Courtès <ludo@gnu.org> | 3 | ;;; Copyright © 2019-2020, 2022, 2024 Ludovic Courtès <ludo@gnu.org> |
| 4 | ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> | 4 | ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
| 5 | ;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz> | 5 | ;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz> |
| 6 | ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org> | ||
| 6 | ;;; | 7 | ;;; |
| 7 | ;;; This file is part of GNU Guix. | 8 | ;;; This file is part of GNU Guix. |
| 8 | ;;; | 9 | ;;; |
| @@ -363,7 +364,7 @@ fail. See rereadpt function in wipefs.c of util-linux for an explanation." | |||
| 363 | 364 | ||
| 364 | (define (remove-logical-devices) | 365 | (define (remove-logical-devices) |
| 365 | "Remove all active logical devices." | 366 | "Remove all active logical devices." |
| 366 | ((run-command-in-installer) "dmsetup" "remove_all")) | 367 | ((%run-command-in-installer) "dmsetup" "remove_all")) |
| 367 | 368 | ||
| 368 | (define (installer-root-partition-path) | 369 | (define (installer-root-partition-path) |
| 369 | "Return the root partition path, or #f if it could not be detected." | 370 | "Return the root partition path, or #f if it could not be detected." |
| @@ -1183,7 +1184,7 @@ list and return the updated list." | |||
| 1183 | 1184 | ||
| 1184 | (define (create-btrfs-file-system partition) | 1185 | (define (create-btrfs-file-system partition) |
| 1185 | "Create a btrfs file-system for PARTITION file-name." | 1186 | "Create a btrfs file-system for PARTITION file-name." |
| 1186 | ((run-command-in-installer) "mkfs.btrfs" "-f" partition)) | 1187 | ((%run-command-in-installer) "mkfs.btrfs" "-f" partition)) |
| 1187 | 1188 | ||
| 1188 | (define (create-ext4-file-system partition) | 1189 | (define (create-ext4-file-system partition) |
| 1189 | "Create an ext4 file-system for PARTITION file-name." | 1190 | "Create an ext4 file-system for PARTITION file-name." |
| @@ -1192,32 +1193,32 @@ list and return the updated list." | |||
| 1192 | ;; up and adding new files would fail with ENOSPC despite there being plenty | 1193 | ;; up and adding new files would fail with ENOSPC despite there being plenty |
| 1193 | ;; of free space and inodes: | 1194 | ;; of free space and inodes: |
| 1194 | ;; <https://blog.merovius.de/posts/2013-10-20-ext4-mysterious-no-space-left-on/>. | 1195 | ;; <https://blog.merovius.de/posts/2013-10-20-ext4-mysterious-no-space-left-on/>. |
| 1195 | ((run-command-in-installer) "mkfs.ext4" "-F" partition | 1196 | ((%run-command-in-installer) "mkfs.ext4" "-F" partition |
| 1196 | "-O" "large_dir")) | 1197 | "-O" "large_dir")) |
| 1197 | 1198 | ||
| 1198 | (define (create-fat16-file-system partition) | 1199 | (define (create-fat16-file-system partition) |
| 1199 | "Create a fat16 file-system for PARTITION file-name." | 1200 | "Create a fat16 file-system for PARTITION file-name." |
| 1200 | ((run-command-in-installer) "mkfs.fat" "-F16" partition)) | 1201 | ((%run-command-in-installer) "mkfs.fat" "-F16" partition)) |
| 1201 | 1202 | ||
| 1202 | (define (create-fat32-file-system partition) | 1203 | (define (create-fat32-file-system partition) |
| 1203 | "Create a fat32 file-system for PARTITION file-name." | 1204 | "Create a fat32 file-system for PARTITION file-name." |
| 1204 | ((run-command-in-installer) "mkfs.fat" "-F32" partition)) | 1205 | ((%run-command-in-installer) "mkfs.fat" "-F32" partition)) |
| 1205 | 1206 | ||
| 1206 | (define (create-jfs-file-system partition) | 1207 | (define (create-jfs-file-system partition) |
| 1207 | "Create a JFS file-system for PARTITION file-name." | 1208 | "Create a JFS file-system for PARTITION file-name." |
| 1208 | ((run-command-in-installer) "jfs_mkfs" "-f" partition)) | 1209 | ((%run-command-in-installer) "jfs_mkfs" "-f" partition)) |
| 1209 | 1210 | ||
| 1210 | (define (create-ntfs-file-system partition) | 1211 | (define (create-ntfs-file-system partition) |
| 1211 | "Create a JFS file-system for PARTITION file-name." | 1212 | "Create a JFS file-system for PARTITION file-name." |
| 1212 | ((run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) | 1213 | ((%run-command-in-installer) "mkfs.ntfs" "-F" "-f" partition)) |
| 1213 | 1214 | ||
| 1214 | (define (create-xfs-file-system partition) | 1215 | (define (create-xfs-file-system partition) |
| 1215 | "Create an XFS file-system for PARTITION file-name." | 1216 | "Create an XFS file-system for PARTITION file-name." |
| 1216 | ((run-command-in-installer) "mkfs.xfs" "-f" partition)) | 1217 | ((%run-command-in-installer) "mkfs.xfs" "-f" partition)) |
| 1217 | 1218 | ||
| 1218 | (define (create-swap-partition partition) | 1219 | (define (create-swap-partition partition) |
| 1219 | "Set up swap area on PARTITION file-name." | 1220 | "Set up swap area on PARTITION file-name." |
| 1220 | ((run-command-in-installer) "mkswap" "-f" partition)) | 1221 | ((%run-command-in-installer) "mkswap" "-f" partition)) |
| 1221 | 1222 | ||
| 1222 | (define (call-with-luks-key-file password proc) | 1223 | (define (call-with-luks-key-file password proc) |
| 1223 | "Write PASSWORD in a temporary file and pass it to PROC as argument." | 1224 | "Write PASSWORD in a temporary file and pass it to PROC as argument." |
| @@ -1246,9 +1247,9 @@ USER-PARTITION if it is encrypted, or the plain file-name otherwise." | |||
| 1246 | (lambda (key-file) | 1247 | (lambda (key-file) |
| 1247 | (installer-log-line "formatting and opening LUKS entry ~s at ~s" | 1248 | (installer-log-line "formatting and opening LUKS entry ~s at ~s" |
| 1248 | label file-name) | 1249 | label file-name) |
| 1249 | ((run-command-in-installer) "cryptsetup" "-q" "luksFormat" | 1250 | ((%run-command-in-installer) "cryptsetup" "-q" "luksFormat" |
| 1250 | file-name key-file) | 1251 | file-name key-file) |
| 1251 | ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" | 1252 | ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" |
| 1252 | "--key-file" key-file file-name label))))) | 1253 | "--key-file" key-file file-name label))))) |
| 1253 | 1254 | ||
| 1254 | (define (luks-ensure-open user-partition) | 1255 | (define (luks-ensure-open user-partition) |
| @@ -1262,14 +1263,14 @@ USER-PARTITION if it is encrypted, or the plain file-name otherwise." | |||
| 1262 | (lambda (key-file) | 1263 | (lambda (key-file) |
| 1263 | (installer-log-line "opening LUKS entry ~s at ~s" | 1264 | (installer-log-line "opening LUKS entry ~s at ~s" |
| 1264 | label file-name) | 1265 | label file-name) |
| 1265 | ((run-command-in-installer) "cryptsetup" "open" "--type" "luks" | 1266 | ((%run-command-in-installer) "cryptsetup" "open" "--type" "luks" |
| 1266 | "--key-file" key-file file-name label)))))) | 1267 | "--key-file" key-file file-name label)))))) |
| 1267 | 1268 | ||
| 1268 | (define (luks-close user-partition) | 1269 | (define (luks-close user-partition) |
| 1269 | "Close the encrypted partition pointed by USER-PARTITION." | 1270 | "Close the encrypted partition pointed by USER-PARTITION." |
| 1270 | (let ((label (user-partition-crypt-label user-partition))) | 1271 | (let ((label (user-partition-crypt-label user-partition))) |
| 1271 | (installer-log-line "closing LUKS entry ~s" label) | 1272 | (installer-log-line "closing LUKS entry ~s" label) |
| 1272 | ((run-command-in-installer) "cryptsetup" "close" label))) | 1273 | ((%run-command-in-installer) "cryptsetup" "close" label))) |
| 1273 | 1274 | ||
| 1274 | (define (format-user-partitions user-partitions) | 1275 | (define (format-user-partitions user-partitions) |
| 1275 | "Format the <user-partition> records in USER-PARTITIONS list with | 1276 | "Format the <user-partition> records in USER-PARTITIONS list with |
diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm index c722e9af8fe..170f036537f 100644 --- a/gnu/installer/utils.scm +++ b/gnu/installer/utils.scm | |||
| @@ -50,7 +50,7 @@ | |||
| 50 | run-external-command-with-handler/tty | 50 | run-external-command-with-handler/tty |
| 51 | run-external-command-with-line-hooks | 51 | run-external-command-with-line-hooks |
| 52 | run-command | 52 | run-command |
| 53 | run-command-in-installer | 53 | %run-command-in-installer |
| 54 | 54 | ||
| 55 | syslog-port | 55 | syslog-port |
| 56 | %syslog-line-hook | 56 | %syslog-line-hook |
| @@ -222,13 +222,13 @@ in a pseudoterminal." | |||
| 222 | (pause) | 222 | (pause) |
| 223 | succeeded?) | 223 | succeeded?) |
| 224 | 224 | ||
| 225 | (define run-command-in-installer | 225 | (define %run-command-in-installer |
| 226 | (make-parameter | 226 | (make-parameter |
| 227 | (lambda (. args) | 227 | (lambda (. args) |
| 228 | (raise | 228 | (raise |
| 229 | (condition | 229 | (condition |
| 230 | (&serious) | 230 | (&serious) |
| 231 | (&message (message "run-command-in-installer not set"))))))) | 231 | (&message (message "%run-command-in-installer not set"))))))) |
| 232 | 232 | ||
| 233 | 233 | ||
| 234 | ;;; | 234 | ;;; |
