Misleading error message about initramfs regeneration
Newbie to rpm-ostree and dracut.
I just changed /etc/crypttab then tried updating initramfs with a command found on Internet: sudo rpm-ostree initramfs-etc --track=/etc/crypttab
But I've already done sudo rpm-ostree initramfs --enable in the past, hence I'm getting the following error message:
https://github.com/coreos/rpm-ostree/blob/b10d8daf5ed9babda72377e69ce3447e8f10ae5a/src/daemon/rpmostree-sysroot-upgrader.cxx#L931
This is very misleading, and I thought I should do
sudo dracut arg -I /etc/crypttab
It didn't work and I got a binary named arg :rofl:
Then I figured the actual command I should run is
sudo rpm-ostree initramfs --enable --arg=-I --arg=/etc/crypttab
We should change the error message to something like
initramfs regeneration and /etc overlay not compatible; use this command instead:
rpm-ostree initramfs --enable --arg=-I --arg=/etc/file_to_track
Looks like initramfs-etc is newer than initramfs regeneration https://github.com/coreos/rpm-ostree/pull/2170 , so instead of telling people to revert back to rpm-ostree initramfs --enable --arg=-I --arg=/etc/file_to_track, we should tell them to disable regeneration first, then start using initramfs-etc --track /etc/file_to_track?
so instead of telling people to revert back to rpm-ostree initramfs --enable --arg=-I --arg=/etc/file_to_track, we should tell them to disable regeneration first, then start using initramfs-etc --track /etc/file_to_track?
Sounds right to me
The error is kept generic because it depends why you enabled initramfs regeneration in the first place. If it was to -I some files, then yes, you can/should move to initramfs-etc. But e.g. adding dracut modules, kernel drivers, etc... can't be done through initramfs-etc, so if you need to do that and also want to add some /etc files, then you need to revert back to -I in your customized list of dracut kargs.
Though we could probably detect cases where users do rpm-ostree initramfs --enable --arg=-I --arg=/etc/file_to_track and print a helpful note that they could use rpm-ostree initramfs-etc instead.