-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
initramfs: zfsunlock hook breaks /usr/bin #11162
Conversation
Signed-off-by: Pavel Zakharov <[email protected]>
cc: @terem42 |
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.
Looks good. This is the same as the preferred fix proposed in #10448.
Agree, there was a missing slash on copy_exec command, covered by earlier fix. |
@terem42 Just a note regarding
|
The copy_exec() function expects that the full path of the target file is passed rather than just the directory, and will take care of creating the underlying directories if they don't exist. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Zakharov <[email protected]> Closes #11162
The copy_exec() function expects that the full path of the target file is passed rather than just the directory, and will take care of creating the underlying directories if they don't exist. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Zakharov <[email protected]> Closes openzfs#11162
The copy_exec() function expects that the full path of the target file is passed rather than just the directory, and will take care of creating the underlying directories if they don't exist. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pavel Zakharov <[email protected]> Closes openzfs#11162
When running
update-initramfs -u
, we get the following output:When the initramfs archive is created or updated, it runs a bunch of hooks in
/usr/share/initramfs-tools/hooks
. A new hook introduced by #10027,zfsunlock
, copies a new file in the/usr/bin
directory of the initramfs archive. The problem is that when that hook is executed the/usr/bin
directory doesn't exist, so instead of copying the script into the/usr/bin
directory, it creates a new/usr/bin
file with the contents of that script.Description
The
copy_exec()
function expects that the full path of the target file is passed rather than just the directory, and will take care of creating the underlying directories if they don't exist.How Has This Been Tested?
The issue was detected on Ubuntu 18.04 running with zfs on root, using
initramfs-tools
version0.130ubuntu3.11
. I've modified the hook installed under/usr/share/initramfs-tools/hooks/zfsunlock
, re-ranupdate-initramfs -u
and made sure the system can still boot.Additional thoughts
We may want to consider running all zfs hooks with
-e
, so that they fail if any sub-command fails. In this case, the errors come from the "zfs" hook, which seems to run after the "zfsunlock" hook.Types of changes
Checklist:
Signed-off-by
.