rpm-ostree icon indicating copy to clipboard operation
rpm-ostree copied to clipboard

Misleading error message about initramfs regeneration

Open mxj4 opened this issue 1 year ago • 4 comments

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

mxj4 avatar Aug 04 '24 21:08 mxj4

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?

mxj4 avatar Aug 04 '24 22:08 mxj4

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

cgwalters avatar Aug 27 '24 22:08 cgwalters

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.

jlebon avatar Aug 28 '24 19:08 jlebon

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.

jlebon avatar Aug 28 '24 19:08 jlebon