Rich Freeman posted on Sun, 15 Jul 2012 14:48:55 -0400 as excerpted: > Giving it a little thought, the simplest tmpfs-based root would be one > that defines a tarball as a the root. The system would create a tmpfs, > extract the tarball to it, and then use the existing fstab-sys module to > mount stuff on top of that. This gives you the option of actually > putting some content in the tarball, or just storing an empty directory > structure in it. A tarball would let you set permissions/etc and be a > bit more generic than writing a custom script. If you wrote a module to > do this I wouldn't be suprised if upstream let you merge it. You'd just > need to define some kind of sane syntax for it > (root=TAR=path...to...tarball - though how a path works with nothing > mounted you'd have to define). Maybe you define the tarball at > initramfs creation (as is done with fstab.sys and mdadm.conf).
Tarball is an interesting idea I hadn't considered. At first blush I like it. =:^) Thinking in that direction does stimulate yet another idea, tho. What about a squashfs root? AFAIK squashfs is read-only at use time, thus enforcing actually mounting something else to write anything, eliminating many of the down sides of sticking with the initial ramfs root, but it would allow the same flexibility in terms of sticking whatever into it at create-time, while only taking the memory necessary for what's actually stuck in it at create-time. I /think/ it's swappable, too, which would give me some flexibility in terms of letting more stuff be added at create-time without having to worry about it being locked in memory. And I think squashfs is reasonably tested territory for this sort of thing, given its use for live-media, etc. And it's in mainline now, too, which is nice. =:^) I'll have to do some research and think about that a bit more... Definitely thanks for the tarball idea, as otherwise I'd probably have not got out of my "box" and thought about squashfs. I'm probably missing its downsides ATM, but you still broke my thinking out of the box! -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman