Skip to content
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

Don't die if files already in initramfs #157

Open
umbernhard opened this issue Nov 1, 2021 · 0 comments
Open

Don't die if files already in initramfs #157

umbernhard opened this issue Nov 1, 2021 · 0 comments

Comments

@umbernhard
Copy link

Attempting to build safeboot-hooks into the initramfs doesn't work right now with kernels 5.10 and 5.11. It appears that this is because safeboot-hooks runs set -e, while hook-functions returns a 1 if the file already exists in the initramfs (i.e. this is probably not an error?) and error codes >1 for other errors.

Proposed solution: add a wrapper to safeboot-hooks to make idempotent copies to the initramfs and replace all calls to copy_file with it:

idempotent_copy() {
        copy_file "$1" "$2" "$3" || [ $? -eq 1 ]
}
umbernhard pushed a commit to umbernhard/safeboot that referenced this issue Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant