Joshua Murphy wrote:
> On 2/6/07, Joe Ciccone <[EMAIL PROTECTED]> wrote:
>> Instead of an initrd I'd look into including an initramfs image that
>> locates the CD, mounts it, does whatever it needs todo to mount the
>> image, then does a pivot_root into the image's root. I think this is (or
>> is atleast similar to) what the lfs-livecd does.

What all needs to be included in the initramfs image? I can't seem to 
find a tutorial on how to make one. I did read the Makefile for the 
initramfs part of LFS 6.2, as well as the init.c file, but I didn't 
really understand a lot of it.

> Hmm, actually, look into the bootscripts for DSL, there's a "toram"
> boot time option that does just that with their system ... but you may
> learn more from an older version's bootscripts, as a lot of it's
> harder to follow since they started using unionfs and such.

I'll check that out.

> My idea, however: Load a small initramfs (containing mount and either
> cp or tar+gzip, busybox could handle the job nicely) that mounts a
> tmpfs based filesystem (make sure to set the max size large enough),
> then copy a filesystem image into that and mount (or just untar a
> system into the tmpfs), then pivotroot into the new system ... there's
> no data persistency, but it should run very fast and relatively clean
> (assuming no major memory leaks).

My plan thus far is this:

1. Get LFS's initramfs package.
2. Create mini fs with uclibc, busybox
3. Modify init.c to mount a ~50 MB tmpfs filesystem
4. Untar entire real filesystem image to tmpfs
5. pivot_root into the new filesystem

I know I more-or-less just made a list out of that last paragraph, but 
it helps me know more of what I'm doing.

Can I use the same procedure to boot from USB, too? It seems to me that 
the only difference, at least in the way I'm doing it, is the 
bootloader: for the CD, I'll use SYSLINUX/ISOLINUX, and for USB, well, I 
don't know yet--GRUB?

Here's the thing, though: my entire FS is going to be probably under 20 
MB. CLFS out-of-the-box is around 12 MB, and I'm in the process of 
adding PHP, an SNMP daemon, and some other little things to help run 
this (it's a mini-router distro I'm making for my graduation project 
www.cs.westminster.edu/~cdean/capstone ). Would I be able to just mount 
the entire FS as the initramfs and not bother with pivoting?
_______________________________________________
Clfs-support mailing list
[email protected]
http://lists.cross-lfs.org/cgi-bin/mailman/listinfo/clfs-support

Reply via email to