Difference between pages "Merge Funtoo 1.0 profile support into gentoo" and "Portage Profile Logic"

From Funtoo
(Difference between pages)
Jump to: navigation, search
(Overview/Steps)
 
 
Line 1: Line 1:
{{fancyimportant|This page is a work-in-progress proposal to merge the Funtoo profile system into Gentoo Linux.}}
+
== Gentoo Initialization ==
  
== Introduction ==
+
Gentoo profile initialization has been documented in [https://github.com/funtoo/portage-funtoo/commit/4c6826a0029c3c8f0aa92e70b4e50f2ffc58c7fa#diff-0 this GitHub commit], and describes how Gentoo's Portage finds and processes profiles. Basically, Gentoo's Portage looks for profiles using this algorithm:
  
This page is a proposal for integrating the Funtoo profile system into Gentoo Linux.
+
# Does <tt>/etc/make.profile</tt> exist? If so, it defines the primary profile.
 +
# If not, does <tt>/etc/portage/make.profile</tt> exist? If so, it defines the primary profile.
 +
# Recursively process the <tt>parent</tt> file found in the primary profile to build a list of all cascading profiles
 +
# if <tt>/etc/portage/profile</tt> exists, it is a user-defined profile - tack it to the end of our profile list so it can modify anything in the cascading profiles.
  
Authors:
+
Here is a more detailed description of the steps:
  
* [[User:Zerochaos]]
+
# Look for a profile directory/symlink at <tt>/etc/make.profile</tt>, if one exists, use this as the main profile directory.
* [[User:Drobbins]]
+
# If <tt>/etc/make.profile</tt> doesn't exist, use <tt>/etc/portage/make.profile</tt> as a back-up location if it exists.
* [[User:Oleg]]
+
# If neither location exists, then a main profile directory doesn't exist and is undefined (None)
  
== Requirements and Design Ideas ==
+
Using the main profile directory/symlink found above, the <tt>LocationsManager._addProfile()</tt> recursive function will be called that will create a list of all cascading profiles. This works by looking for a <tt>parent</tt> file in the profile directory. If this file exists, then each line is treated as a ''relative path'' and used to modify the path to the current profile, pointing to a "parent" profile that this particular profile modifies. There can be more than one parent, one per line. ''The first line in the <tt>parent</tt> file is the highest-priority parent.''
  
=== Eselect Profile Support ===
+
Once this list is created, the code checks to see if <tt>/etc/portage/profile</tt> directory exists. If it does, it is tacked at the end of the cascading profile list, meaning that it is evaluated last and this user-defined profile has the ability to modify any of the cascading profile settings. It provides an ideal hook point for a user-defined profile that can tweak anything the user wants to modify in the profile.
  
We want eselect-profile to support both the funtoo style profiles and the gentoo style profiles at the same time First thought, says if /etc/{,portage}/make.profile is a symlink, only show gentoo style profiles; this will hide the changes from unsuspecting users so they don't accidently set an experimental profile as gentoo tries to catch up.
+
[[Category:Portage]]
 
+
If /etc/{,portage}/make.profile is not a symlink, then show a list of old style profiles and new style profiles.
+
This may require funtoo to remove profiles.desc and profiles.eselect.desc from gentoo before replicating.
+
 
+
=== Catalyst Support ===
+
 
+
* seems trivial, support catalyst setting new style profiles.
+
* input requested from funtoo team on suggested syntax
+
 
+
=== Build Profiles in Gentoo ===
+
 
+
Build prototype profiles in gentoo for all possible x86/amd64 varients.
+
* mgorny has some good ideas here for multilib stuff
+
* blueness has some good ideas for hardened and alternative libc implementations
+
 
+
=== Piggy-Back System for Funtoo ===
+
 
+
Funtoo currently imports various settings from the existing Gentoo system profiles. The new Gentoo profile system should be designed to facilitate this "piggy-backing" to allow for maximum collaboration between Gentoo and Funtoo Linux.
+

Revision as of 03:56, 4 July 2014

Gentoo Initialization

Gentoo profile initialization has been documented in this GitHub commit, and describes how Gentoo's Portage finds and processes profiles. Basically, Gentoo's Portage looks for profiles using this algorithm:

  1. Does /etc/make.profile exist? If so, it defines the primary profile.
  2. If not, does /etc/portage/make.profile exist? If so, it defines the primary profile.
  3. Recursively process the parent file found in the primary profile to build a list of all cascading profiles
  4. if /etc/portage/profile exists, it is a user-defined profile - tack it to the end of our profile list so it can modify anything in the cascading profiles.

Here is a more detailed description of the steps:

  1. Look for a profile directory/symlink at /etc/make.profile, if one exists, use this as the main profile directory.
  2. If /etc/make.profile doesn't exist, use /etc/portage/make.profile as a back-up location if it exists.
  3. If neither location exists, then a main profile directory doesn't exist and is undefined (None)

Using the main profile directory/symlink found above, the LocationsManager._addProfile() recursive function will be called that will create a list of all cascading profiles. This works by looking for a parent file in the profile directory. If this file exists, then each line is treated as a relative path and used to modify the path to the current profile, pointing to a "parent" profile that this particular profile modifies. There can be more than one parent, one per line. The first line in the parent file is the highest-priority parent.

Once this list is created, the code checks to see if /etc/portage/profile directory exists. If it does, it is tacked at the end of the cascading profile list, meaning that it is evaluated last and this user-defined profile has the ability to modify any of the cascading profile settings. It provides an ideal hook point for a user-defined profile that can tweak anything the user wants to modify in the profile.