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

Since last update using --conf /dev/null fails. How do I ignore preexisting config files? #1835

Closed
oddlama opened this issue Jun 2, 2022 · 6 comments · Fixed by #1878
Closed
Labels
bug Our bugs

Comments

@oddlama
Copy link

oddlama commented Jun 2, 2022

Describe the bug
Since the last major update, invoking dracut with --conf /dev/null fails. If I see correctly, this has been introduced as a response to #1136, where it was considered a bug not to reject /dev/null. I've been using --conf /dev/null --confdir /dev/null to ignore any existing configuration files, but the linked issue suggests this never worked (?). What is the correct way to make dracut ignore any existing configuration files, now that /dev/null is invalid?

Distribution used
Latest arch LIVE-USB environment

Dracut version
dracut-056

@aafeijoo-suse
Copy link
Member

You can pass an empty file to --conf and a directory with no .conf files to --confdir.

@oddlama
Copy link
Author

oddlama commented Jun 3, 2022

I was hoping for a solution that doesn't require creating a new file and directory. Especially for automated invocation, I need a stateless approach and cannot rely on the state of the user's filesystem.

Is there any rationale behind not allowing /dev/null to disable configuration? It seems like an unnecessary complication from my point of view.

@aafeijoo-suse
Copy link
Member

I don't see why calling mktemp would be an issue in this specific use case, as dracut calls it internally during the generation process.

# dracut -f --conf $(mktemp) --confdir $(mktemp -d)

@oddlama
Copy link
Author

oddlama commented Jun 3, 2022

I don't see why calling mktemp would be an issue in this specific use case, as dracut calls it internally during the generation process.

# dracut -f --conf $(mktemp) --confdir $(mktemp -d)

Not strictly a technical issue of course, but arguably a usability issue. All classical command-line tools can be used with special files from /dev or with command substitution by design (see for example dd if=/dev/zero ... or diff <(echo test) ...). With dracut I cannot use either of those, as those are not files but character devices or fifos.

I hope I could clarify why it seems strange to me, when a tool actively prohibits this type of usage. This is also why I initially expected there to be a technical reason for dracut to disallow it. I'm still not sure if that's the case, but if it isn't, I think it feels like an artificial restriction with no apparent benefit.

Of course this is a very minor thing overall, but I'd like to say that I would be happy if dracut could be used as described. :)

oddlama added a commit to oddlama/gentoo-install that referenced this issue Jun 5, 2022
Dracut changed parameter interpretation in a new version,
causing this script to error out. To properly fix this,
we require a resolution of dracutdevs/dracut#1835.
Meanwhile, this is tracked internally by #41.
@oddlama
Copy link
Author

oddlama commented Jun 30, 2022

Excuse my impatience, but I wonder if there has been an update to this issue in the meantime?

@pvalena
Copy link
Contributor

pvalena commented Jul 21, 2022

I think this is a behaviour change, as /dev/null is invalid config file and therefore expected to fail.

pvalena added a commit to pvalena/dracut that referenced this issue Jul 21, 2022
If file is not a regular file (test -f), dracut.sh fails,
which is unexpected change of behaviour.
The workaround would be to create an empty file.

Fixes: dracutdevs#1835
johannbg pushed a commit that referenced this issue Aug 12, 2022
If file is not a regular file (test -f), dracut.sh fails,
which is unexpected change of behaviour.
The workaround would be to create an empty file.

Fixes: #1835
fepitre added a commit to fepitre/qubes-linux-kernel that referenced this issue Jan 16, 2023
fepitre added a commit to fepitre/qubes-linux-kernel that referenced this issue Jan 18, 2023
marmarek pushed a commit to QubesOS/qubes-linux-kernel that referenced this issue Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Our bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants