View Single Post
  #8 (permalink)  
Old 01-02-2005
noggie noggie is offline
Registered User
 
Join Date: Sep 2004
Posts: 339
Thanks: 0
Thanked 0 Times in 0 Posts
noggie is on a distinguished road
Talking Two-stage booting - new possibilities

I had this idea that I just couldn't put away until I tried it... I don't need it, but it I thought it could be cool to see if I could pull it off.

In priciple, by using a two-stage booting (using a initrd/miniroot as initial root partition, then switch to the real root partion) you should be able to boot with a root partition from CIFS. It took me a few attempts to set up (some extra boots to NFS to fix things), but I did make it in the end.

I'm running the miniroot in flash, so the standard bootloader is doing just the normal thing, getting a kernel from cramfs, and booting with sqashfs (the miniroot) as root.

Now miniroot takes over, uses some of the hooks that I've made available to extend the bootprocess from the jffs2 partition in flash, and basically does the following:
1) Loads the cifs.ko kernel module
2) Sets up the network (I'm using just a static IP address)
3) Mounts a Windows share using cifs.
4) Mounts a file on that share as an ext3 file system using the loopback feature.
5) Proceeds to the trickery of setting this last filesystem up as root.
6) Continues the boot of the 7020 software which I've loaded to that file. The 7020 software is slightly more hacked than it used to be, in that I just turned off network installation because it otherwise would interfere with the CIFS mount.

So now I can (on my standard 7000) run software for a machine that's not for sale yet (the 7020) running off a file on a windows machine. Except for the times that I needed to run off NFS to bail me out of the mistakes I made in setting it up, I wouldn't have needed a NFS server and Linux machine at all. All the setup could have been done from a PC and the miniroot. It would just be false modesty if I tried to claim that I don't find this way cool :-)

If anybody's interested in the details, please get in touch and I'll write down a few words. Don't expect a step-by-step recipe, though. It is (as I found out) easy to do a mistake where booting off NFS is the only alternative to re-flashing a standard image to get control over the machine again, so if you need very detailed instructions, you shouldn't be doing it.

There's one more detail to this story... My Windows machine isn't really a machine. It's just a virtual machine running off VMware on my Linux box... Now try to trace in your mind what that "read" system call in Enigma is actually going through before the data stored on my IDE disk is finally returned to the application... Makes you quite dizzy, eh? :-) :-)
Reply With Quote
 
Page generated in 0.13091 seconds with 9 queries