source: chapter11/afterlfs.xml@ 16cd0963

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 16cd0963 was 16cd0963, checked in by Bruce Dubbs <bdubbs@…>, 19 months ago

Adjust instructions for /dev/shm when creating virtual filesystems.
Some host create /dev/shm as a tmpfs. Some have is as
a symlink to a location in another directory. This
change handles both cases.

The change to the sysV bootscripts now creates /dev/shm
as a separate tmpfs from /run. This makes LFS sysV and
systemd versions treat /dev/shm the same.

  • Property mode set to 100644
File size: 9.2 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 capabilities 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
132if [ -h $LFS/dev/shm ]; then
133 mkdir -pv $LFS/$(readlink $LFS/dev/shm)
134else
135 mounttype dev/shm tmpfs tmpfs -o nosuid,nodev
136fi
137
138#mountbind usr/src
139#mountbind boot
140#mountbind home
141EOF</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
146 host system and will be mounted when booting the completed LFS/BLFS system.
147 </para>
148
149 <para>
150 The script can be run with <command>bash ~/mount-virt.sh</command> as
151 either a regular user (recommended) or as &root;. If run as a regular
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
170<screen><command>alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root TERM="$TERM" PS1="\u:\w\\\\$ "
171PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login'</command></screen>
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
186 requires installing
187 <ulink url="&blfs-book;postlfs/openssh.html">sshd</ulink> and
188 <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>
189 on the LFS system, usually in chroot. It also requires a second
190 computer. This method has the advantage of being simple by not requiring
191 the complexity of the chroot environment. It also uses your LFS built
192 kernel for all additional packages and still provides a complete system
193 for installing packages.
194 </para>
195
196 </sect3>
197
198 <sect3>
199 <title>Work from the LFS command line</title>
200
201 <para>
202 This method requires installing
203 <ulink url="&blfs-book;general/libtasn1.html">libtasn1</ulink>,
204 <ulink url="&blfs-book;postlfs/p11-kit.html">p11-kit</ulink>,
205 <ulink url="&blfs-book;postlfs/make-ca.html">make-ca</ulink>,
206 <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>,
207 <ulink url="&blfs-book;general/gpm.html">gpm</ulink>, and
208 <ulink url="&blfs-book;basicnet/links.html">links</ulink>
209 (or <ulink url="&blfs-book;basicnet/lynx.html">lynx</ulink>)
210 in chroot and then rebooting into the new LFS system. At this
211 point the default system has six virtual consoles. Switching
212 consoles is as easy as using the
213 <keycombo>
214 <keycap>Alt</keycap>
215 <keycap>Fx</keycap>
216 </keycombo>
217 key combinations where <keycap>Fx</keycap> is
218 between <keycap>F1</keycap> and <keycap>F6</keycap>.
219 The
220 <keycombo>
221 <keycap>Alt</keycap>
222 <keycap function='left'/>
223 </keycombo>
224 and
225 <keycombo>
226 <keycap>Alt</keycap>
227 <keycap function='right'/>
228 </keycombo>
229 combinations also will change the console.
230 </para>
231
232 <para>
233 At this point you can log into two different virtual consoles and run
234 the links or lynx browser in one console and bash in the other. GPM
235 then allows copying commands from the browser with the left mouse
236 button, switching consoles, and pasting into the other console.
237 </para>
238
239 <note>
240 <para>
241 As a side note, switching of virtual consoles can also be done from
242 an X Window instance with the
243 <keycombo>
244 <keycap>Ctrl</keycap>
245 <keycap>Alt</keycap>
246 <keycap>Fx</keycap>
247 </keycombo>
248 key combination, but the mouse copy operation does not work
249 between the graphical interface and a virtual console. You can
250 return to the X Window display with the
251 <keycombo>
252 <keycap>Ctrl</keycap>
253 <keycap>Alt</keycap>
254 <keycap>Fx</keycap>
255 </keycombo>
256 combination, where <keycap>Fx</keycap> is usually
257 <keycap>F1</keycap> but may be <keycap>F7</keycap>.
258 </para>
259 </note>
260
261 </sect3>
262
263 </sect2>
264
265
266</sect1>
Note: See TracBrowser for help on using the repository browser.