unpack_to_rootfs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– unpack_to_rootfs β€” kernel API manual, section 9, bestie πŸ’–

Okay so before we even get into it: this page lives in the Kernel API Manual, section 9, and it's about unpack_to_rootfs β€” the little function that decompresses and extracts an initramfs archive. Yes, that initramfs. The one everyone's boot depends on and nobody thinks about. Main character energy honestly. πŸ‘‘


✨ NAME ✨

unpack_to_rootfs β€” decompress and extract an initramfs archive. That's the whole job. It unpacks, it extracts, it decompresses. Slay. πŸŽ€


✨ SYNOPSIS ✨

char * unpack_to_rootfs (char *buf , unsigned long len );

Read it carefully bestie, the spacing is exactly like that β€” char *buf , unsigned long len β€” don't come for me, I'm just the messenger. πŸ’…


🌸 ARGUMENTS 🌸

  • buf β€” the input initramfs archive we're extracting. This is the goods, fr fr.
  • len β€” the length of the initramfs data to process. Like, how many bytes of buf actually matter. No guessing games. πŸ“

🌈 RETURN 🌈

  • NULL β€” success! We ate. πŸ“
  • an error message string β€” not success. It hands you back a string telling you what went wrong. 😭
Heads up: the return is a char *, so on success you get NULL β€” which is not an error here! Iconic little plot twist. Don't invert this check, I'm begging. 🫢

πŸ’œ DESCRIPTION πŸ’œ

Okay so the vibe check on this one: this symbol shouldn't be used externally. Like, not for you. Not for your driver. Not for your module. It exists because it's available for unit tests β€” that's literally its whole reason for being. It's giving backstage pass, not public API. πŸ™ˆ

So admire it from afar, test with it if you're the test suite, and otherwise leave it alone. Periodt. πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./init/initramfs.c β€” go read it, it's right there, it's literally the source of truth. πŸ“‚

And that's the page!! 🌟 Cute little sign-off time: this one came from the source path ./init, and the page itself is dated October 2026 β€” so yeah, future-dated, we stay ahead of the curve. The whole thing is unpack_to_rootfs(9), section 9, Kernel API Manual, and you now know everything there is to know. Go forth and don't call it externally. Mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from