Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

6.a.

Chrooting
Optional: Selecting Mirrors
In order to download source code quickly it is recommended to select a fast mirror.
Portage will look in your make.conf file for the GENTOO_MIO! "aria#le and use
the mirrors listed therein. $ou can surf to our mirror list and search for a mirror %or
mirrors& close to you %as those are most frequently the fastest ones&' #ut we (ro"ide a
nice tool called mirrorselect which (ro"ides you with a nice interface to select the
mirrors you want. )ust na"igate to the mirrors of choice and (ress s(ace#ar to select one
or more mirrors.
Code Listing 1.1: Using mirrorselect for the GENTOOM!""O"S #aria$le
* mirrorselect +i +o ,, -mnt-gentoo-etc-(ortage-make.conf
. second im(ortant setting is the !$N/ setting in make.conf. This "aria#le contains the
rsync ser"er you want to use when u(dating your Portage tree %the collection of e#uilds'
scri(ts containing all the information Portage needs to download and install software&.
.lthough you can manually enter a !$N/ ser"er for yourself' mirrorselect can ease that
o(eration for you0
Code Listing 1.%: Selecting an rs&nc mirror 'sing mirrorselect
* mirrorselect +i +r +o ,, -mnt-gentoo-etc-(ortage-make.conf
.fter running mirrorselect it is ad"isea#le to dou#le+check the settings in
-mnt-gentoo-etc-(ortage-make.conf 1
Note0 If you want to manually set a !$N/ ser"er in make.conf' you should check out
the community mirrors list for the mirrors closest to you. 2e recommend choosing a
rotation' such as rsync.us.gentoo.org' rather than choosing a single mirror. This hel(s
s(read out the load and (ro"ides a failsafe in case a s(ecific mirror is offline.
/o(y 3N! Info
One thing still remains to #e done #efore we enter the new en"ironment and that is
co(ying o"er the 3N! information in -etc-resol".conf. $ou need to do this to ensure that
networking still works e"en after entering the new en"ironment. -etc-resol".conf
contains the nameser"ers for your network.
Code Listing 1.(: Cop& o#er )NS information
%The 4+54 o(tion is needed to make sure we don6t co(y a sym#olic link&
* c( +5 -etc-resol".conf -mnt-gentoo-etc-
Mounting the necessary 7ilesystems
In a few moments' we will change the 5inu8 root towards the new location. To make
sure that the new en"ironment works (ro(erly' we need to make certain file systems
a"aila#le there as well.
Mount the -(roc filesystem on -mnt-gentoo-(roc to allow the installation to use the
kernel+(ro"ided information within the chrooted en"ironment' and then mount+#ind
the -de" and -sys filesystems.
Code Listing 1.*: Mo'nting +proc and +de#
* mount +t (roc (roc -mnt-gentoo-(roc
* mount ++r#ind -sys -mnt-gentoo-sys
* mount ++r#ind -de" -mnt-gentoo-de"
Entering the new En"ironment
Now that all (artitions are initiali9ed and the #ase en"ironment installed' it is time to
enter our new installation en"ironment #y chrooting into it. This means that we change
from the current installation en"ironment %Installation /3 or other installation medium&
to your installation system %namely the initiali9ed (artitions&.
This chrooting is done in three ste(s. 7irst we will change the root from - %on the
installation medium& to -mnt-gentoo %on your (artitions& using chroot. Then we will
reload some settings' as (ro"ided #y -etc-(rofile' in memory using source. The last ste(
is to redefine the (rimary (rom(t to hel( us remem#er that we are inside a chroot
en"ironment.
Code Listing 1.,: Chrooting into the ne- en#ironment
* chroot -mnt-gentoo -#in-#ash
* source -etc-(rofile
* e8(ort P!:;4%chroot& <P!:4
/ongratulations1 $ou are now inside your own Gentoo 5inu8 en"ironment. Of course it
is far from finished' which is why the installation still has some sections left 0+&
If you at any time would need another terminal or console to access the chroot
en"ironment' all you need to do is to e8ecute the a#o"e ste(s again.
EO G=>0
>>Determining root device..
!! Block device /dev/sda3 is not a valid root device...
!! could not find the root block device in .
First. did you compile in-kernel support for the ext4 file system
If so try root=/dev/ram0 real_root=/dev/sda3 rootfstype=ext4
livecd usr # cd /
livecd / # mount -t proc proc /mnt/gentoo/proc
livecd / # mount --rbind /dev /mnt/gentoo/dev
livecd / # mount --rbind /sys /mnt/gentoo/sys
livecd / # cp -L /etc/resolv.conf /mnt/gentoo/etc/
livecd / # chroot /mnt/gentoo /bin/bash
livecd / # source /etc/profile
hen emerge -v sysvinit !hich provides the /sbin/init file.
"ep# tried emerging udev-init-scripts and adding a /dev line to fstab# no avail. ried changing from /dev/sda$ to the
%%I& in menu.lst# but an interesting tidbit is that it still uses '/dev/sda$' !hen 'determining root device' (even after
changing it in menu.lst and recreating the initramfs !ith --disklabel in genkernel# the boot se)uence says '&etected
real*root+/dev/sda$',.
I-m still .ust baffled that the boot se)uence says it-s using 'mount -t ext4 -o ro' and can-t mount /dev/sda$# yet !hen I
start the shell# /etc/mtab lists '/dev/sda$ /newroot ext4 ro / /'0 it-s mounted .ust fine.

You might also like