1 |
%% Chris Gianelloni <wolf31o2@g.o> writes: |
2 |
|
3 |
cg> That being said, I would love to see some work being done by |
4 |
cg> somebody on poking around with unionfs. I think it would be very |
5 |
cg> good for the upcoming LiveCD/Installer disk, as it would allow |
6 |
cg> people to configure their settings, then transfer them to the |
7 |
cg> running system once the installation is complete. |
8 |
|
9 |
So, I've compared the Gentoo initrd with the Knoppix 3.8.2 |
10 |
(unionfs-based) initrd. The Knoppix init is different in some |
11 |
interesting ways: for one thing they never pivot_root, nor chroot or |
12 |
anything. They basically use the same / directory, that was created by |
13 |
the kernel during initrd, for the entire lifetime of the system. |
14 |
|
15 |
What they do, basically, is this (I've stripped out a lot of detail of |
16 |
course): |
17 |
|
18 |
mkdir /ramdisk /UNIONFS |
19 |
|
20 |
mount -o tmpfs /ramdisk /ramdisk |
21 |
mount -o unionfs -o dirs=/ramdisk=rw:/cdrom=ro /UNIONFS /UNIONFS |
22 |
|
23 |
Now they have a unionfs filesystem at /UNIONFS, which has at the top a |
24 |
ramdisk (really located in /ramdisk) and underneath that the cdrom |
25 |
contents (really located in /cdrom). |
26 |
|
27 |
They then proceed to, essentially, make everything in / be a symlink |
28 |
pointing into /UNIONFS (obviously there are various complexities |
29 |
involved here). |
30 |
|
31 |
Then they just exec the real init. |
32 |
|
33 |
I don't know why they don't use pivot_root; that seems cleaner to me. |
34 |
But, maybe something about unionfs doesn't allow pivot_root to work. |
35 |
I'll keep poking at this. |
36 |
|
37 |
|
38 |
I _thought_ that Knoppix allowed you to make the top of the unionfs an |
39 |
actual device, like a USB keydisk or something, instead of a ramdisk, |
40 |
but offhand I don't see anything in their initrd that does anything like |
41 |
that: it seems hardcoded to go to a ramdisk as far as I can tell. I'll |
42 |
make sure of this; to me that's the real benefit of unionfs: to use it |
43 |
to customize/personalize a generic livecd, and make those customizations |
44 |
persistent. If you don't have this I'm not sure what the advantage of |
45 |
unionfs is over the more traditional methods, like Gentoo's. I guess |
46 |
the only real advantage is that the entire disk is modifiable rather |
47 |
than just specific areas. |
48 |
|
49 |
-- |
50 |
------------------------------------------------------------------------------- |
51 |
Paul D. Smith <psmith@××××××.com> HASMAT--HA Software Mthds & Tools |
52 |
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist |
53 |
------------------------------------------------------------------------------- |
54 |
These are my opinions---Nortel Networks takes no responsibility for them. |
55 |
-- |
56 |
gentoo-catalyst@g.o mailing list |