Changeset 1f6dfd4 for chapter11/afterlfs.xml
- Timestamp:
- 09/19/2022 06:47:24 AM (2 years ago)
- Branches:
- xry111/clfs-ng
- Children:
- 0ea3431
- Parents:
- 6c952e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter11/afterlfs.xml
r6c952e3 r1f6dfd4 74 74 75 75 <sect3> 76 <title>Work from the LFS host in chroot</title>77 78 <para>79 This method provides a complete graphical environment where a full80 featured browser and copy/paste capabilites are available. This method81 allows using applications like the host's version of wget to download82 package sources to a location available when working in the chroot83 envirnment.84 </para>85 86 <para>87 In order to properly build packages in chroot, you will also need to88 remember to mount the virtual file systems if they are not already89 mounted. One way to do this is to create a script on the90 <emphasis role="bold">HOST</emphasis> system:91 </para>92 93 <screen><command>cat > ~/mount-virt.sh << "EOF"94 #!/bin/bash95 96 function mountbind97 {98 if ! mountpoint $LFS/$1 >/dev/null; then99 $SUDO mount --bind /$1 $LFS/$1100 echo $LFS/$1 mounted101 else102 echo $LFS/$1 already mounted103 fi104 }105 106 function mounttype107 {108 if ! mountpoint $LFS/$1 >/dev/null; then109 $SUDO mount -t $2 $3 $4 $5 $LFS/$1110 echo $LFS/$1 mounted111 else112 echo $LFS/$1 already mounted113 fi114 }115 116 if [ $EUID -ne 0 ]; then117 SUDO=sudo118 else119 SUDO=""120 fi121 122 if [ x$LFS == x ]; then123 echo "LFS not set"124 exit 1125 fi126 127 mountbind dev128 mounttype dev/pts devpts devpts -o gid=5,mode=620129 mounttype proc proc proc130 mounttype sys sysfs sysfs131 mounttype run tmpfs run132 mkdir $LFS/run/shm133 #mountbind usr/src134 #mountbind boot135 #mountbind home136 EOF</command></screen>137 138 <para>139 Note that the last three commands in the script are commented out. These140 are useful if those directories are mounted as separate partitions on the141 host system and will be mounted when booting the completed LFS/BLFS system.142 </para>143 144 <para>145 The script can be run with <command>bash ~/mount-virt.sh</command> as146 either a regular user (recommended) or as &root;. If run as a regular147 user, sudo is required on the host system.148 </para>149 150 <para>151 Another issue pointed out by the script is where to store downloaded152 package files. This location is arbitrary. It can be in a regular153 user's home directory such as ~/sources or in a global location like154 /usr/src. Our recommendation is not to mix BLFS sources and LFS sources155 in (from the chroot environment) /sources. In any case, the packages156 must be accessible inside the chroot environment.157 </para>158 159 <para>160 A last convenience feature presented here is to streamline the process161 of entering the chroot environment. This can be done with an alias162 placed in a user's ~/.bashrc file on the host system:163 </para>164 165 <screen><command>alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root TERM="$TERM" PS1="\u:\w\\\\$ "166 PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login'</command></screen>167 168 <para>169 This alias is a little tricky because of the quoting and levels of170 backslash characters. It must be all on a single line. The above command171 has been split in two for presentation purposes.172 </para>173 174 </sect3>175 176 <sect3>177 76 <title>Work remotely via ssh</title> 178 77 … … 182 81 <ulink url="&blfs-book;postlfs/openssh.html">sshd</ulink> and 183 82 <ulink url="&blfs-book;basicnet/wget.html">wget</ulink> 184 on the LFS system, usually in chroot. It also requires a second 185 computer. This method has the advantage of being simple by not requiring 186 the complexity of the chroot environment. It also uses your LFS built 187 kernel for all additional packages and still provides a complete system 188 for installing packages. 83 on the LFS system, usually in the LFS command line. It also requires 84 a second computer. 189 85 </para> 190 86 … … 203 99 <ulink url="&blfs-book;basicnet/links.html">links</ulink> 204 100 (or <ulink url="&blfs-book;basicnet/lynx.html">lynx</ulink>) 205 in chroot and then rebooting into the new LFS system. At this 101 after rebooting into the new LFS system. You may need a removable 102 stroage device to copy these packages into the target system. At this 206 103 point the default system has six virtual consoles. Switching 207 104 consoles is as easy as using the
Note:
See TracChangeset
for help on using the changeset viewer.