-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
nixos/bcache: install udev rules outside initrd too #26344
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
Conversation
So that $ nix-build -A bcache-tools.src gives /nix/store/HASH-bcache-tools-1.0.7.tar.gz instead of /nix/store/HASH-v1.0.7.tar.gz
Needed for bcache-tools. Mind the '"' which will prevent bad substitution in the future in case bcache-tools gets patched to ${bash}/bin/sh instead of /bin/sh. Note that this substitution rule is already implemented in the handling of udev rules that goes into the initrd (stage-1.nix).
ee224ac
to
bb77ae2
Compare
Adds /dev/disk/by-{id,label}/* symlinks for bcache device nodes, in the final rootfs. Symlinks will only be created for bcache devices with a filesystem. So if you have a blank bcache device or run LVM on top of bcache you will not get this kind of symlink.
bb77ae2
to
045066d
Compare
I rebuilt and rebooted my system with this. No harm done. |
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.
Seems all good to me!
I still wonder why do we need to replace /bin/sh
-- shouldn't it work given that /bin/sh
is installed and I don't think udev isolates itself in a chroot/mount namespace? Still, less sources of impurity is anyway better.
Good question. Maybe @dfoxfranke can answer, because it seems that was tested:
|
Argh, I definitely need more sleep - I have read this and acknowledged in my head but still asked the question again. Thanks! |
Looking at 775f381 it is clear the /bin/sh substitute rule was added for bcache. I think I'll close this PR and open a new one from my old branch: master...bjornfor:bcache-udev-rules And if the changes in the above branch does create a regression, it will be at build time (AFAICT), not runtime (when booting). |
Closing in favor of the new PR: #26354. |
Motivation for this change
Should fix #26281 ("Bcache udev rules not installed outside initrd").
(Apparently I cannot verify that these rules are working by generating symlinks to bcache devices in /dev/disk/by-*, because on my system I run LVM on top of bcache.)
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)