1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
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
|
---|
27 | server such as the
|
---|
28 | <ulink url="&blfs-book;server/apache.html">Apache HTTP Server</ulink>
|
---|
29 | and a database server such as
|
---|
30 | <ulink url="&blfs-book;server/mariadb.html">MariaDB</ulink>.
|
---|
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
|
---|
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
|
---|
41 | <ulink url="&blfs-book;gnome/gnome.html">Gnome</ulink>
|
---|
42 | based on the
|
---|
43 | <ulink url="&blfs-book;x/installing.html">X Window graphical environment</ulink>
|
---|
44 | and several graphical based applications such as the
|
---|
45 | <ulink url="&blfs-book;xsoft/firefox.html">Firefox web browser</ulink>,
|
---|
46 | <ulink url="&blfs-book;xsoft/thunderbird.html">Thunderbird email client</ulink>,
|
---|
47 | or
|
---|
48 | <ulink url="&blfs-book;xsoft/libreoffice.html">LibreOffice office suite</ulink>.
|
---|
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>
|
---|
55 | In addition to the above, there is a set of applications that are
|
---|
56 | suitable for all systems for system management. These applications are
|
---|
57 | all in the full BLFS book. Not
|
---|
58 | all packages are needed in all environments. For example
|
---|
59 | <ulink url="&blfs-book;basicnet/dhcpcd.html">dhcpcd</ulink>,
|
---|
60 | is not appropriate for a server and
|
---|
61 | <ulink url="&blfs-book;basicnet/wireless_tools.html">wireless_tools</ulink>,
|
---|
62 | are normally only
|
---|
63 | useful for a laptop system. If you are not sure if a package presented
|
---|
64 | here is needed or not, it can either be installed now or later as the
|
---|
65 | need arises.
|
---|
66 | </para>
|
---|
67 |
|
---|
68 | </sect2>
|
---|
69 |
|
---|
70 | <sect2>
|
---|
71 | <title>Working in a partial BLFS environment</title>
|
---|
72 |
|
---|
73 | <para>
|
---|
74 | When you initially boot into LFS, you have all the internal tools to build
|
---|
75 | additional packages. Unfortunately, the user environment is quite sparse.
|
---|
76 | There are a couple of ways to improve this:
|
---|
77 | </para>
|
---|
78 |
|
---|
79 | <sect3>
|
---|
80 | <title>Work from the LFS host in chroot</title>
|
---|
81 |
|
---|
82 | <para>
|
---|
83 | This method provides a complete graphical environment where a full
|
---|
84 | featured browser and copy/paste capabilites are available. This method
|
---|
85 | allows using applications like the host's version of wget to download
|
---|
86 | package sources to a location available when working in the chroot
|
---|
87 | envirnment.
|
---|
88 | </para>
|
---|
89 |
|
---|
90 | <para>
|
---|
91 | In order to properly build packages in chroot, you will also need to
|
---|
92 | remember to mount the virtual file systems if they are not already
|
---|
93 | mounted. One way to do this is to create a script on the
|
---|
94 | <command>HOST</command> system:
|
---|
95 | </para>
|
---|
96 |
|
---|
97 | <screen><command>cat > ~/mount-virt.sh << "EOF"
|
---|
98 | #!/bin/bash
|
---|
99 |
|
---|
100 | function mountbind
|
---|
101 | {
|
---|
102 | if ! mountpoint $LFS/$1 >/dev/null; then
|
---|
103 | $SUDO mount --bind /$1 $LFS/$1
|
---|
104 | echo $LFS/$1 mounted
|
---|
105 | else
|
---|
106 | echo $LFS/$1 already mounted
|
---|
107 | fi
|
---|
108 | }
|
---|
109 |
|
---|
110 | function mounttype
|
---|
111 | {
|
---|
112 | if ! mountpoint $LFS/$1 >/dev/null; then
|
---|
113 | $SUDO mount -t $2 $3 $4 $5 $LFS/$1
|
---|
114 | echo $LFS/$1 mounted
|
---|
115 | else
|
---|
116 | echo $LFS/$1 already mounted
|
---|
117 | fi
|
---|
118 | }
|
---|
119 |
|
---|
120 | if [ $EUID -ne 0 ]; then
|
---|
121 | SUDO=sudo
|
---|
122 | else
|
---|
123 | SUDO=""
|
---|
124 | fi
|
---|
125 |
|
---|
126 | if [ x$LFS == x ]; then
|
---|
127 | echo "LFS not set"
|
---|
128 | exit 1
|
---|
129 | fi
|
---|
130 |
|
---|
131 | mountbind dev
|
---|
132 | mounttype dev/pts devpts devpts -o gid=5,mode=620
|
---|
133 | mounttype proc proc proc
|
---|
134 | mounttype sys sysfs sysfs
|
---|
135 | mounttype run tmpfs run
|
---|
136 | mkdir $LFS/run/shm
|
---|
137 | #mountbind usr/src
|
---|
138 | #mountbind boot
|
---|
139 | #mountbind home
|
---|
140 | EOF</command></screen>
|
---|
141 |
|
---|
142 | <para>
|
---|
143 | Note that the last three commands in the script are commented out. These
|
---|
144 | are useful if those directories are mounted as separate partitions on the
|
---|
145 | host system and will be mounted when booting the completed LFS/BLFS system.
|
---|
146 | </para>
|
---|
147 |
|
---|
148 | <para>
|
---|
149 | The script can be run with <command>bash ~/mount-virt.sh</command> as
|
---|
150 | either a regular user (recommended) or as root. If run as a regular
|
---|
151 | user, sudo is required on the host system.
|
---|
152 | </para>
|
---|
153 |
|
---|
154 | <para>
|
---|
155 | Another issue pointed out by the script is where to store downloaded
|
---|
156 | package files. This location is arbitrary. It can be in a regular
|
---|
157 | user's home directory such as ~/sources or in a global location like
|
---|
158 | /usr/src. Our recommendation is not to mix BLFS sources and LFS sources
|
---|
159 | in (from the chroot environment) /sources. In any case, the packages
|
---|
160 | must be accessible inside the chroot environment.
|
---|
161 | </para>
|
---|
162 |
|
---|
163 | <para>
|
---|
164 | A last convenience feature presented here is to streamline the process
|
---|
165 | of entering the chroot environment. This can be done with an alias
|
---|
166 | placed in a user's ~/.bashrc file on the host system:
|
---|
167 | </para>
|
---|
168 |
|
---|
169 | <screen><command>alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root TERM="$TERM" PS1="\u:\w\\\\$ "
|
---|
170 | PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login'</command></screen>
|
---|
171 |
|
---|
172 | <para>
|
---|
173 | This alias is a little tricky because of the quoting and levels of
|
---|
174 | backslash characters. It must be all on a single line. The above command
|
---|
175 | has been split in two for presentation purposes.
|
---|
176 | </para>
|
---|
177 |
|
---|
178 | </sect3>
|
---|
179 |
|
---|
180 | <sect3>
|
---|
181 | <title>Work remotely via ssh</title>
|
---|
182 |
|
---|
183 | <para>
|
---|
184 | This method also provides a full graphical environment, but first
|
---|
185 | requires installing
|
---|
186 | <ulink url="&blfs-book;postlfs/openssh.html">sshd</ulink> and
|
---|
187 | <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>
|
---|
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
|
---|
192 | for installing packages.
|
---|
193 | </para>
|
---|
194 |
|
---|
195 | </sect3>
|
---|
196 |
|
---|
197 | <sect3>
|
---|
198 | <title>Work from the LFS command line</title>
|
---|
199 |
|
---|
200 | <para>
|
---|
201 | This method requires installing
|
---|
202 | <ulink url="&blfs-book;general/libtasn1.html">libtasn1</ulink>,
|
---|
203 | <ulink url="&blfs-book;postlfs/p11-kit.html">p11-kit</ulink>,
|
---|
204 | <ulink url="&blfs-book;postlfs/make-ca.html">make-ca</ulink>,
|
---|
205 | <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>,
|
---|
206 | <ulink url="&blfs-book;general/gpm.html">gpm</ulink>, and
|
---|
207 | <ulink url="&blfs-book;basicnet/links.html">links</ulink>
|
---|
208 | in chroot and then rebooting into the new LFS system. At this
|
---|
209 | point the default system has six virtual consoles. Switching
|
---|
210 | consoles is as easy as using the Alt-Fn key combinations where Fn is
|
---|
211 | between F1 and F6. The Alt-LeftArrow and Alt-RightArrow key
|
---|
212 | combinations also will change the console.
|
---|
213 | </para>
|
---|
214 |
|
---|
215 | <para>
|
---|
216 | At this point you can log into two different virtual consoles and run
|
---|
217 | the links browser in one console and bash in the other. GPM then allows
|
---|
218 | copying commands from the browser with the left mouse button, switching
|
---|
219 | consoles, and pasting into the other console.
|
---|
220 | </para>
|
---|
221 |
|
---|
222 | <note>
|
---|
223 | <para>
|
---|
224 | As a side note, switching of virtual consoles can also be done from
|
---|
225 | an X Window instance with the Ctrl-Alt-Fn key combination, but the
|
---|
226 | mouse copy operation does not work between the graphical interface
|
---|
227 | and a virtual console. You can return to the X Window display with
|
---|
228 | the Ctrl-Alt-Fn conbination where Fn is usually F7.
|
---|
229 | </para>
|
---|
230 | </note>
|
---|
231 |
|
---|
232 | </sect3>
|
---|
233 |
|
---|
234 | </sect2>
|
---|
235 |
|
---|
236 |
|
---|
237 | </sect1>
|
---|