initcpio: small improvements to the mkinitcpio hooks

This commit is contained in:
Naveen Nathan 2024-12-02 09:46:38 +11:00
parent c2af793c8c
commit 77d72319a4
2 changed files with 13 additions and 13 deletions

View File

@ -1,12 +1,13 @@
#!/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
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
}

View File

@ -1,11 +1,10 @@
#!/bin/bash
build() {
add_module `bcachefs`
add_binary "bcachefs"
add_module bcachefs
add_binary bcachefs
add_runscript
}
help() {