Difference between revisions of "Install/Chroot"

From Funtoo
Jump to navigation Jump to search
m (fix chroot prompts exactly mirroring behavior that goes on with the prompt, and then forcing ps1 reassignment upon users.)
(add setting password here because its easy to forget to do it with the command being way at the end of the install.)
Line 33: Line 33:
###i## echo "nameserver 1.1.1.1" > /mnt/funtoo/etc/resolv.conf
###i## echo "nameserver 1.1.1.1" > /mnt/funtoo/etc/resolv.conf
}}
}}
Now you can chroot into your new system. Use <code>env</code> before <code>chroot</code> to ensure that no environment settings from the installation media are pulled in to your new system:
Now you can chroot into your new system. Use <code>env</code> before <code>chroot</code> to ensure that no environment settings from the installation media are pulled in to your new system, and set your password before you forget about needing to log in:


<!--T:10-->
<!--T:10-->
Line 40: Line 40:
/ #
/ #
/ ###i##export PS1="FUNTOO $PS1"
/ ###i##export PS1="FUNTOO $PS1"
%chroot% }}
%chroot%
%chroot% ##i## passwd}}


<!--T:11-->
<!--T:11-->

Revision as of 14:01, December 7, 2020

Other languages:
English • ‎Türkçe • ‎español • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎

Install Guide: Chroot into Funtoo

Install Guide, Chapter 9 < Prev Next >

To install Funtoo Linux, the chroot command is first used. The chroot command will "switch into" the new Funtoo Linux system, so the commands you execute after running "chroot" will run within your newly-extracted Funtoo Linux system.

  • if you would like to compile in ram, expand your run tmpfs to be half of your ram:
root # mount -t tmpfs tmpfs /run

Before chrooting, there are a few things that need to be done to set up the chroot environment. You will need to mount /proc, /sys and /dev inside your new system. Use the following commands to do so:

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

You'll also want to copy over resolv.conf or insert cloudflares DNS in order to have proper resolution of Internet hostnames from inside the chroot:

root # cp /etc/resolv.conf /mnt/funtoo/etc/
or
root # echo "nameserver 1.1.1.1" > /mnt/funtoo/etc/resolv.conf

Now you can chroot into your new system. Use env before chroot to ensure that no environment settings from the installation media are pulled in to your new system, and set your password before you forget about needing to log in:

/mnt/funtoo # env -i HOME=/root TERM=$TERM /bin/chroot /mnt/funtoo bash -l
/ #
/ #export PS1="FUNTOO $PS1"
chroot #
chroot #  passwd
   Note

For 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 to 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 most likely because you are running a 32-bit kernel and trying to execute 64-bit code. Make sure that you have selected the proper type of kernel when booting SystemRescueCD.

Test internet name resolution from within the chroot:

chroot # ping -c 5 google.com

If you can't ping, make sure that /etc/resolv.conf specifies a valid IP address for a reachable nameserver in its nameserver setting.

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 start successfully, without any manual assistance, when your system is restarted.

Install Guide, Chapter 9 < Prev Next >