From: Alex de L. <al...@de...> - 2007-03-10 17:26:04
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Nextime, (sorry for the delay until posting, mailman complained about your message's subjectline) The reason for the '--after 0' parameter was because minimod unionfs branches are read-only. By forcing precedence of the mainmod branch the whole filesystem remains read/writable. Note that I haven't thoroughly tested this, so I might be wrong. Naturally a minimodule would ideally 'overwrite' mainmodule files, not doing so is needlessly confusing, but afaik it isn't possible without also blanking out the rw-layer. Having an option to set the minimod layer position seems reasonable. Doing so would mean an un-writable filesystem if the above is correct, but it would at least allow flexibility in this department. Re-reading your post, I think that if we changed '--after 0' to '--after 1', the result would allow minimod precedence over the mainmod, and still the filesystem would be writable. Do you think this is correct? cheers & thanks for looking into this, Alex ne...@ne... wrote: > 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=/mnt/main${UNIONFS_MOUNT_OPT},debug=$DEBUGOVERLAY 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="--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 > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > Morphix-devel mailing list > Mor...@li... > https://lists.sourceforge.net/lists/listinfo/morphix-devel -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF8uoRQeuQA5TF/UsRAowDAJ9lHKjB7TO2qECjgBZMLz/uQlpkXACfRouI tV9b5T9HQb09dvonfGaFeGE= =WHhz -----END PGP SIGNATURE----- |