On Sat, Dec 29, 2001, Jeff Dike wrote:
> freedman@... said:
> > It's only the tmpfs-root I want to play with in UML.
> How does it work on a physical machine? In particular, how do you populate
> the tmpfs root?
> It sounds similar to initrd, except that's an in-memory block device rather
> than a filesystem, but the initialization problem seems the same.
Yeah, my apologies, I really skirted over this issue (and thanks for
calling me on it with the good question)... I probably should have
just said that I'm interested in experimenting with UML booting with
InitRD (but then staying with initrd for continual operation as the
root-fs and neglecting to pivot_root after module-loading as is
normally done; the nodes are lean enough that I've made my kernels
The reason I mentioned booting with tmpfs-root is because I've been
looking at a CONFIG_BLK_DEV_INITRD_DYN_TMPFS patch developed by folks
over at the linux router project. While it's discussed in more detail
I attached the relevant new CONFIG descriptions to the bottom of this
One of the reasons I wanted to experiment with this stuff in UML is
I'm unsure of the best ramdisk-type boot direction to take. Following
the above announcement/patch for Dynamic-InitRD, Al Viro counters that
this approach is misguided:
"Sigh... With initramfs it can be done in userland. _Please_, let's stop
adding complexity to already ridiculously bloated late boot stages."
and Dave Cinege counters:
"Using Initrd Dynamic a person can boot with a ramdisk as their primary
root, populating it with tar.gz archive(s). Making 'image' changes works
very well and in a modular way. (IE root.tgz, etc.tgz)
With this release you can now forgo an internal mkfs on /dev/ram0 before
archive extraction and go straight to a truly dynamic tmpfs VFS as the root
without the minix FS limitations."
Just FYI, though you've probably seen it, there's more info about Al
Viro's initramfs at http://www.lwn.net/2001/0802/a/initramfs.php3.
Anyway, I'm way out of my element trying to decide between competing
approaches of kernel hackers (though initramfs definitely seems more
"mainstream"), so I thought I'd try to determine empirically for
myself using UML (if possible) how well they work (and then, possibly,
ask further questions on lkml or #kernel-newbies).
I think I'd feel great if I could just play around with the typical
InitRD/InitRAMfs under UML (and if that's it, then sorry for the
overload of all this extra information regarding tmpfs-root, just
trying to let you know where I was planning on going).
Once again, Jeff, thanks for everything you've done with UML.
Kernel Patches for Dynamic InitRD and tmpfs root by Linux Router Folks:
Initrd Dynamic allows you to use tar.gz archive(s) instead of those
nasty raw images. It works by dynamically creating a filesystem at
boot, mounting it as '/', then extracting the archive(s) loaded into
the initrd memory space. If your bootloader can load multiple archives
sequentially (IE a patched GRUB) all archives will be extracted in the
order they where loaded.
Optionally Initrd Dynamic can create the /dev directory and some
failsafe console files.
You must select at least one of the available filesystems below.
You probably want to use tmpfs if it's available in your kernel.
The kernel parameter to specify options is:
fstype == One of the supported dynamic mkfs filesystems.
fssize == Limits the size of the filesystem created.
tmpfs: If not speced it's equal to the real memory space.
minix: If not speced it's equal to ramdisk_size.
mkdev == /dev is created after archive untar. Useful even if devfs=mount.
initrd_dyn=minix,8m ramdisk_size=20480 root=/dev/ram0 load_ramdisk=1
initrd_dyn=minix,,mkdev root=/dev/rd/0 load_ramdisk=1
Initial RAM disk tmpfs auto filesystem support
Specing initrd_tar=tmpfs[,fssize] will have the kernel dynamically
mount a tmpfs filesystem as the root. Spec a normal tar.gz file for
the boot loader to load as the initrd root archive.
Daniel A. Freedman
Laboratory for Atomic and Solid State Physics
Department of Physics