Skip to content

Initramfs with a long-running service #2624

Answered by rikonor
rikonor asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @LaszloGombos - thanks for the info! I think I was overcomplicating things a bit. I probably don't need a tool like dracut for this. What I ended up doing which seems to work fine is:

  1. Get a basic Alpine filesystem (I did this by grabbing an official Alpine Docker image and extract the filesystem from it).
  2. Inject my binary into this filesystem.
  3. Inject an /init script that brings up the network and then starts my long-running binary.
  4. Create a cpio archive from this filesystem.

I then can start the whole thing with qemu by specifying a kernel and the resulting initramfs.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rikonor
Comment options

Answer selected by rikonor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants