Difference between pages "Creating Profiles" and "Install/Stage3"

(Difference between pages)
 
(Installing the Stage 3 tarball)
 
Line 1: Line 1:
Want to create your own custom profiles? Thought up a mix-in that's not currently in the Funtoo profiles? Have an overlay with profiles and want to make it easy for people to use them? Well you've come to the right place. This article will show you how to easily add you own profiles. No more ugly hacking of parent files and other nonsense. Once you follow this guide, not only will portage easily recognize your profiles, they will also show up in eselect right along with the ones from the main tree.
+
<noinclude>
 +
{{InstallPart|the process of installing the Stage3 tarball}}
 +
</noinclude>
 +
==== Setting the Date ====
  
== Rules to follow ==
+
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date. However, if you system time is relatively close to correct, you can probably skip this step for now.}}
* What your system need:
+
** The version of [[Package:Eselect|eselect]] that supports Funtoo profiles (already integrated into Funtoo Linux)
+
* What your overlay need:
+
** Directory <code><overlay_name>/profiles</code>: store your profiles in it.
+
** File <code><overlay_name>/profiles/repo_name</code>: store the name of your overlay
+
** File <code><overlay_name>/profiles/profiles.eselect.desc</code>: see <code>profiles.eselect.example</code> in your Funtoo portage tree for instruction.
+
** If you're creating profiles of types arch, build, flavor, or mix-ins, your profile must be inside a directory with same name, such as <code><overlay_name>/profiles/<profile_name>/flavor/<flavor_name></code>, <code><overlay_name>/profiles/<profile_name>/mix-ins/<mix-ins_name></code>
+
  
{{note |Currently, <tt>NoMix</tt> (see <code>profiles.eselect.example</code> in the Funtoo portage tree) is only supported for profiles in the same tree.}}
+
Now is a good time to verify the date and time are correctly set to UTC. Use the <code>date</code> command to verify the date and time:
  
Also:
 
 
{{note | If you are not using a standard Funtoo portage tree, you must ensure that your main portage tree has <pre> profile-formats = portage-2 </pre> set in <code>metadata/layout.conf</code> in order for portage to interpret the <code><repo_name>:<profile></code> syntax.}}
 
 
==An Example==
 
* For our example, we will create a local overlay called <b>fake_overlay</b>. Then, create a profile called <b>fake_profile</b>. Finally, create a 'mix-ins' profile called <b>fake_mix-ins</b>:
 
** Set the <code>dummy</code> USE flag globally for <b>fake_mix-ins</b>
 
** Set the <code>yummy</code> USE flag on <code>sys-apps/not-exist</code> for <b>fake_mix-ins</b>
 
 
We will then add this profile to [[Package:Eselect|eselect]] so it's visible when running:
 
 
<console>
 
<console>
###i## eselect profile
+
# ##i##date
 +
Fri Jul 15 19:47:18 UTC 2011
 
</console>
 
</console>
  
=== Creating the profile ===
+
If the date and/or time need to be corrected, do so using <code>date MMDDhhmmYYYY</code>, keeping in mind <code>hhmm</code> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:
==== Step 1 ====
+
We will use <code>${FAKE_OVERLAY}</code>as the path to <b>fake_overlay</b>.These instructions assume the overlay exists.
+
If you haven't set a name for your overlay, do that first:
+
<console>
+
###i## echo "fake_overlay" > ${FAKE_OVERLAY}/profiles/repo_name
+
</console>
+
  
==== Step 2 ====
 
Next lets create a directory to store our profile. Since we're creating a 'mix-ins' profile, we need to make sure our profile is inside a 'mix-ins' subdirectory. This is a requirement in order to ensure that the profile will show up in eselect. If your not planning on using [[Package:Eselect|eselect]] then there's no requirement to use 'mix-ins'
 
 
<console>
 
<console>
###i## install -d ${FAKE_OVERLAY}/profiles/fake_profile/mix-ins/fake_pro
+
# ##i##date 071620002011
 +
Fri Jul 16 20:00:00 UTC 2011
 
</console>
 
</console>
  
Now that we have a directory for our profile, lets go ahead and add our settings. Global USE settings go in <code>make.defaults</code>, package specific USE settings go in <code>package.use</code>:
+
Once you have set the system clock, it's a very good idea to copy the time to the hardware clock, so it persists across reboots:
  
 
<console>
 
<console>
###i## cd ${FAKE_OVERLAY}/profiles/fake_profile/mix-ins/fake_pro
+
# ##i##hwclock --systohc
###i## echo 'USE="$USE dummy"' >> make.defaults
+
###i## echo 'sys-apps/not-exist yummy' >> package.use
+
 
</console>
 
</console>
  
{{note | No matter if your using funtoo or gentoo, profile settings all work the same. For more information please check the portage man page.}}
+
=== Installing the Stage 3 tarball ===
  
=== Adding to eselect ===
+
Now that filesystems are created and your hardware and system clock are set, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux.  
[[Package:Eselect|eselect]] reads from the file <code>profiles.eselect.desc</code> in your profiles directory.  
+
  
Format is:
+
To download the correct build of Funtoo Linux for your system, head over to the [[Subarches]] page. Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They also take advantage of the instruction sets available for each CPU.
<pre>
+
Type Name Status NoMix
+
</pre>
+
  
{{note | For more information about this Format, Please look in <code>/usr/portage/profiles/profiles.eselect.example</code>}}
+
The [[Subarches]] page lists all CPU-optimized versions of Funtoo Linux. Find the one that is appropriate for the type of CPU that your system has, and then click on its name in the first column (such as <code>corei7</code>, for example.) You will then go to a page dedicated to that subarch, and the available stage3's available for download will be listed.
  
<console>
+
For most subarches, you will have several stage3's available to choose from. This next section will help you understand which one to pick.
###i## echo 'mix-ins fake_profile/mix-ins/fake_pro testing' >> ${FAKE_OVERLAY}/profiles/profiles.eselect.desc
+
 
 +
==== Which Build? ====
 +
 
 +
'''If you're not sure, pick <code>funtoo-current</code>.'''
 +
 
 +
Funtoo Linux has various different 'builds':
 +
 
 +
{{TableStart}}
 +
<tr><th class="info">Build</th><th class="info">Description</th></tr>
 +
<tr><td><code>funtoo-current</code></td><td>The most commonly-selected build of Funtoo Linux. Receives rapid updates and preferred by desktop users.</td></tr>
 +
<tr><td><code>funtoo-stable</code></td><td>Emphasizes less-frequent package updates and trusted, reliable versions of packages over the latest versions.</td></tr>
 +
{{TableEnd}}
 +
 
 +
If you want to read more about this, have a look at [[Funtoo_Linux#What_are_the_differences_between_.27stable.27.2C_.27current.27_and_.27experimental.27_.3F|Differences between stable, current and experimental]].
 +
 
 +
==== Which Variant? ====
 +
 
 +
'''If you're not sure, pick <code>(None)</code>.'''
 +
 
 +
Besides our "regular" stage3's (listed with a variant of <code>(None)</code>, the following variant builds are available:
 +
 
 +
{{TableStart}}
 +
<tr><th class="info">Variant</th><th class="info">Description</th></tr>
 +
<tr><td>(None)</td><td>The "standard" version of Funtoo Linux</td></tr>
 +
<tr><td><code>pure64</code></td><td>A 64-bit build that drops multilib (32-bit compatibility) support. Can be ideal for server systems.</td></tr>
 +
<tr><td><code>hardened</code></td><td>Includes PIE/SSP toolchain for enhanced security. PIE does require the use of PaX in the kernel, while SSP works with any kernel, and provides enhanced security in user-space to avoid stack-based exploits.</td></tr>
 +
{{TableEnd}}
 +
 
 +
==== Download the Stage3 ====
 +
 
 +
Once you have found the stage3 that you would like to download, use <code>wget</code> to download the Stage 3 tarball you have chosen to use as the basis for your new Funtoo Linux system. It should be saved to the <code>/mnt/funtoo</code> directory as follows:
 +
 
 +
<console># ##i##cd /mnt/funtoo
 +
# ##i##wget http://build.funtoo.org/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz
 
</console>
 
</console>
  
Watch the result:
+
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <code>generic_64</code> or <code>generic_32</code> stage. Consult the [[Subarches]] page for more information.
 +
 
 +
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:
 
<console>
 
<console>
###i## eselect profile list
+
# ##i##tar xpf stage3-latest.tar.xz
 
</console>
 
</console>
  
[[Category:Portage]]
+
{{important|It is very important to use <code>tar's</code> "<code>'''p'''</code>" option when extracting the Stage 3 tarball - it tells <code>tar</code> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}
[[Category:Labs]]
+
[[Category:HOWTO]]
+

Revision as of 07:01, December 29, 2014


Note

This is a template that is used as part of the Installation instructions which covers: the process of installing the Stage3 tarball. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.


Setting the Date

Important

If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date. However, if you system time is relatively close to correct, you can probably skip this step for now.

Now is a good time to verify the date and time are correctly set to UTC. Use the date command to verify the date and time:

# date
Fri Jul 15 19:47:18 UTC 2011

If the date and/or time need to be corrected, do so using date MMDDhhmmYYYY, keeping in mind hhmm are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:

# date 071620002011
Fri Jul 16 20:00:00 UTC 2011

Once you have set the system clock, it's a very good idea to copy the time to the hardware clock, so it persists across reboots:

# hwclock --systohc

Installing the Stage 3 tarball

Now that filesystems are created and your hardware and system clock are set, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux.

To download the correct build of Funtoo Linux for your system, head over to the Subarches page. Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They also take advantage of the instruction sets available for each CPU.

The Subarches page lists all CPU-optimized versions of Funtoo Linux. Find the one that is appropriate for the type of CPU that your system has, and then click on its name in the first column (such as corei7, for example.) You will then go to a page dedicated to that subarch, and the available stage3's available for download will be listed.

For most subarches, you will have several stage3's available to choose from. This next section will help you understand which one to pick.

Which Build?

If you're not sure, pick funtoo-current.

Funtoo Linux has various different 'builds':

BuildDescription
funtoo-currentThe most commonly-selected build of Funtoo Linux. Receives rapid updates and preferred by desktop users.
funtoo-stableEmphasizes less-frequent package updates and trusted, reliable versions of packages over the latest versions.

If you want to read more about this, have a look at Differences between stable, current and experimental.

Which Variant?

If you're not sure, pick (None).

Besides our "regular" stage3's (listed with a variant of (None), the following variant builds are available:

VariantDescription
(None)The "standard" version of Funtoo Linux
pure64A 64-bit build that drops multilib (32-bit compatibility) support. Can be ideal for server systems.
hardenedIncludes PIE/SSP toolchain for enhanced security. PIE does require the use of PaX in the kernel, while SSP works with any kernel, and provides enhanced security in user-space to avoid stack-based exploits.

Download the Stage3

Once you have found the stage3 that you would like to download, use wget to download the Stage 3 tarball you have chosen to use as the basis for your new Funtoo Linux system. It should be saved to the /mnt/funtoo directory as follows:

# cd /mnt/funtoo
# wget http://build.funtoo.org/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz

Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the generic_64 or generic_32 stage. Consult the Subarches page for more information.

Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:

# tar xpf stage3-latest.tar.xz
Important

It is very important to use tar's "p" option when extracting the Stage 3 tarball - it tells tar to preserve any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.