From: <ne...@ne...> - 2007-03-10 10:28:33
|
First of all, sorry for the wrong post on the "cvs" mailing list! The message was: Ciao all. I think that MiniModule unionfs overlaying is conceptually wrong. in the base module we have 2 init script that mount main and mini modules by using unionfs. While Mainmodule is overlayed in morphix-start in this way: mount -t unionfs -o dirs=3D/mnt/main${UNIONFS_MOUNT_OPT},debug=3D$DEBU= GOVERLAY none /mnt/main unionctl /mnt/main --add --mode ro /mnt/main_ro unionctl /mnt/main --add --mode rw $DIR2/root MiniModules are overlayed in load-minimodules.sh with: if [ -d /mnt/main/mnt/mini/mod$count/root ]; then unionctl /mnt/main --add --after 0 --mode ro /mnt/main/mnt/mini/mod$= count/root fi This make the root file system on the resulting live cd booted like this: root@Medianix:~# unionctl / --list /mnt/.hidden_base/ramdisk/var/tmp/overlay/root (rw-) /mnt/mini/mod2/root (r--) /mnt/.hidden_base/mnt/main_ro (r--) root@Medianix:~# as the "0" branch is the rw mounted ramdisk, so, when add to the unionfs the MiniModule, it will go after this and before the Main that is /mnt/.hidden_base/mnt/main_ro. In this way if we have 2 files (let me say for an example, /etc/passwd) both in main *and* minimodule, the main one take precedence over the minimodule one. While having multiple minimodule with the same file can open some issues, i think that it will be better to permit to minimodules to take precedence over the mainmodule, so, i think that in load-minimodules.sh the unionctl line shuld be unionctl /mnt/main --add --mode ro /mnt/main/mnt/mini/mod$count/root without the --after 0 switch. Another idea is to use a file inside the minimodule, something like "unionfsposition" that contain the position to insert the minimodule branch, letting us configure this from the minimodule itself. Something like: if [ -d /mnt/main/mnt/mini/mod$count/root ]; then if [ -f /mnt/main/mnt/mini/mod$count/unionfspos ]; then ufsafter=3D"--after `cat /mnt/main/mnt/mini/mod$count/unionfspos`" fi unionctl /mnt/main --add $ufsafter --mode ro /mnt/main/mnt/mini/mod$count= /root fi --=20 Franco (nextime) Lanza Busto Arsizio - Italy SIP://ca...@ca... NO TCPA: http://www.no1984.org you can download my public key at: http://danex.nexlab.it/nextime.asc || Key Servers Key ID =3D D6132D50 Key fingerprint =3D 66ED 5211 9D59 DA53 1DF7 4189 DFED F580 D613 2D50 ----------------------------------- echo 16i[q]sa[ln0=3Daln100%Pln100/snlbx]sbA0D212153574F444E4957204553552045= 4D20454B414D204F54204847554F4E452059415020544F4E4E4143205345544147204C4C494= 2snlbxq | dc ----------------------------------- |