Skip to content

Instantly share code, notes, and snippets.

@smoser
Created May 24, 2019 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smoser/66178d8ab59d13432ce3fa5f6f98adb8 to your computer and use it in GitHub Desktop.
Save smoser/66178d8ab59d13432ce3fa5f6f98adb8 to your computer and use it in GitHub Desktop.
cirros debug and use

Cirros Debug and usage

Boot to initramfs only

Cirros has kernels and initramfs available for many arch. Sometimes you might just need to boot a kernel and look around, but not on a cloud.

It was intended that using 'dslist=none' on the kernel command line would do that, but a logic bug prevented it, you can still get this to work though with 0.4.0.

qemu-system-x86_64 -nographic -m 512 \
    -kernel cirros/kernel  -initrd cirros/initrd \
    -append "console=ttyS0 dslist=true rdroot"

There:

  • rdroot: flag instructs cirros explicitly to run from intiramfs.
  • dslist=true tricks the bug in cirros to run the 'true' (/bin/true) datasource.

That will boot you into a cirros that runs entirely from the initramfs. Log in with 'cirros' and 'gocubsgo'.

init=/bin/sh

As standard linux, you can pass the kernel command line 'init=/bin/sh'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment