[7152faa] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[ea94a21] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="afterlfs">
|
---|
| 9 | <?dbhtml filename="afterlfs.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Getting Started After LFS</title>
|
---|
| 12 |
|
---|
| 13 | <sect2>
|
---|
| 14 | <title>Deciding what to do next</title>
|
---|
| 15 |
|
---|
| 16 | <para>
|
---|
| 17 | Now that LFS is complete and you have a bootable system, what do you do?
|
---|
| 18 | The next step is to decide how to use it. Generally, there are two broad
|
---|
| 19 | categories to consider: workstation or server. Indeed, these categories
|
---|
| 20 | are not mutually exclusive. The applications needed for each category
|
---|
| 21 | can be combined onto a single system, but let's look at them separately
|
---|
| 22 | for now.
|
---|
| 23 | </para>
|
---|
| 24 |
|
---|
| 25 | <para>
|
---|
| 26 | A server is the simpler category. Generally this consists of a web
|
---|
[59350d1] | 27 | server such as the
|
---|
[ea94a21] | 28 | <ulink url="&blfs-book;server/apache.html">Apache HTTP Server</ulink>
|
---|
| 29 | and a database server such as
|
---|
[59350d1] | 30 | <ulink url="&blfs-book;server/mariadb.html">MariaDB</ulink>.
|
---|
[ea94a21] | 31 | However other services are possible. The operating system
|
---|
| 32 | embedded in a single use device falls into this category.
|
---|
| 33 | </para>
|
---|
| 34 |
|
---|
| 35 | <para>
|
---|
| 36 | On the other hand, a workstation is much more complex. It generally
|
---|
[59350d1] | 37 | requires a graphical user environment such as
|
---|
| 38 | <ulink url="&blfs-book;lxde/lxde.html">LXDE</ulink>,
|
---|
| 39 | <ulink url="&blfs-book;xfce/xfce.html">XFCE</ulink>,
|
---|
| 40 | <ulink url="&blfs-book;kde/kde.html">KDE</ulink>, or
|
---|
[ea94a21] | 41 | <ulink url="&blfs-book;gnome/gnome.html">Gnome</ulink>
|
---|
[9f8335e] | 42 | based on a basic
|
---|
| 43 | <ulink url="&blfs-book;x/installing.html">graphical environment</ulink>
|
---|
[ea94a21] | 44 | and several graphical based applications such as the
|
---|
[59350d1] | 45 | <ulink url="&blfs-book;xsoft/firefox.html">Firefox web browser</ulink>,
|
---|
[ea94a21] | 46 | <ulink url="&blfs-book;xsoft/thunderbird.html">Thunderbird email client</ulink>,
|
---|
[59350d1] | 47 | or
|
---|
| 48 | <ulink url="&blfs-book;xsoft/libreoffice.html">LibreOffice office suite</ulink>.
|
---|
[ea94a21] | 49 | These applications require many (several hundred depending on
|
---|
| 50 | desired capabilities) more packages of support applications and
|
---|
| 51 | libraries.
|
---|
| 52 | </para>
|
---|
| 53 |
|
---|
| 54 | <para>
|
---|
[6d60bfc] | 55 | In addition to the above, there is a set of applications for system
|
---|
| 56 | management for all kinds of systems. These applications are all in the
|
---|
[4e381f9] | 57 | BLFS book. Not all packages are needed in every environments. For
|
---|
[6d60bfc] | 58 | example <ulink url="&blfs-book;basicnet/dhcpcd.html">dhcpcd</ulink>, is
|
---|
| 59 | not normally appropriate for a server and <ulink
|
---|
| 60 | url="&blfs-book;basicnet/wireless_tools.html">wireless_tools</ulink>,
|
---|
| 61 | are normally only useful for a laptop system.
|
---|
[ea94a21] | 62 | </para>
|
---|
| 63 |
|
---|
| 64 | </sect2>
|
---|
| 65 |
|
---|
| 66 | <sect2>
|
---|
[9f8335e] | 67 | <title>Working in a basic LFS environment</title>
|
---|
[ea94a21] | 68 |
|
---|
| 69 | <para>
|
---|
| 70 | When you initially boot into LFS, you have all the internal tools to build
|
---|
| 71 | additional packages. Unfortunately, the user environment is quite sparse.
|
---|
[59350d1] | 72 | There are a couple of ways to improve this:
|
---|
[ea94a21] | 73 | </para>
|
---|
| 74 |
|
---|
| 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 full
|
---|
[670f55f] | 80 | featured browser and copy/paste capabilities are available. This method
|
---|
[ea94a21] | 81 | allows using applications like the host's version of wget to download
|
---|
| 82 | package sources to a location available when working in the chroot
|
---|
[d280997e] | 83 | environment.
|
---|
[ea94a21] | 84 | </para>
|
---|
| 85 |
|
---|
| 86 | <para>
|
---|
| 87 | In order to properly build packages in chroot, you will also need to
|
---|
| 88 | remember to mount the virtual file systems if they are not already
|
---|
[59350d1] | 89 | mounted. One way to do this is to create a script on the
|
---|
[9f8335e] | 90 | <emphasis role="bold">HOST</emphasis> system:
|
---|
[ea94a21] | 91 | </para>
|
---|
| 92 |
|
---|
| 93 | <screen><command>cat > ~/mount-virt.sh << "EOF"
|
---|
| 94 | #!/bin/bash
|
---|
| 95 |
|
---|
| 96 | function mountbind
|
---|
| 97 | {
|
---|
| 98 | if ! mountpoint $LFS/$1 >/dev/null; then
|
---|
[59350d1] | 99 | $SUDO mount --bind /$1 $LFS/$1
|
---|
[ea94a21] | 100 | echo $LFS/$1 mounted
|
---|
| 101 | else
|
---|
| 102 | echo $LFS/$1 already mounted
|
---|
| 103 | fi
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | function mounttype
|
---|
| 107 | {
|
---|
| 108 | if ! mountpoint $LFS/$1 >/dev/null; then
|
---|
[59350d1] | 109 | $SUDO mount -t $2 $3 $4 $5 $LFS/$1
|
---|
[ea94a21] | 110 | echo $LFS/$1 mounted
|
---|
| 111 | else
|
---|
| 112 | echo $LFS/$1 already mounted
|
---|
| 113 | fi
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | if [ $EUID -ne 0 ]; then
|
---|
| 117 | SUDO=sudo
|
---|
| 118 | else
|
---|
| 119 | SUDO=""
|
---|
| 120 | fi
|
---|
| 121 |
|
---|
| 122 | if [ x$LFS == x ]; then
|
---|
| 123 | echo "LFS not set"
|
---|
| 124 | exit 1
|
---|
| 125 | fi
|
---|
| 126 |
|
---|
[59350d1] | 127 | mountbind dev
|
---|
[ea94a21] | 128 | mounttype dev/pts devpts devpts -o gid=5,mode=620
|
---|
| 129 | mounttype proc proc proc
|
---|
| 130 | mounttype sys sysfs sysfs
|
---|
| 131 | mounttype run tmpfs run
|
---|
[16cd0963] | 132 | if [ -h $LFS/dev/shm ]; then
|
---|
[7436c28] | 133 | install -v -d -m 1777 $LFS$(realpath /dev/shm)
|
---|
[16cd0963] | 134 | else
|
---|
| 135 | mounttype dev/shm tmpfs tmpfs -o nosuid,nodev
|
---|
| 136 | fi
|
---|
| 137 |
|
---|
[ea94a21] | 138 | #mountbind usr/src
|
---|
| 139 | #mountbind boot
|
---|
| 140 | #mountbind home
|
---|
| 141 | EOF</command></screen>
|
---|
| 142 |
|
---|
| 143 | <para>
|
---|
| 144 | Note that the last three commands in the script are commented out. These
|
---|
| 145 | are useful if those directories are mounted as separate partitions on the
|
---|
[59350d1] | 146 | host system and will be mounted when booting the completed LFS/BLFS system.
|
---|
[ea94a21] | 147 | </para>
|
---|
| 148 |
|
---|
| 149 | <para>
|
---|
| 150 | The script can be run with <command>bash ~/mount-virt.sh</command> as
|
---|
[b6a6f6c7] | 151 | either a regular user (recommended) or as &root;. If run as a regular
|
---|
[ea94a21] | 152 | user, sudo is required on the host system.
|
---|
| 153 | </para>
|
---|
| 154 |
|
---|
| 155 | <para>
|
---|
| 156 | Another issue pointed out by the script is where to store downloaded
|
---|
| 157 | package files. This location is arbitrary. It can be in a regular
|
---|
| 158 | user's home directory such as ~/sources or in a global location like
|
---|
| 159 | /usr/src. Our recommendation is not to mix BLFS sources and LFS sources
|
---|
| 160 | in (from the chroot environment) /sources. In any case, the packages
|
---|
| 161 | must be accessible inside the chroot environment.
|
---|
| 162 | </para>
|
---|
| 163 |
|
---|
| 164 | <para>
|
---|
| 165 | A last convenience feature presented here is to streamline the process
|
---|
| 166 | of entering the chroot environment. This can be done with an alias
|
---|
| 167 | placed in a user's ~/.bashrc file on the host system:
|
---|
| 168 | </para>
|
---|
| 169 |
|
---|
[59350d1] | 170 | <screen><command>alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root TERM="$TERM" PS1="\u:\w\\\\$ "
|
---|
| 171 | PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login'</command></screen>
|
---|
[ea94a21] | 172 |
|
---|
| 173 | <para>
|
---|
| 174 | This alias is a little tricky because of the quoting and levels of
|
---|
| 175 | backslash characters. It must be all on a single line. The above command
|
---|
| 176 | has been split in two for presentation purposes.
|
---|
| 177 | </para>
|
---|
| 178 |
|
---|
| 179 | </sect3>
|
---|
| 180 |
|
---|
| 181 | <sect3>
|
---|
| 182 | <title>Work remotely via ssh</title>
|
---|
| 183 |
|
---|
| 184 | <para>
|
---|
| 185 | This method also provides a full graphical environment, but first
|
---|
[59350d1] | 186 | requires installing
|
---|
[d48812d] | 187 | <ulink url="&blfs-book;postlfs/openssh.html">sshd</ulink>
|
---|
[ea94a21] | 188 | on the LFS system, usually in chroot. It also requires a second
|
---|
| 189 | computer. This method has the advantage of being simple by not requiring
|
---|
| 190 | the complexity of the chroot environment. It also uses your LFS built
|
---|
| 191 | kernel for all additional packages and still provides a complete system
|
---|
[59350d1] | 192 | for installing packages.
|
---|
[ea94a21] | 193 | </para>
|
---|
| 194 |
|
---|
[d48812d] | 195 | <para>
|
---|
| 196 | You may use the <command>scp</command> command to upload the package
|
---|
| 197 | sources to be built onto the LFS system. If you want to download
|
---|
| 198 | the sources onto the LFS system directly instead, install
|
---|
| 199 | <ulink url="&blfs-book;general/libtasn1.html">libtasn1</ulink>,
|
---|
| 200 | <ulink url="&blfs-book;postlfs/p11-kit.html">p11-kit</ulink>,
|
---|
| 201 | <ulink url="&blfs-book;postlfs/make-ca.html">make-ca</ulink>, and
|
---|
| 202 | <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>
|
---|
| 203 | in chroot (or upload their sources using <command>scp</command>
|
---|
| 204 | after booting the LFS system).
|
---|
| 205 | </para>
|
---|
[ea94a21] | 206 | </sect3>
|
---|
| 207 |
|
---|
| 208 | <sect3>
|
---|
| 209 | <title>Work from the LFS command line</title>
|
---|
| 210 |
|
---|
| 211 | <para>
|
---|
[afd19ad] | 212 | This method requires installing
|
---|
| 213 | <ulink url="&blfs-book;general/libtasn1.html">libtasn1</ulink>,
|
---|
| 214 | <ulink url="&blfs-book;postlfs/p11-kit.html">p11-kit</ulink>,
|
---|
[ea94a21] | 215 | <ulink url="&blfs-book;postlfs/make-ca.html">make-ca</ulink>,
|
---|
[59350d1] | 216 | <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>,
|
---|
[ea94a21] | 217 | <ulink url="&blfs-book;general/gpm.html">gpm</ulink>, and
|
---|
[226784a] | 218 | <ulink url="&blfs-book;basicnet/links.html">links</ulink>
|
---|
[43e4861] | 219 | (or <ulink url="&blfs-book;basicnet/lynx.html">lynx</ulink>)
|
---|
[59350d1] | 220 | in chroot and then rebooting into the new LFS system. At this
|
---|
| 221 | point the default system has six virtual consoles. Switching
|
---|
[9bbfbea] | 222 | consoles is as easy as using the
|
---|
| 223 | <keycombo>
|
---|
| 224 | <keycap>Alt</keycap>
|
---|
| 225 | <keycap>Fx</keycap>
|
---|
| 226 | </keycombo>
|
---|
| 227 | key combinations where <keycap>Fx</keycap> is
|
---|
| 228 | between <keycap>F1</keycap> and <keycap>F6</keycap>.
|
---|
| 229 | The
|
---|
| 230 | <keycombo>
|
---|
| 231 | <keycap>Alt</keycap>
|
---|
| 232 | <keycap function='left'/>
|
---|
| 233 | </keycombo>
|
---|
| 234 | and
|
---|
| 235 | <keycombo>
|
---|
| 236 | <keycap>Alt</keycap>
|
---|
| 237 | <keycap function='right'/>
|
---|
| 238 | </keycombo>
|
---|
[ea94a21] | 239 | combinations also will change the console.
|
---|
| 240 | </para>
|
---|
[59350d1] | 241 |
|
---|
[ea94a21] | 242 | <para>
|
---|
| 243 | At this point you can log into two different virtual consoles and run
|
---|
[43e4861] | 244 | the links or lynx browser in one console and bash in the other. GPM
|
---|
| 245 | then allows copying commands from the browser with the left mouse
|
---|
| 246 | button, switching consoles, and pasting into the other console.
|
---|
[ea94a21] | 247 | </para>
|
---|
| 248 |
|
---|
| 249 | <note>
|
---|
| 250 | <para>
|
---|
| 251 | As a side note, switching of virtual consoles can also be done from
|
---|
[9bbfbea] | 252 | an X Window instance with the
|
---|
| 253 | <keycombo>
|
---|
| 254 | <keycap>Ctrl</keycap>
|
---|
| 255 | <keycap>Alt</keycap>
|
---|
| 256 | <keycap>Fx</keycap>
|
---|
| 257 | </keycombo>
|
---|
| 258 | key combination, but the mouse copy operation does not work
|
---|
| 259 | between the graphical interface and a virtual console. You can
|
---|
| 260 | return to the X Window display with the
|
---|
| 261 | <keycombo>
|
---|
| 262 | <keycap>Ctrl</keycap>
|
---|
| 263 | <keycap>Alt</keycap>
|
---|
| 264 | <keycap>Fx</keycap>
|
---|
| 265 | </keycombo>
|
---|
[6d60bfc] | 266 | combination, where <keycap>Fx</keycap> is usually
|
---|
| 267 | <keycap>F1</keycap> but may be <keycap>F7</keycap>.
|
---|
[ea94a21] | 268 | </para>
|
---|
| 269 | </note>
|
---|
| 270 |
|
---|
| 271 | </sect3>
|
---|
| 272 |
|
---|
| 273 | </sect2>
|
---|
| 274 |
|
---|
| 275 |
|
---|
| 276 | </sect1>
|
---|