-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add mkinitcpio hook for Arch and sample /etc/mkinitcpio.conf #8
base: master
Are you sure you want to change the base?
Conversation
#!/bin/bash | ||
|
||
build() { | ||
add_module `bcachefs` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the backticks here rather than quotes causes mkinitcpio to spit out ==> ERROR: module not found: `bcachefs:'
switching them to quotation marks makes mkinitcpio run fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or no quotes at all, as is done in existing hooks. Same for add_binary
below.
d31cdf9
to
8a632ea
Compare
8d71b04
to
c8bec83
Compare
f6c80f9
to
138397d
Compare
run_hook() { | ||
|
||
# check if $root needs unlocking | ||
if bcachefs unlock -c $root >/dev/null 2>&1; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails if root
isn't a dev path (eg. UUID=
), because only bcahcefs mount
knows how to handle that.
Could do what some existing hooks do (resume)
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
This adds the necessary initcpio hook for Arch to boot from an encrypted root bcachefs drive/partition. For the time being, the hook is kept in the custom hooks directory (
/etc/initcpio/hooks
) as per the Arch wiki. As things get mainlined and become part of the kernel, we may want to move the hook into the system hooks directory (/usr/lib/initcpio/hooks
). There is an example of a working/etc/mkinitcpio.conf
that calls the bcachefs hook when creating a new initramfs withmkinitcpio -p linux-bcachefs
.