xbc_prepend_...dded_cmdline(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xbc_prepend_...dded_cmdline(9) πŸ’…

okay so you're in the Kernel API Manual, bestie, and today's main character is xbc_prepend_embedded_cmdline(9). yes the header is truncated, no that's not a typo, it's just the man page being dramatic. let's get into it 🫢


✨ NAME ✨

xbc_prepend_embedded_cmdline β€” prepend the embedded bootconfig cmdline, periodt πŸ’…


✨ SYNOPSIS ✨

void xbc_prepend_embedded_cmdline (char *dst , size_t size );

that's it. that's the whole function signature. two args, no return value, we love a void king πŸ‘‘


✨ ARGUMENTS ✨

  • dst β€” the cmdline buffer you're prepending into. heads up though: it must already contain a NUL byte, like that's a whole requirement not a suggestion, okurrr 🌸
  • size β€” the total capacity of dst, in bytes. the whole thing, size bytes, no cap πŸ“

✨ DESCRIPTION ✨

so what does it actually do? it takes the build-time-rendered "kernel" subtree of the embedded bootconfig and prepends it to dst. literally just sticks it on the front. πŸŽ€

and here's the cute part β€” the rendered string already ends with a single space (that's the xbc_snprint_cmdline invariant, iykyk ✨), and that one lil space is what does the separating between the embedded keys and whatever was already chilling in dst. built-in separator. no extra work. slay.

now the overflow behaviour, and this is important so listen up:

on overflow, it logs an error and leaves dst completely untouched β€” it does not silently truncate. because booting without the embedded values is better than refusing to boot, and the error message is there to tell you why your embedded keys are missing in the first place 😭

like the whole vibe is: fail graceful, never lie to the user about what happened. iconic.

where you call it from: it's intended to be called from setup_arch, before parse_early_param, so that the early_param handlers actually get to see the embedded values. order matters, bestie, this is very much a sequence situation 🌈


✨ SEE ALSO ✨

kernel file ./lib/bootconfig.c, plus the whole friend group:


and that's the page!! πŸ¦‹ sign-off time: this one lives over in ./lib, dated October 2026, and it's filed under xbc_prepend_...dded_cmdline(9) in case the truncated header wasn't already living rent-free in your head πŸ’€ mwah, go prepend something responsibly πŸ’–

πŸ“¦ where this page comes from