VII ‐ Some Bonus - Nimpoo/ft_linux GitHub Wiki
In this section, we will follow the Beyond Linux® From Scratch (systemd Edition) - Version r12.3-1144. It's the sequel of LFS. And this book is not like the first, it provides more advanced topics for adding more packages and customizations to your LFS system, like a desktop environment, a web server, a database server, etc...
So we will not follow this book like the previous one, we just go to the sections that interest us, and we will see how to set a GRUB2 theme.
Finally, I warn you, for each package, you probably need to download some dependencies, and these dependencies can require another dependencies, and so on. It can be a bit tedious, but it's worth it.
You have three types of dependencies:
- Required: The package needs this dependency to compile or run.
- Recommended: The package may not work properly (or literally don't work) without this dependency, but it can compile and run.
- Optional: The package can compile and run without this dependency, it's often used for running tests or making a documentation.
Personally, I always install the required and recommended dependencies, and sometimes the optional ones if I think they can be useful, so READ EVERY UTILITIES OF EACH DEPENDENCY.
It's very simple.
First (in the chroot
environment on your VM or directly on your LFS system), download the image you want as background image in the /usr/share/backgrounds/
directory.
Then, create the file /etc/default/grub
with the following content:
cat << EOF > /etc/default/grub
GRUB_BACKGROUND="/usr/share/backgrounds/your_image.png"
EOF
Then, run the following command to update the GRUB2 configuration AS root
ON YOUR LFS SYSTEM:
grub-mkconfig -o /boot/grub/grub.cfg
Reboot your system:
reboot
And voilà !
You can notice you need to modify the
/boot/grub/grub.cfg
file for change the menuentry name, around the 100 line, by defaultgrub-mkconfig
setsGNU/Linux
.
Here, the config is specific about the theme you want to use. You can find a lot of themes on the GNOME Look - GRUB2 Themes website, and in the repository of Jacksaur : Gorgeous-GRUB.
Generally, you will find a guide for set up the theme, sometimes a script provided by the author of the theme, sometimes you follow a list of instructions.
If we take the example of this theme : Sekiro. The instructions are:
git clone https://github.com/semimqmo/sekiro_grub_theme
cd sekiro_grub_theme
./install.sh
And it's done ! Some themes require to set the theme manually after downloading it, like that:
echo "GRUB_THEME=\"/path/to/theme/theme.txt\"" >> /etc/default/grub
You have a lot of documentation of this file. You can set custom options like the default timeout, the default menu entry, the resolution of the GRUB2 menu, etc... It's very interesting you can read the GRUB Manual for more information.
Each curl
and wget
have the same recommended dependency: libpsl
. So you can install it once for both.
libpsl
have 2 recommended dependencies: libidn
and libunistring
.
Let's start with libunistring
(on your VM, as root
):
wget https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.xz
And now as chroot
:
tar -xf libunistring-1.3.tar.xz
cd libunistring-1.3
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/libunistring-1.3 &&
make
make check # if you want to run the tests
make install
cd ..
rm -rf libunistring-1.3
And now go install libidn
(on your VM, as root
):
wget https://ftp.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz
And now as chroot
:
tar -xf libidn2-2.3.8.tar.gz
cd libidn2-2.3.8
./configure --prefix=/usr --disable-static &&
make
make check # if you want to run the tests
make install
cd ..
rm -rf libidn2-2.3.8
And now, we can install libpsl
(on your VM, as root
):
wget https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz
And now as chroot
:
tar -xf libpsl-0.21.5.tar.gz
cd libpsl-0.21.5
mkdir build &&
cd build &&
meson setup --prefix=/usr --buildtype=release &&
ninja
ninja test # if you want to run the tests
ninja install
cd ../..
rm -rf libpsl-0.21.5
You have another recommended dependency for wget
and curl
but it's for runtime, install it with all the other dependencies if you want. It's make-ca
: https://www.linuxfromscratch.org/blfs/view/systemd/postlfs/make-ca.html
Now, we can install wget
and curl
(on your VM, as root
):
wget https://ftp.gnu.org/gnu/wget/wget-1.25.0.tar.gz
wget https://curl.se/download/curl-8.15.0.tar.xz
And now as chroot
:
tar -xf wget-1.25.0.tar.gz
cd wget-1.25.0
./configure --prefix=/usr \
--sysconfdir=/etc \
--with-ssl=openssl &&
make
make check # if you want to run the tests
make install
cd ..
rm -rf wget-1.25.0
tar -xf curl-8.15.0.tar.xz
cd curl-8.15.0
./configure --prefix=/usr \
--disable-static \
--with-openssl \
--with-ca-path=/etc/ssl/certs &&
make
make test # if you want to run the tests
make install &&
rm -rf docs/examples/.deps &&
find docs \( -name Makefile\* -o \
-name \*.1 -o \
-name \*.3 -o \
-name CMakeLists.txt \) -delete &&
cp -v -R docs -T /usr/share/doc/curl-8.15.0
cd ..
rm -rf curl-8.15.0
And now you have curl
and wget
installed on your LFS system. You can directly install the tarballs on your LFS system. If you have some troubles with the wget
or curl
commands, install make-ca
.
You are ready to proceed with the installation of additional packages as per your requirements. Install whatever you want git
, nano
, neofetc
, rust
, etc... You will find a pleasure to install them on your LFS system.
My list of additional packages :
wget
curl
zsh
omz
nano
-
rust
(rustc
,cargo
,rustup
) git
gh
sudo
neofetch
brew
valgrind
gdb
doxygen
openssh
openssl
traceroute
zip
which
lynx
links