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

Ensure user provided cmdline is always last #3158

Closed

Conversation

septatrix
Copy link
Contributor

This is required for -- to work such that one can stop the kernel from parsing further options and simply passing them as arguments to the init process

Open to suggestions on how to improve this. We could for example first collect all of mkosi's options and then directly before executing qemu append the user provided cmdline. This is just the quickest fix, not necessarily the cleanest ;) It also assumes that nothing depends on the order of the arguments which I am not sure is the case (e.g. what happens if two systemd.set_credential_binary with the same name defined - with this change the order would be reversed).

@septatrix septatrix marked this pull request as ready for review October 31, 2024 13:12
@DaanDeMeyer
Copy link
Contributor

@septatrix We can just move the finalize_extra_command_line_extra() call further down

@septatrix
Copy link
Contributor Author

@septatrix We can just move the finalize_extra_command_line_extra() call further down

Then we would need to special case some things as e.g. root= currently depends on the finalized cmdline

@DaanDeMeyer
Copy link
Contributor

@septatrix You can generalize finalize_kernel_command_line_extra() to finalize_kernel_command_line() and move the if condition at the callsite into the function. Then you can evaluate against finalize_kernel_command_line() instead of kcl when determining root=.

@septatrix septatrix force-pushed the ensure-user-cmdline-is-always-last branch from aa9c9d5 to 01bd968 Compare November 7, 2024 21:39
@septatrix
Copy link
Contributor Author

Not sure if I understood your suggestion correctly. I feel like I might have done the exact opposite now...

This is required for '--' to work
@septatrix septatrix force-pushed the ensure-user-cmdline-is-always-last branch from 01bd968 to e2e3c47 Compare November 7, 2024 21:49
DaanDeMeyer added a commit to DaanDeMeyer/mkosi that referenced this pull request Nov 11, 2024
@septatrix septatrix closed this Nov 11, 2024
DaanDeMeyer added a commit to DaanDeMeyer/mkosi that referenced this pull request Nov 11, 2024
DaanDeMeyer added a commit to DaanDeMeyer/mkosi that referenced this pull request Nov 12, 2024
DaanDeMeyer added a commit to DaanDeMeyer/mkosi that referenced this pull request Nov 12, 2024
DaanDeMeyer added a commit that referenced this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants