From 91f9a174b535628ce48a1a8f9c3dddc3b9389f06 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 9 Aug 2023 12:37:52 +0800 Subject: [PATCH 1/5] ncurses: Simplify documentation install command --- chapter08/ncurses.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chapter08/ncurses.xml b/chapter08/ncurses.xml index 58221d144..b51099001 100644 --- a/chapter08/ncurses.xml +++ b/chapter08/ncurses.xml @@ -158,8 +158,7 @@ ln -sfv libncurses.so /usr/lib/libcurses.so If desired, install the Ncurses documentation: -mkdir -pv /usr/share/doc/ncurses-&ncurses-version; -cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version; +cp -v -R doc -T /usr/share/doc/ncurses-&ncurses-version; From 7c306241b640614e28805de23becdd339fcb2d73 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 9 Aug 2023 22:29:44 +0800 Subject: [PATCH 2/5] coreutils: Use groupadd/groupdel for creating/removing dummy group They look better than "echo >>" and "sed -i". And I think an example showing how to use groupadd/groupdel is good anyway. The format of /etc/group is already shown in chapter 7. --- chapter08/coreutils.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chapter08/coreutils.xml b/chapter08/coreutils.xml index c72041b3b..7d715f2f3 100644 --- a/chapter08/coreutils.xml +++ b/chapter08/coreutils.xml @@ -116,7 +116,7 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ these tests are not skipped, add a temporary group and make the user tester a part of it: -echo "dummy:x:102:tester" >> /etc/group +groupadd -g 102 dummy -U tester Fix some of the permissions so that the non-&root; user can compile and run the tests: @@ -134,7 +134,8 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ Remove the temporary group: -sed -i '/dummy/d' /etc/group +groupdel dummy + Install the package: make install From 30e0a7b28fa9c2a1c2e0347cf62eef44448ab1b3 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 9 Aug 2023 22:39:53 +0800 Subject: [PATCH 3/5] gawk: Move the creation of awk.1 after the explanation of the previous command --- chapter08/gawk.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chapter08/gawk.xml b/chapter08/gawk.xml index a6b74460b..cc9348d90 100644 --- a/chapter08/gawk.xml +++ b/chapter08/gawk.xml @@ -61,12 +61,6 @@ su tester -c "PATH=$PATH make check" make LN='ln -f' install - The installation process already created awk - as a symlink to gawk, create its man page as a - symlink as well: - -ln -sv gawk.1 /usr/share/man/man1/awk.1 - The meaning of the overridden make variable: @@ -79,6 +73,12 @@ su tester -c "PATH=$PATH make check" + The installation process already created awk + as a symlink to gawk, create its man page as a + symlink as well: + +ln -sv gawk.1 /usr/share/man/man1/awk.1 + If desired, install the documentation: mkdir -pv /usr/share/doc/gawk-&gawk-version; From f0b518a01e2cfaf12c277ca6fb4cf30e96498d8a Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 10 Aug 2023 13:45:01 +0800 Subject: [PATCH 4/5] binutils: Remove libgprofng.a, add libgprofng.so into contents section --- chapter08/binutils.xml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/chapter08/binutils.xml b/chapter08/binutils.xml index 5ff11a755..1fd436bd1 100644 --- a/chapter08/binutils.xml +++ b/chapter08/binutils.xml @@ -153,7 +153,7 @@ cd build Remove useless static libraries: -rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,sframe,opcodes}.a +rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,gprofng,opcodes,sframe}.a @@ -168,7 +168,8 @@ cd build addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm, objcopy, objdump, ranlib, readelf, size, strings, and strip - libbfd.so, libctf.so, libctf-nobfd.so, libopcodes.so, and libsframe.so + libbfd.so, libctf.so, libctf-nobfd.so, libgprofng.so, + libopcodes.so, and libsframe.so /usr/lib/ldscripts @@ -416,6 +417,17 @@ cd build + + libgprofng + + A library containing most routines used by + gprofng + + libgprofng + + + + libopcodes From 93ec8b32bf6486d3fdb47bb11c5b91120d442647 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Mon, 14 Aug 2023 09:15:54 +0800 Subject: [PATCH 5/5] grub cfg: Add an explanation for the insmod commands --- chapter10/grub.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/chapter10/grub.xml b/chapter10/grub.xml index 965fa56c3..f232a1675 100644 --- a/chapter10/grub.xml +++ b/chapter10/grub.xml @@ -150,6 +150,24 @@ menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" { } EOF + + The insmod commands load the + GRUB modules named + part_gpt and ext2. + Despite the naming, ext2 actually supports + ext2, + ext3, and + ext4 filesystems. + The grub-install command has embedded some modules + into the main GRUB image (installed into + the MBR or the GRUB BIOS partition) to access the other modules + (in /boot/grub/i386-pc) without + a chicken-or-egg issue, so with a typical configuration these two + modules are already embedded and those two insmod + commands will do nothing. But they do no harm anyway, and they may + be needed with some rare configurations. + + From GRUB's perspective, the kernel files are relative to the partition used. If you used a separate /boot partition, remove /boot from the above