Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 40302

Summary: ROOT configuration file support
Product: Portage Development Reporter: Shannon Glenn Barber <shannon.barber>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED DUPLICATE    
Severity: minor CC: eldad, foxtrott, radek, sascha-gentoo-bugzilla
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to allow different config files than /etc/make.conf

Description Shannon Glenn Barber 2004-02-03 10:58:22 UTC
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"
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2004-02-04 18:48:43 UTC
*** Bug 36652 has been marked as a duplicate of this bug. ***
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2004-02-08 17:29:00 UTC
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 ?
Comment 3 Shannon Glenn Barber 2004-02-10 06:26:51 UTC
For 2, shouldn't it be $ROOT/etc/make.conf?
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2004-02-10 10:09:13 UTC
Yep, it's right in the code, just wrong in the description ;)
Comment 5 Masatomo Nakano (RETIRED) gentoo-dev 2004-02-10 17:24:28 UTC
IMO, emerge should use /etc/make.conf even if ROOT is set.
Because ROOT is not chroot..
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2004-02-27 10:52:04 UTC
And I agree with Nakano.
Comment 7 Chris PeBenito (RETIRED) gentoo-dev 2004-02-27 16:53:19 UTC
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.
Comment 8 Radek Podgorny 2005-10-13 04:56:33 UTC
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... :-(
Comment 9 Zac Medico gentoo-dev 2005-11-27 15:56:05 UTC
(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.
Comment 10 Eldad Zack (RETIRED) gentoo-dev 2006-04-09 07:30:00 UTC
VDB, though is not working correctly. I've filed a bug 129054 about this.
Comment 11 Zac Medico gentoo-dev 2006-04-26 13:43:27 UTC
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.
Comment 12 Zac Medico gentoo-dev 2006-05-01 02:42:05 UTC

*** This bug has been marked as a duplicate of 73350 ***