aboutsummaryrefslogtreecommitdiffstats
path: root/chapter11
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2022-09-16 21:37:34 -0500
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2022-09-16 21:37:34 -0500
commitea94a21b79b9615b78baac12da02cefb025a784d (patch)
tree3d5174220a956dc9ae9742f260133737a0372311 /chapter11
parent9644bf9f088048a1779de36db31a32c4a1e72b4a (diff)
Update Chapter 11
These changes provide additional information on how to install additional packages from BLFS after LFS is complete.
Diffstat (limited to 'chapter11')
-rw-r--r--chapter11/afterlfs.xml235
-rw-r--r--chapter11/chapter11.xml1
-rw-r--r--chapter11/reboot.xml46
-rw-r--r--chapter11/whatnow.xml9
4 files changed, 268 insertions, 23 deletions
diff --git a/chapter11/afterlfs.xml b/chapter11/afterlfs.xml
new file mode 100644
index 000000000..d2779b563
--- /dev/null
+++ b/chapter11/afterlfs.xml
@@ -0,0 +1,235 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+ <!ENTITY % general-entities SYSTEM "../general.ent">
+ %general-entities;
+]>
+
+<sect1 id="afterlfs">
+ <?dbhtml filename="afterlfs.html"?>
+
+ <title>Getting Started After LFS</title>
+
+ <sect2>
+ <title>Deciding what to do next</title>
+
+ <para>
+ Now that LFS is complete and you have a bootable system, what do you do?
+ The next step is to decide how to use it. Generally, there are two broad
+ categories to consider: workstation or server. Indeed, these categories
+ are not mutually exclusive. The applications needed for each category
+ can be combined onto a single system, but let's look at them separately
+ for now.
+ </para>
+
+ <para>
+ A server is the simpler category. Generally this consists of a web
+ server such as the
+ <ulink url="&blfs-book;server/apache.html">Apache HTTP Server</ulink>
+ and a database server such as
+ <ulink url="&blfs-book;server/mariadb.html">MariaDB</ulink>.
+ However other services are possible. The operating system
+ embedded in a single use device falls into this category.
+ </para>
+
+ <para>
+ On the other hand, a workstation is much more complex. It generally
+ requires a graphical user environment such as
+ <ulink url="&blfs-book;lxde/lxde.html">LXDE</ulink>,
+ <ulink url="&blfs-book;xfce/xfce.html">XFCE</ulink>,
+ <ulink url="&blfs-book;kde/kde.html">KDE</ulink>, or
+ <ulink url="&blfs-book;gnome/gnome.html">Gnome</ulink>
+ based on the
+ <ulink url="&blfs-book;x/installing.html">X Window graphical environment</ulink>
+ and several graphical based applications such as the
+ <ulink url="&blfs-book;xsoft/firefox.html">Firefox web browser</ulink>,
+ <ulink url="&blfs-book;xsoft/thunderbird.html">Thunderbird email client</ulink>,
+ or
+ <ulink url="&blfs-book;xsoft/libreoffice.html">LibreOffice office suite</ulink>.
+ These applications require many (several hundred depending on
+ desired capabilities) more packages of support applications and
+ libraries.
+ </para>
+
+ <para>
+ In addition to the above, there is a set of applications that are
+ suitable for all systems for system management. These applications are
+ all in the full BLFS book. Not
+ all packages are needed in all environments. For example
+ <ulink url="&blfs-book;basicnet/dhcpcd.html">dhcpcd</ulink>,
+ is not appropriate for a server and
+ <ulink url="&blfs-book;basicnet/wireless_tools.html">wireless_tools</ulink>,
+ are normally only
+ useful for a laptop system. If you are not sure if a package presented
+ here is needed or not, it can either be installed now or later as the
+ need arises.
+ </para>
+
+ </sect2>
+
+ <sect2>
+ <title>Working in a partial BLFS environment</title>
+
+ <para>
+ When you initially boot into LFS, you have all the internal tools to build
+ additional packages. Unfortunately, the user environment is quite sparse.
+ There are a couple of ways to improve this:
+ </para>
+
+ <sect3>
+ <title>Work from the LFS host in chroot</title>
+
+ <para>
+ This method provides a complete graphical environment where a full
+ featured browser and copy/paste capabilites are available. This method
+ allows using applications like the host's version of wget to download
+ package sources to a location available when working in the chroot
+ envirnment.
+ </para>
+
+ <para>
+ In order to properly build packages in chroot, you will also need to
+ remember to mount the virtual file systems if they are not already
+ mounted. One way to do this is to create a script on the
+ <command>HOST</command> system:
+ </para>
+
+<screen><command>cat &gt; ~/mount-virt.sh &lt;&lt; "EOF"
+#!/bin/bash
+
+function mountbind
+{
+ if ! mountpoint $LFS/$1 >/dev/null; then
+ $SUDO mount - -bind /$1 $LFS/$1
+ echo $LFS/$1 mounted
+ else
+ echo $LFS/$1 already mounted
+ fi
+}
+
+function mounttype
+{
+ if ! mountpoint $LFS/$1 >/dev/null; then
+ $SUDO mount -t $2 $3 $4 $5 $LFS/$1
+ echo $LFS/$1 mounted
+ else
+ echo $LFS/$1 already mounted
+ fi
+}
+
+if [ $EUID -ne 0 ]; then
+ SUDO=sudo
+else
+ SUDO=""
+fi
+
+if [ x$LFS == x ]; then
+ echo "LFS not set"
+ exit 1
+fi
+
+mountbind dev
+mounttype dev/pts devpts devpts -o gid=5,mode=620
+mounttype proc proc proc
+mounttype sys sysfs sysfs
+mounttype run tmpfs run
+mkdir $LFS/run/shm
+#mountbind usr/src
+#mountbind boot
+#mountbind home
+EOF</command></screen>
+
+ <para>
+ Note that the last three commands in the script are commented out. These
+ are useful if those directories are mounted as separate partitions on the
+ host system and will be mounted when booting the completed LFS/BLFS system.
+ </para>
+
+ <para>
+ The script can be run with <command>bash ~/mount-virt.sh</command> as
+ either a regular user (recommended) or as root. If run as a regular
+ user, sudo is required on the host system.
+ </para>
+
+ <para>
+ Another issue pointed out by the script is where to store downloaded
+ package files. This location is arbitrary. It can be in a regular
+ user's home directory such as ~/sources or in a global location like
+ /usr/src. Our recommendation is not to mix BLFS sources and LFS sources
+ in (from the chroot environment) /sources. In any case, the packages
+ must be accessible inside the chroot environment.
+ </para>
+
+ <para>
+ A last convenience feature presented here is to streamline the process
+ of entering the chroot environment. This can be done with an alias
+ placed in a user's ~/.bashrc file on the host system:
+ </para>
+
+<screen><command>alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root TERM="$TERM" PS1="\u:\w\\\\$ "
+PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash - -login'</command></screen>
+
+ <para>
+ This alias is a little tricky because of the quoting and levels of
+ backslash characters. It must be all on a single line. The above command
+ has been split in two for presentation purposes.
+ </para>
+
+ </sect3>
+
+ <sect3>
+ <title>Work remotely via ssh</title>
+
+ <para>
+ This method also provides a full graphical environment, but first
+ requires installing
+ <ulink url="&blfs-book;postlfs/openssh.html">sshd</ulink> and
+ <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>
+ on the LFS system, usually in chroot. It also requires a second
+ computer. This method has the advantage of being simple by not requiring
+ the complexity of the chroot environment. It also uses your LFS built
+ kernel for all additional packages and still provides a complete system
+ for installing packages.
+ </para>
+
+ </sect3>
+
+ <sect3>
+ <title>Work from the LFS command line</title>
+
+ <para>
+ This method requiures installing
+ <ulink url="&blfs-book;postlfs/make-ca.html">make-ca</ulink>,
+ <ulink url="&blfs-book;basicnet/wget.html">wget</ulink>,
+ <ulink url="&blfs-book;general/gpm.html">gpm</ulink>, and
+ <ulink url="&blfs-book;basicnet/links">links</ulink>
+ in chroot and then rebooting into the new LFS system. At this
+ point the default system has six virtual consoles. Switching
+ consoles is as easy as using the Alt-Fn key combinations where Fn is
+ between F1 and F6. The Alt-LeftArrow and Alt-RightArrow key
+ combinations also will change the console.
+ </para>
+
+ <para>
+ At this point you can log into two different virtual consoles and run
+ the links browser in one console and bash in the other. GPM then allows
+ copying commands from the browser with the left mouse button, switching
+ consoles, and pasting into the other console.
+ </para>
+
+ <note>
+ <para>
+ As a side note, switching of virtual consoles can also be done from
+ an X Window instance with the Ctrl-Alt-Fn key combination, but the
+ mouse copy operation does not work between the graphical interface
+ and a virtual console. You can return to the X Window display with
+ the Ctrl-Alt-Fn conbination where Fn is usually F7.
+ </para>
+ </note>
+
+ </sect3>
+
+ </sect2>
+
+
+</sect1>
diff --git a/chapter11/chapter11.xml b/chapter11/chapter11.xml
index 8b4c53a1d..9adb49473 100644
--- a/chapter11/chapter11.xml
+++ b/chapter11/chapter11.xml
@@ -15,5 +15,6 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="getcounted.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="reboot.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="whatnow.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="afterlfs.xml"/>
</chapter>
diff --git a/chapter11/reboot.xml b/chapter11/reboot.xml
index b4413f1ce..70979a191 100644
--- a/chapter11/reboot.xml
+++ b/chapter11/reboot.xml
@@ -9,17 +9,22 @@
<?dbhtml filename="reboot.html"?>
<title>Rebooting the System</title>
+ <para>
+ Now that all of the software has been installed, it is time to reboot
+ your computer. However, there are still a few things to check.
+ Here are some suggestions:</para>
- <para>Now that all of the software has been installed, it is time to reboot
- your computer. However, you should be aware of a few things. The system you
+
+<!--
+ The system you
have created in this book is quite minimal, and most likely will not have
the functionality you would need to be able to continue forward. By installing
a few extra packages from the BLFS book while still in our current chroot
environment, you can leave yourself in a much better position to continue on
once you reboot into your new LFS installation. Here are some suggestions:</para>
-
+-->
<itemizedlist>
-
+<!--
<listitem><para>A text mode browser such as <ulink
url='&blfs-book;basicnet/lynx.html'>Lynx</ulink>
will allow you to easily view the BLFS book in one virtual terminal, while
@@ -60,14 +65,21 @@
install <ulink
url='&blfs-book;basicnet/wpa_supplicant.html'>wpa_supplicant</ulink>.
</para></listitem>
+-->
+ <listitem>
+ <para>
+ Install any <ulink
+ url='&blfs-book;postlfs/firmware.html'>firmware</ulink> needed if the
+ kernel driver for your hardware requires some firmware files to function
+ properly.
+ </para>
+ </listitem>
- <listitem><para>Install <ulink
- url='&blfs-book;postlfs/firmware.html'>firmwares</ulink> if the kernel
- driver for your hardware require some firmware to function properly.
- </para></listitem>
-
- <listitem><para>Finally, a review of the following configuration files
- is also appropriate at this point.</para>
+ <listitem>
+ <para>
+ Finally, a review of the following configuration files
+ is also appropriate at this point.
+ </para>
<itemizedlist>
<listitem><para>/etc/bashrc </para></listitem>
@@ -86,14 +98,11 @@
</itemizedlist>
<para>Now that we have said that, let's move on to booting our shiny new LFS
- installation for the first time! First exit from the chroot environment:</para>
+ installation for the first time! <emphasis>First exit from the chroot
+ environment</emphasis>:</para>
<screen><userinput>logout</userinput></screen>
-<!-- We need to show the user the details...
- <para>Unmount the LFS file system hierarchy:</para>
-
-<screen><userinput>umount -Rv $LFS</userinput></screen>
--->
+<!-- We need to show the user the details...-->
<para>Then unmount the virtual file systems:</para>
@@ -106,8 +115,7 @@ umount -v $LFS/sys</userinput></screen>
<para>If multiple partitions were created, unmount the other
partitions before unmounting the main one, like this:</para>
-<screen role="nodump"><userinput>umount -v $LFS/usr
-umount -v $LFS/home
+<screen role="nodump"><userinput>umount -v $LFS/home
umount -v $LFS</userinput></screen>
<para>Unmount the LFS file system itself:</para>
diff --git a/chapter11/whatnow.xml b/chapter11/whatnow.xml
index 999926289..e477e21c8 100644
--- a/chapter11/whatnow.xml
+++ b/chapter11/whatnow.xml
@@ -8,7 +8,7 @@
<sect1 id="ch-finish-whatnow">
<?dbhtml filename="whatnow.html"?>
- <title>What Now?</title>
+ <title>Additional Resources</title>
<para>Thank you for reading this LFS book. We hope that you have
found this book helpful and have learned more about the system
@@ -38,7 +38,8 @@
</listitem>
<listitem>
- <para><ulink url="https://seclists.org/oss-sec/">Open Source Security Mailing List</ulink></para>
+ <para><ulink url="https://seclists.org/oss-sec/">Open Source Security
+ Mailing List</ulink></para>
<para>This is a mailing list for discussion of security flaws,
concepts, and practices in the Open Source community.</para>
@@ -46,7 +47,7 @@
</itemizedlist>
</listitem>
-
+<!--
<listitem>
<para>Beyond Linux From Scratch</para>
@@ -55,7 +56,7 @@
Book. The BLFS project is located at <ulink url="&blfs-book;"/>.
</para>
</listitem>
-
+-->
<listitem>
<para>LFS Hints</para>