⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chroot.html

📁 lfs3.1 从源代码构建linux。html版本。
💻 HTML
字号:
<HTML><HEAD><TITLE>Entering the chroot'ed environment</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Installing basic system software"HREF="../chapter06/chapter06.html"><LINKREL="PREVIOUS"TITLE="Creating $LFS/root/.bash_profile"HREF="../chapter06/bashprofile.html"><LINKREL="NEXT"TITLE="Installing Glibc-2.2.4"HREF="../chapter06/glibc.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter06/bashprofile.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 6. Installing basic system software</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter06/glibc.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch06-chroot">6.4. Entering the chroot'ed environment</A></H1><P>It's time to enter our chroot'ed environment in order to install therest of the software we need.</P><P>Enter the following commands to enter the chroot'ed environment. Fromthis point on there's no need to use the $LFS variable anymore, becauseeverything a user does will be restricted to the LFS partition (since / isactually /mnt/lfs but the shell doesn't know that).</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>cd $LFS &#38;&#38;chroot $LFS /usr/bin/env -i HOME=/root \牋燭ERM=$TERM /bin/bash --login</B></TT>&#13;</PRE></FONT></TD></TR></TABLE></P><P>The -i option will clear all environment variables for as long as youare in the chroot'ed environment and only the HOME and TERM variablesare set. The TERM=$TERM construction will set the TERM variable insidechroot to the same value as outside chroot which is needed for programslike vim and less to operate properly. If you need other variablespresent, such as CFLAGS or CXXFLAGS, you need to set them again.</P><P>Now that we are inside a chroot'ed environment, we can continue toinstall all the basic system software. You have to make sure all thefollowing commands in this and following chapters are run from within the chroot'ed environment. If you ever leave this environment for any reason(when rebooting for example) please remember to mount $LFS/proc again and re-enter chroot before continuing with thebook.</P><P>Note that the bash prompt will contain "I have no name!" This isnormal because Glibc hasn't been installed yet.</P><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1726">6.4.1. Dependencies</A></H2><P>Chroot needs the following to be installed:</P><PCLASS="literallayout"><br>bash&nbsp;from&nbsp;the&nbsp;bash&nbsp;package<br><br>env&nbsp;from&nbsp;the&nbsp;sh-utils&nbsp;package<br></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter06/bashprofile.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter06/glibc.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Creating $LFS/root/.bash_profile</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter06/chapter06.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Installing Glibc-2.2.4</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -