summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoverstreet <kent.overstreet@gmail.com>2024-12-01 19:26:50 -0500
committerGitHub <noreply@github.com>2024-12-01 19:26:50 -0500
commit51ebefdd6ed193d5a18d1e4cb909ed8b8068038f (patch)
treecbfcfc7fb7cd155acff72aa144e42b73c8193a41
parentc2af793c8cc13eea31f7201b17c09d2d8c45bb9c (diff)
parent77d72319a4a9d61ea77219017df8d8789d57ebc4 (diff)
Merge pull request #353 from nnathan/improvements_to_initcpio
initcpio: small improvements to the mkinitcpio hooks
-rw-r--r--arch/etc/initcpio/hooks/bcachefs17
-rw-r--r--arch/etc/initcpio/install/bcachefs9
2 files changed, 13 insertions, 13 deletions
diff --git a/arch/etc/initcpio/hooks/bcachefs b/arch/etc/initcpio/hooks/bcachefs
index cc2ed7e9..21bb964e 100644
--- a/arch/etc/initcpio/hooks/bcachefs
+++ b/arch/etc/initcpio/hooks/bcachefs
@@ -1,14 +1,15 @@
#!/usr/bin/ash
run_hook() {
-
-# check if $root needs unlocking
-if bcachefs unlock -c $root >/dev/null 2>&1; then
- echo "Unlocking $root:"
- while true; do
- bcachefs unlock $root && break
- done
-fi
+ local rootdev
+ if rootdev="$(resolve_device "$root")" && bcachefs unlock -c "$rootdev" >/dev/null 2>&1
+ then
+ echo "Unlocking $rootdev:"
+ while true
+ do
+ bcachefs unlock "$rootdev" && break
+ done
+ fi
}
# vim: set ft=sh ts=4 sw=4 et:
diff --git a/arch/etc/initcpio/install/bcachefs b/arch/etc/initcpio/install/bcachefs
index 67ce186d..02a74dd8 100644
--- a/arch/etc/initcpio/install/bcachefs
+++ b/arch/etc/initcpio/install/bcachefs
@@ -1,15 +1,14 @@
#!/bin/bash
build() {
- add_module `bcachefs`
- add_binary "bcachefs"
-
- add_runscript
+ add_module bcachefs
+ add_binary bcachefs
+ add_runscript
}
help() {
- cat <<HELPEOF
+ cat <<HELPEOF
This hook is for getting the bcachefs unlock prompt at boot
HELPEOF
}