Modifying the filesystem of the sel4 linux vm - ku-sldg/stairCASE GitHub Wiki

linux under sel4

a vm running sel4, running a vm running linux with pretty much just a busybox.
see here for partial instruction.

state of the union

That is, what functionality do we have?

  • cat
  • cp
  • date
  • dd
  • echo
  • grep
  • ls
  • mkdir
  • more
  • mount, umount
  • ping
  • pwd
  • rm, rmdir
  • sed
  • sh
  • sleep
  • tar
  • touch
  • true
  • vi
  • watch

and what do we not have?
nothing important

at least, nothing I use or could see using...

implement a new program

first try test program, then cryptohash!

the tutorial doesn't line up with the repo...
I should still be able to add to the rootfs!

cpio -idv < rootfs.cpio
this results in a kernel panic.

[ 1.271112] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I rebuilt the archive in place, then ninja, run

the same kernel panic ensued...

I moved the archive, moved it back, ninja, run

That worked! :relieved:

update, I think I made a mistake in the creation of the archive. I was adding the new archive to the same directory as its contents, such that I think cpio tried to add the archive to itself a little bit.

well, it still didn't work after assigning a reasonable destination

okay, so I had been making at least two mistakes
I needed to make an ASCII cpio archive, specifically.

find . | cpio -o -H newc > /path/to/dest

-o is create an archive (copy Out)
-H is the format specifier newc is the format, and we have that newc is:

" The new (SVR4) portable format, which supports file systems having more than 65536 i-nodes. (4294967295 bytes) "

okay so with that all in place,
and the file output matching,
it still doesn't work.
there is no kernel panic,
and there are no apparent errors,
but the login prompt never appears.

so now I'm a bit lost.

There must be some arcane method for modifying the filesystem, which is obscured from the user.