[klibc] play with initrd in early user space

H. Peter Anvin hpa at zytor.com
Thu Jun 1 22:10:22 PDT 2006


jason wrote:
> Hi,  All
> 
> I am currently learning on the early userspace(EUS) code. And my goal
> is accessing initrd while in the EUS. For example: mount an initrd
> with the EUS mount command, Fsck it, chroot to it, run linuxrc in it
> and so on...
> 
> But depend on the code, One can not preserve a initrd image when
> loading into EUS. So I must modify the EUS code to reach the goal. Can
> you give me some advices about this? Thank you!
> 
I suspect the easiest way to do what you want is to make sure you have a 
shell (e.g. dash) in your initramfs, and then replace /init with a shell 
script that just runs an interactive shell:

#!/bin/sh
exec sh

The only reason you need a shell script at all is that sh will get 
confused if it is invoked as /init, because of the arguments passed to it.

	-hpa



More information about the klibc mailing list