It appears that make.conf is loaded from an absolute path, there is no configuration setting to override it, and it does not honor ROOT. Reproducible: Always Steps to Reproduce: 1.emerge ingo 1.export ROOT="/mnt/target" 2.nano -w $ROOT/etc/make.conf 3.emerge info Actual Results: "Rooted" config file has no effect. Expected Results: When using ROOT with emerge I expected emerge to use $ROOT/etc/make.conf, but it uses /etc/make.conf. This is particularily troublesome with the embedded development and/or cross-compiling. After a brief discussion on #gentoo-embedded, we thought it would be verra naice if make.conf et. al. loaded relative to ROOT by default, and could be overridden with another setting, such as PORTAGE_CONFIG. Gentoo Base System version 1.4.3.8p1 Portage 2.0.49-r21 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r1, 2.4.20-gentoo-r6) ================================================================= System uname: 2.4.20-gentoo-r6 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-Os -march=pentium3 -mmmx -msse -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-Os -march=pentium3 -mmmx -msse -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/mnt/lms/root/SW Development/Embedded Systems/Gentoo/packages.p3" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gnome gpm gtk gtk2 imlib jpeg kde libg++ libwww mad mikmod motif mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcpd truetype x86 xml2 xmms xv zlib"
*** Bug 36652 has been marked as a duplicate of this bug. ***
Created attachment 25226 [details, diff] patch to allow different config files than /etc/make.conf Ok, this patch adds the following logic: 1. check for a PORTAGE_CONFIGFILE environment variable, if present use that file instead of make.conf 2. check if we have a ROOT env variable that is not "/", if so use $ROOT+/make.conf as configfile 3. if 1) and 2) don't apply use /etc/make.conf Anything more that's needed ?
For 2, shouldn't it be $ROOT/etc/make.conf?
Yep, it's right in the code, just wrong in the description ;)
IMO, emerge should use /etc/make.conf even if ROOT is set. Because ROOT is not chroot..
And I agree with Nakano.
I agree with the logic of the patch. If you're cross compiling and merging to a $ROOT to create a embedded image, the arch, chost, cflags, use flags, etc. will most likely be different. Otherwise, it becomes problematic overriding all of the host machine's settings everytime you do some merging. When you merge to $ROOT, the /var/db/pkg entries go to $ROOT/var/db/pkg already, so it seems logical that a $ROOT/etc/make.conf be used if it exists.
Chris is right. I've almost gone crazy when trying to compile for arm and it failed with some weird error which I found (after hours) was caused by improper CFLAGS (-march=pentium3)... I've heard some rumours about CONFIG_ROOT var which would drive this but I cannot find it in bugzilla now... :-(
(In reply to comment #7) > When you merge to $ROOT, the /var/db/pkg entries go to $ROOT/var/db/pkg already, so it seems logical that a $ROOT/etc/make.conf be used if it exists. Add /etc/make.profile and /etc/portage/** to the list. It seems that /var/cache/edb and /var/lib/portage already work properly. Regardless of portage support, proper $ROOT support (especially for including/linking of libraries) seems to be lacking in many ebuilds and/or upstream build systems.
VDB, though is not working correctly. I've filed a bug 129054 about this.
Config files will likely be controlled by a separate variable so that they can be stored at a location separate from $ROOT if desired. See bug 73350.
*** This bug has been marked as a duplicate of 73350 ***