source: chapter11/afterlfs.xml@ 4e381f9

11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 bdubbs/gcc13 multilib renodr/libudev-from-systemd trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 4e381f9 was 4e381f9, checked in by Xi Ruoyao <xry111@…>, 19 months ago

fix a typo

  • Property mode set to 100644
File size: 9.1 KB
Line 
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 a basic
43 <ulink url="&blfs-book;x/installing.html">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 for system
56 management for all kinds of systems. These applications are all in the
57 BLFS book. Not all packages are needed in every environments. For
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.
62 </para>
63
64 </sect2>
65
66 <sect2>
67 <title>Working in a basic LFS environment</title>
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.
72 There are a couple of ways to improve this:
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
80 featured browser and copy/paste capabilites are available. This method
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
83 envirnment.
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
89 mounted. One way to do this is to create a script on the
90 <emphasis role="bold">HOST</emphasis> system:
91 </para>
92
93<screen><command>cat &gt; ~/mount-virt.sh &lt;&lt; "EOF"
94#!/bin/bash
95
96function mountbind
97{
98 if ! mountpoint $LFS/$1 >/dev/null; then
99 $SUDO mount --bind /$1 $LFS/$1
100 echo $LFS/$1 mounted
101 else
102 echo $LFS/$1 already mounted
103 fi
104}
105
106function mounttype
107{
108 if ! mountpoint $LFS/$1 >/dev/null; then
109 $SUDO mount -t $2 $3 $4 $5 $LFS/$1
110 echo $LFS/$1 mounted
111 else
112 echo $LFS/$1 already mounted
113 fi
114}
115
116if [ $EUID -ne 0 ]; then
117 SUDO=sudo
118else
119 SUDO=""
120fi
121
122if [ x$LFS == x ]; then
123 echo "LFS not set"
124 exit 1
125fi
126
127mountbind dev
128mounttype dev/pts devpts devpts -o gid=5,mode=620
129mounttype proc proc proc
130mounttype sys sysfs sysfs
131mounttype run tmpfs run
132mkdir $LFS/run/shm
133#mountbind usr/src
134#mountbind boot
135#mountbind home
136EOF</command></screen>
137
138 <para>
139 Note that the last three commands in the script are commented out. These
140 are useful if those directories are mounted as separate partitions on the
141 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> as
146 either a regular user (recommended) or as &root;. If run as a regular
147 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 downloaded
152 package files. This location is arbitrary. It can be in a regular
153 user's home directory such as ~/sources or in a global location like
154 /usr/src. Our recommendation is not to mix BLFS sources and LFS sources
155 in (from the chroot environment) /sources. In any case, the packages
156 must be accessible inside the chroot environment.
157 </para>
158
159 <para>
160 A last convenience feature presented here is to streamline the process
161 of entering the chroot environment. This can be done with an alias
162 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\\\\$ "
166PATH=/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 of
170 backslash characters. It must be all on a single line. The above command
171 has been split in two for presentation purposes.
172 </para>
173
174 </sect3>
175
176 <sect3>
177 <title>Work remotely via ssh</title>
178
179 <para>
180 This method also provides a full graphical environment, but first
181 requires installing
182 <ulink url="&blfs-book;postlfs/openssh.html">sshd</ulink> and
183 <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.
189 </para>
190
191 </sect3>
192
193 <sect3>
194 <title>Work from the LFS command line</title>
195
196 <para>
197 This method requires installing
198 <ulink url="&blfs-book;general/libtasn1.html">libtasn1</ulink>,
199 <ulink url="&blfs-book;postlfs/p11-kit.html">p11-kit</ulink>,
200 <ulink url="&blfs-book;postlfs/make-ca.html">make-ca</ulink>,
201 <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>,
202 <ulink url="&blfs-book;general/gpm.html">gpm</ulink>, and
203 <ulink url="&blfs-book;basicnet/links.html">links</ulink>
204 (or <ulink url="&blfs-book;basicnet/lynx.html">lynx</ulink>)
205 in chroot and then rebooting into the new LFS system. At this
206 point the default system has six virtual consoles. Switching
207 consoles is as easy as using the
208 <keycombo>
209 <keycap>Alt</keycap>
210 <keycap>Fx</keycap>
211 </keycombo>
212 key combinations where <keycap>Fx</keycap> is
213 between <keycap>F1</keycap> and <keycap>F6</keycap>.
214 The
215 <keycombo>
216 <keycap>Alt</keycap>
217 <keycap function='left'/>
218 </keycombo>
219 and
220 <keycombo>
221 <keycap>Alt</keycap>
222 <keycap function='right'/>
223 </keycombo>
224 combinations also will change the console.
225 </para>
226
227 <para>
228 At this point you can log into two different virtual consoles and run
229 the links or lynx browser in one console and bash in the other. GPM
230 then allows copying commands from the browser with the left mouse
231 button, switching consoles, and pasting into the other console.
232 </para>
233
234 <note>
235 <para>
236 As a side note, switching of virtual consoles can also be done from
237 an X Window instance with the
238 <keycombo>
239 <keycap>Ctrl</keycap>
240 <keycap>Alt</keycap>
241 <keycap>Fx</keycap>
242 </keycombo>
243 key combination, but the mouse copy operation does not work
244 between the graphical interface and a virtual console. You can
245 return to the X Window display with the
246 <keycombo>
247 <keycap>Ctrl</keycap>
248 <keycap>Alt</keycap>
249 <keycap>Fx</keycap>
250 </keycombo>
251 combination, where <keycap>Fx</keycap> is usually
252 <keycap>F1</keycap> but may be <keycap>F7</keycap>.
253 </para>
254 </note>
255
256 </sect3>
257
258 </sect2>
259
260
261</sect1>
Note: See TracBrowser for help on using the repository browser.