VectorLinux

The nuts and bolts => Kernel => Topic started by: roarde on November 05, 2014, 01:06:25 pm

Title: [SOLVED] Read RootFS
Post by: roarde on November 05, 2014, 01:06:25 pm
Given an on-disk /boot/vmlinuz-3.x.x, is there a way to look at the files in its RootFS, or at least list them?
Title: Re: [SOLVED] Read RootFS
Post by: roarde on November 07, 2014, 06:39:13 pm
OK, found a script in kernel source's scripts/ directory that decompresses the kernel itself. It does this by looking for the header of the compressed portion, which is found and identified by a few characters, similar to (same as?) "file magic". Starting at that location, the file is tailed through a pipe to the proper decompression program.

I'm sure that, having that decompressed kernel, one could just follow the same process but look for cpio's unique signature. Only added difficulty would be finding the end; or maybe cpio will still output despite trailing "garbage". Haven't checked. Mainly needed a firm idea that it was possible, and looks like it is.

Haven't actually tried this, but for my purposes it's solved.