The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "Install/Chroot/en"
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 20: | Line 20: | ||
# ##i##cp /etc/resolv.conf /mnt/funtoo/etc/ | # ##i##cp /etc/resolv.conf /mnt/funtoo/etc/ | ||
}} | }} | ||
Now you can chroot into your new system | Now you can chroot into your new system as follows: | ||
{{console|body=###i## chroot . /bin/su --login | {{console|body=###i## chroot . /bin/su --login | ||
%chroot% }} | %chroot% }} | ||
This chroot command | This special chroot command executes {{c|/bin/su --login}} inside the new environment. According to the {{c|su}} man page, {{c|su}} with the {{c|--login}} option provides "an environment similar to what the user would expect had the user logged in directly." That is what we want, as it will prevent any existing environment variables on the LiveCD from being set inside the chroot. | ||
{{Note|For users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use {{c|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.}} | {{Note|For users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use {{c|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.}} |
Revision as of 04:08, December 14, 2021
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.
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 root # mount --rbind /proc proc root # mount --rbind /sys sys root # mount --rbind /dev dev
You'll also want to copy over resolv.conf
in order to have proper resolution of Internet hostnames from inside the chroot:
root # cp /etc/resolv.conf /mnt/funtoo/etc/
Now you can chroot into your new system as follows:
root # chroot . /bin/su --login chroot #
This special chroot command executes /bin/su --login
inside the new environment. According to the su
man page, su
with the --login
option provides "an environment similar to what the user would expect had the user logged in directly." That is what we want, as it will prevent any existing environment variables on the LiveCD from being set inside the chroot.
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.
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 your live CD.
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:
chroot # export PS1="(chroot) $PS1"
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 > |