Skip to content

Refactor cmdline handling & fix ordering - #67

Merged
ermo merged 2 commits into
mainfrom
fix/cmdline-ordering
Aug 10, 2026
Merged

Refactor cmdline handling & fix ordering#67
ermo merged 2 commits into
mainfrom
fix/cmdline-ordering

Conversation

@tarkah

@tarkah tarkah commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Previously cmdline loading was happening in many parts of the codebase. This refactors to a cmdline module which is the source of truth for all cmdline loading & final merge logic.

This also fixes a bug where /etc cmdline snippets were added before /usr kernel specific cmdline instead of after.

Testing

Before & after for boot status. Global cmdline is the same, but now we just show it as the merged string:

image

Before & after for my latest boot entry :

image

Notice my custom nvme_core entry is last. Also notice moss.fstx comes AFTER quiet splash. This is because this is added by moss manually which I feel follows a similar order of priorty ruling where it should be higher than the shipped cmdline.

@tarkah
tarkah force-pushed the fix/cmdline-ordering branch 2 times, most recently from 3001fa6 to 9105da8 Compare August 7, 2026 16:27

@ermo ermo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The consolidation sounds like a really good idea.

Suggestion for you to ponder:

What if, via either a --debug or a --verbose flag, we kept the vector with different strings in the output of moss boot status --verbose/--debug, such that we can map the entries to their on-disk snippet?

This might yield very useful insight into the order in which files are loaded as snippets (or even excluded by symlinks), where we pretty-print the list like this:

cmdline = [
  "foo", // from <filename>
  "bar", // from <filename>
  // "baz", // from <filename> but excluded by <filename>
]

Where baz is a disabled default in this instance?

Then we give the user insight into how the process works, so they can experiment their way towards a working kernel command-line, while legitimately showing what blsforme "decides"?

@tarkah

tarkah commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

I think that idea. Final merging can then filter out the things decorated as exclusion but we can then debug things nicely. Can we add this as a followup enhancement? I don't think it needs to block this refactor + fix.

@bhh32

bhh32 commented Aug 9, 2026

Copy link
Copy Markdown

LGTM, needs rebased on main

@tarkah
tarkah force-pushed the fix/cmdline-ordering branch from 9105da8 to fbdec5b Compare August 10, 2026 15:47
@tarkah

tarkah commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

LGTM, needs rebased on main

Thanks! Done.

@tarkah
tarkah force-pushed the fix/cmdline-ordering branch from fbdec5b to 2ed0e8a Compare August 10, 2026 15:53
tarkah added 2 commits August 10, 2026 09:16
Previously cmdline loading was happening in many
parts of the codebase. This refactors to a
cmdline module which is the source of truth for
all cmdline loading & final merge logic.

This also fixes a bug where `/etc` cmdline snippets
were added _before_ `/usr` kernel specific cmdline
instead of after.
@tarkah
tarkah force-pushed the fix/cmdline-ordering branch from 2ed0e8a to d5f4a31 Compare August 10, 2026 16:17
@ermo
ermo merged commit 419c89e into main Aug 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants