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