Difference between pages "Install/Stage3" and "Install/Chroot"

(Difference between pages)
(Setting the Date)
 
(Chroot into Funtoo)
 
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{InstallPart|the process of installing the Stage3 tarball}}
+
{{InstallPart|the chroot process}}
 
</noinclude>
 
</noinclude>
=== Installing the Stage 3 tarball ===
+
=== Chroot into Funtoo ===
 
+
Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:
After creating filesystems, 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. Load one of the following URLs in another browser window:
+
 
+
{{MirrorList}}
+
 
+
Now, let's navigate the directories on the mirrors to find the appropriate build of Funtoo Linux for you.
+
 
+
==== Which Build? ====
+
 
+
'''If you're not sure, pick <code>funtoo-current</code>.'''
+
 
+
Funtoo Linux has various different 'builds', or variants. Here is a list of the various builds that are available, and what their distinctive features are:
+
 
+
{{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-current-hardened</code></td><td>Same package set as <code>funtoo-current</code>, but with a hardened, exploit-resistant toolchain.</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]].
+
 
+
==== What Architecture?  ====
+
 
+
'''If you're not sure, pick <code>x86-64bit</code>, or possibly <code>pure64</code> for server systems.'''
+
 
+
For PC-compatible systems, the following choices are available:
+
 
+
{{TableStart}}
+
<tr><th class="info">Architecture</th><th class="info">Description</th></tr>
+
<tr><td><code>x86-64bit</code></td><td>For modern 64-bit processors. Uses new 64-bit instructions and address space. Maintains 32-bit compatibility with multilib.</td></tr>
+
<tr><td><code>pure64</code></td><td>For modern 64-bit processors but with no support for 32-bit compatibility.</td></tr>
+
<tr><td><code>x86-32bit</code></td><td>For older 32-bit systems such as Athlon XP, Pentium 4, or earlier Atom.</td></tr>
+
{{TableEnd}}
+
 
+
==== Your SubArch ====
+
 
+
Inside <code>/funtoo-current/x86-64bit/</code> on one of our mirrors, you'll see a bunch of directories for various ''subarches'' of Funtoo Linux. 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.
+
 
+
If you are using an AMD-based CPU, download a stage3 from <code>generic_64</code>, <code>amd64-k8</code>, <code>amd64-k10</code>, <code>amd64-bulldozer</code>, <code>amd64-piledriver</code>, <code>amd64-steamroller</code> or <code>amd64-jaguar</code>.  See [[Subarches]] for help figuring out what AMD subarch is best for you.
+
 
+
If you are using an Intel-based CPU, download a stage3 from <code>generic_64</code>, <code>atom_64</code>, <code>core2_64</code> or <code>corei7</code>. Note that <code>corei7</code> is ideal for any modern Intel processor, including Core i3 and Core i5, and many Xeons.
+
 
+
If you are using a 32-bit CPU, download a stage3 from <code>generic_32</code>, <code>i686</code>, <code>core2_32</code>, <code>atom_32</code> or <code>athlon-xp</code>.
+
 
+
==== Setting the Date ====
+
 
+
{{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.}}
+
 
+
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:
+
 
+
 
<console>
 
<console>
# ##i##date
+
# ##i##cd /mnt/funtoo
Fri Jul 15 19:47:18 UTC 2011
+
# ##i##mount -t proc none proc
 +
# ##i##mount --rbind /sys sys
 +
# ##i##mount --rbind /dev dev
 
</console>
 
</console>
  
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:
+
<noinclude>
 +
{{Note|This is a template that is used as part of the Installation instructions, to describe the process of chrooting into the stage3. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.}}
 +
</noinclude>
  
 +
You'll also want to copy over <code>resolv.conf</code> in order to have proper DNS name resolution from inside the chroot:
 
<console>
 
<console>
# ##i##date 071620002011
+
# ##i##cp /etc/resolv.conf etc
Fri Jul 16 20:00:00 UTC 2011
+
 
</console>
 
</console>
  
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:
+
Now you can chroot into your new system. Use <code>env</code> before <code>chroot</code> to ensure that no environment variables from the installation media are used by your new system:
  
 
<console>
 
<console>
# ##i##hwclock --systohc
+
# ##i##env -i HOME=/root TERM=$TERM chroot . bash -l
</console>
+
 
+
==== Download the Stage3 ====
+
Once you are in your Funtoo Linux root filesystem, 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://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz
+
 
</console>
 
</console>
  
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 [[Download]] page for more information.
+
{{fancynote|Users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use <code>uname -r</code> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}
 +
{{fancyimportant|If you receive the error "<code>chroot: failed to run command `/bin/bash': Exec format error</code>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}
  
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:
+
It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:
 
<console>
 
<console>
# ##i##tar xpf stage3-latest.tar.xz
+
# ##i##export PS1="(chroot) $PS1"
 
</console>
 
</console>
  
{{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.}}
+
Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.

Latest revision as of 23:43, November 19, 2014


Note

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


Chroot into Funtoo

Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:

# cd /mnt/funtoo
# mount -t proc none proc
# mount --rbind /sys sys
# mount --rbind /dev dev


Note

This is a template that is used as part of the Installation instructions, to describe the process of chrooting into the stage3. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.


You'll also want to copy over resolv.conf in order to have proper DNS name resolution from inside the chroot:

# cp /etc/resolv.conf etc

Now you can chroot into your new system. Use env before chroot to ensure that no environment variables from the installation media are used by your new system:

# env -i HOME=/root TERM=$TERM chroot . bash -l

Note

Users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use uname -r to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.

Important

If you receive the error "chroot: failed to run command `/bin/bash': Exec format error", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.

It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:

# export PS1="(chroot) $PS1"

Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.