On Thu, Jul 24, 2008 at 11:01 PM, Alan Mackenzie <acm@muc.de> wrote:


I'm still very confused by profiles, though I obviously need to get to
grips with them.  What is a profile, _EXACTLY_?  Where in the
documentation can I find a description which says something like ".... a
profile is a directory which contains the following files" and then lists
them?  There are lots of instructions to "set foobar in your profile",
but the only description I've found so far just says "A profile is a
building block for any Gentoo system" in the Gentoo Linux x86 Handbook,
and then goes on to describe what a profile _does_ in abstract terms but
not what it _is_ in terms of directories and files.  That section says
that I "have" the option of choosing another profile too, but not how to
recognise a profile from a random directory or file.  I don't understand
how to select it.

A profile is a starting point for a gentoo install, and a set of defaults.
They are stored in  $PORTDIR/profiles in a sensible hierarchical structure
and contain information like default USE flags, the full collection of packages
that make up the system set etc etc. Profiles are obviously tweaked to suit
the average needs of categories of users, so there are desktop and server
profiles. They also cascade which is to say a profile inherits common stuff
from it's parent profile (which minimizes the admin hassle of adding the
 same new stuff to every profile in existence)

Setting a profile is a simply matter of creating  the symlink as you have done here:


I have a link

   /etc/make.profile -> /usr/portage/profiles/default/linux/x86/2008.0

, set up as suggested in the handbook.  Is .../2008.0 my profile?  

Yes, this means the profile you are using is the 2008.0 profile for x86
 
Is
this valid?  There doesn't appear to be anything of substance there.

If you navigate to the directory the symlink points to, you will find a bunch of files.
These define the profile, and the names and contents are by and large quite
self-explanatory

On the other hand the handbook says a few lines lowere, I should select a
profile with:

  # ln -snf /usr/portage/profiles/<profile name>   /etc/make.profile.

In that directory, /usr/portage/profiles, there are both subdirectories
(e.g. default-linux) and some files (e.g., make.defaults,
packages.builds).  Is "<profile name>" one of the directories rather than
a file?  It looks almost as though there's some sort of hierarchical
inheritance going on.

Correct. The profile is a directory name
 
Please tell me that this is clearly explained somewhere.

The handbook tells you all you need to know actually. Perhaps you are reading
more into the matter than is actually there.

As I said above, a profile is nothing more than the definition of a starting point
and a bunch of defaults that are applied if you don't explicitly state what you want.
When you installed gentoo, you might have run 'emerge -e system' which would
have built a whole bunch of stuff (toolchain, coreutils, etc, etc) with a bunch of
USE flags already enabled. That info came out of the profile. When you edit make.conf
to better suit YOUR needs, that edit overrides the profile. You hardly ever need to
change your profile unless it is many years old and has been removed from portage.
The longer you use gentoo, the more specific your system becomes to what you want,
and the further away it moves from the default.

What you do do, is edit make.conf and the various files in /etc/portage/* to get what you want.
Don't go editing the profile directories, your changes simply get nuked with the next
'emerge --sync'. Only edit the user files, which are documented in 'man 5 portage'

In four years of using gentoo I have had to mess around with profiles exactly once.
I was building a highly customized install that is quite radically different from the norm,
so I created a custom profile inherited from the one that was closest to what I wanted,
stored it somewhere out of the way and pointed portage to it. In all other cases I just used
what was there. I couldn;t even tell you right now what profile my home machine is using :-)

Hope this help clear up the situation for you.

--
Alan McKinnon
alan.mckinnon@gmail.com