Fix
First of all, never transplant/copy/link etc a live tool to the stage3 working area. As such, lets start over. First, I'm assuming /dev/sda3
is a blank partition. If not:
- Create
/dev/sda3
using a tool like GParted.
- If you've already done Step 1, issue:
mke2fs -j /dev/sda3
mkdir /mnt/gentoo && mount /dev/sda3 /mnt/gentoo
- cd
/mnt/gentoo
wget http://distfiles.gentoo.org/releases/amd64/autobuilds/20150604/stage3-amd64-20150604.tar.bz2 -P /mnt/gentoo
(Assuming amd64 arch.)
tar xvjpf stage3-*.tar.bz2 --xattrs
- Continue in Stage - Section 2
Reasoning
The Stage 3 Tarball will contain a working Bash when unzipped. The following commands, in Section 1.4 of Installing the Gentoo base system:
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
will enter a clean change root for building/installing.
Following the handbook assumes you want Gentoo as another live system. In your case, the only thing you should ignore is the GRUB configuration section, because Fedora contains a working Grub. As such, the boot option for Gentoo should be added to Fedora's Grub options.
Update
As per comment, each linux distribution contains a profile
file. It's stored in different places depending on the distribution. In Gentoo's case it's stored in the /etc
directory because in Gentoo, every configuration file is meant to be customized. Quoting the Beyond Linux From Scratch Handbook:
The shell program /bin/bash (hereafter referred to as just "the
shell") uses a collection of startup files to help create an
environment. Each file has a specific use and may affect login and
interactive environments differently. The files in the /etc directory
generally provide global settings. If an equivalent file exists in
your home directory it may override the global settings.
In this way, line 2, the source
command, separates the environment of the build system (in your case Fedora) from the environment contained in the unzipped tarball that you entered with the chroot
command. This ensures that no outside build tools, i.e. bash
, configure
, make
will be able to "pollute" the build process (See my comment above). In other words: The configure, make and gcc compiler used to build the system will be those inside the chroot.
As for Line 3, exporting $PS1
prints (chroot) root@host #/
This is so people following the Handbook who like to flip thru TTY's or graphical consoles, to read all the documentation can tell where the chroot they are creating/updating is...
/dev/sda3
an empty partition? – eyoung100 Jun 08 '15 at 17:34ldd /bin/bash
– Jeff Schaller Jun 08 '15 at 17:52/dev/sda3
. If you were to reboot into Gentoo, after completing the handbook, your bash wouldn't function, unless you mounted Fedora – eyoung100 Jun 08 '15 at 20:38