paulj wrote:I wonder whether you could approach this from a slightly different direction. Please see my post here:
https://forums.gentoo.org/viewtopic-t-1169109.html, and the subsequent thread. Maybe you can use this approach to define your system specifications?
Unfortunately not, I am using a semi-custom profile to begin with, my problems stem from how portage previews and defines the ROOT EROOT BROOT and SYSROOT environment variables.
You see from my experience (and please correct me if I am wrong) setting this flags on different directories will either lead portage to ignore the defined variable and use the default or won't work correctly.
Example:
I need CONFIG_ROOT and BROOT to point to a directory different from root to keep the system minimal
ROOT=/mnt/system2
BROOT=/system2
CONFIG_ROOT=/system2
This (kinda) works but when I run emerge --config-root=/system2 then portage doesn't distinguish between / and /mnt/system2
Otherwise i can set SYSROOT=/system2 as well as the environment variables listed above in which case packages for ROOT will be postfixed with " to /mnt/system2 " during emerge -vp
BUT packages for sysroot will NOT be postfixed with a path, neither packages for the live system where emerge is running for(/) so I end up mixing them up and having to guesswork if I need to update /etc/portage/package.use or /system2/etc/portage/package.use
Now keep in mind I cannot avoid updating the live system(/) when I am updating system2, now imagine when the live system has to update 20+ of these systems, the live system just breaks no doubt about it
A half broken solution is creating a chroot for each child system
Then chroot in there and do
ROOT=/mnt
SYSROOT=/
CONFIG_ROOT=/
BROOT=/
In which case I know the live system won't be affected neither will the use flags of each system affect each other because each system had its own chroot-updater(remember if I didn't use chroot I sometimes would have to update the live systems useflags, which for bdeps packages means that one system would affect each other unconditionally
You might think I have arrived at my solution but I assure you I have not.
A halfbroken solution the chroot way PLUS overlayfs from (livesystem)/etc/portage to (chroot)/etc/portage so I can share use flags between packages conditionally, which cuts emerge times when using a pkgdir
There is always a BUY tho, I cannot put my finger on to why but my experience using and abusing portage badly for years gives me this tingly feeling that some breakages that happen are because of that of how portage handles things
Keep in mind I am trying for over a year now and playing with different ROOT BROOT EROOT CONFIG_ROOT and SYSROOT flags
I even thought of making my own emerge command but with all honesty portage's codebase is a headache to crack and I pay huge respect to contributors, been pondering to swap it with pkgcore or paludis about a month but I just fear for future robustness
I'm thinking of pulling a list of all BDEPS from all my systems and sort it out so I can create a global bdep useflag file to cut down emerge times
Don't know if I have explained it correctly but /mnt/system2 is a detachable standalone system, it should have only rdeps and the @world+@system (in any case @selected) installed into it, system2 could be a rescueusb, a headless server, a router or even a gaming system. I am thinking of using NFS for my local network and having local machines use that, the central compiling system that I am building just has to act as the builder and upkeeper of said systems.
If you have any insight or my use case please do tell me
Cheers
Coalms