11.5. Getting Started After LFS

11.5.1. Deciding what to do next

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.

A server is the simpler category. Generally this consists of a web server such as the Apache HTTP Server and a database server such as MariaDB. However other services are possible. The operating system embedded in a single use device falls into this category.

On the other hand, a workstation is much more complex. It generally requires a graphical user environment such as LXDE, XFCE, KDE, or Gnome based on a basic graphical environment and several graphical based applications such as the Firefox web browser, Thunderbird email client, or LibreOffice office suite. These applications require many (several hundred depending on desired capabilities) more packages of support applications and libraries.

In addition to the above, there is a set of applications for system management for all kinds of systems. These applications are all in the BLFS book. Not all packages are needed in every environment. For example dhcpcd, is not normally appropriate for a server and wireless_tools, are normally only useful for a laptop system.

11.5.2. Work remotely via ssh

This method also provides a full graphical environment, but first requires installing Section 9.23, “OpenSSH-10.2p1” 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.

You may use the scp command to upload the package sources to be built onto the LFS system. If you want to download the sources onto the LFS system directly instead, install Section 9.18, “libtasn1-4.21.0”, p11-kit-0.26.1, Section 9.20, “make-ca-1.16.1”, and Section 9.22, “Wget-1.25.0” in chroot (or upload their sources using scp after booting the LFS system).

11.5.2.1. Work from the LFS host from an ssh session

This method provides a complete graphical environment where a full featured browser and copy/paste capabilities are available. This method allows using applications like the host's version of a graphical text editor.

In order to properly build packages in ssh session, you will also need some helper functions and a permanent sources directory.

cat > ~/helpers.sh << "EOF"
#!/bin/bash

xtar() {
    [ -z "$1" ] && { echo "Requires Package Name. Exiting."; return 1; }
    local file="$1"
    local dir
    dir=$(tar -tf "$file" | head -1 | cut -d'/' -f1)
    tar -xf "$file" || { echo "Tar extraction failed"; return 1; }
    cd "$dir" || { echo "Failed to cd into $dir"; return 1; }
}
export -f xtar

mcd() {
        mkdir -v $1
        cd $1
}
export -f mcd

ChekSums() {
    [ -z "$1" ] && { echo "Requires Package Name. Exiting."; return 1; }
    if [[ -f "$1" ]]; then
        echo "SHA256: $(sha256sum $1)"
        echo "MD5: $(md5sum $1)"
    else
        echo "File Does Not Exist"
    fi
}
export -f ChekSums
EOF

The script can be run with bash ~/helpers.sh as either a regular user (recommended) or as root. If run as a regular user, sudo is a required install.

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 /sources. In any case, the packages must be accessible inside the ssh session environment.

11.5.2.2. Work from the LFS command line

This method requires installing Section 9.18, “libtasn1-4.21.0”, p11-kit-0.26.1, Section 9.20, “make-ca-1.16.1”, Section 9.22, “Wget-1.25.0”, gpm, and links (or lynx) 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+Fx key combinations where Fx is between F1 and F6. The Alt+ and Alt+ combinations also will change the console.

At this point you can log into two different virtual consoles and run the links or lynx 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.

[Note]

Note

As a side note, switching of virtual consoles can also be done from an X Window instance with the Ctrl+Alt+Fx 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+Fx combination, where Fx is usually F1 but may be F7.