From 99763cbee40d58bfc80eaf782669af7fcd0e592e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ant=C3=B4nio?= Date: Mon, 24 Jan 2022 16:48:51 -0300 Subject: [PATCH 1/3] Use `find`(1) insead of directly passing `/tools/lib` to `strip`(1). This prevent those "strip: Warning: foo/bar is a directory" warnings, also strips all the libraries present. --- doc/2-toolchain/34-Stripping_and_Ownership | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/2-toolchain/34-Stripping_and_Ownership b/doc/2-toolchain/34-Stripping_and_Ownership index 5103892..6b77434 100644 --- a/doc/2-toolchain/34-Stripping_and_Ownership +++ b/doc/2-toolchain/34-Stripping_and_Ownership @@ -6,7 +6,7 @@ # of unneeded debugging symbols. # Remove debug symbols with: -strip --strip-debug /tools/lib/* +find /tools/lib -type f -exec strip --strip-debug {} \; /usr/bin/strip --strip-unneeded /tools/{,s}bin/* # Remove the documentation: From 35877129b1c0b53b5175adc1b124da86d92b885b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ant=C3=B4nio?= Date: Mon, 24 Jan 2022 21:58:16 -0300 Subject: [PATCH 2/3] `--strip-unneeded` instead of `--strip-debug` --- doc/2-toolchain/34-Stripping_and_Ownership | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/2-toolchain/34-Stripping_and_Ownership b/doc/2-toolchain/34-Stripping_and_Ownership index 6b77434..ec43226 100644 --- a/doc/2-toolchain/34-Stripping_and_Ownership +++ b/doc/2-toolchain/34-Stripping_and_Ownership @@ -6,7 +6,7 @@ # of unneeded debugging symbols. # Remove debug symbols with: -find /tools/lib -type f -exec strip --strip-debug {} \; +find /tools/lib -type f -exec strip --strip-unneeded {} \; /usr/bin/strip --strip-unneeded /tools/{,s}bin/* # Remove the documentation: From de81741c430fa52f041b7039f3d77db5d0d9a330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ant=C3=B4nio?= Date: Tue, 25 Jan 2022 14:12:06 -0300 Subject: [PATCH 3/3] Remove `.*.cmd` and `Makefile` files from `/usr/include`, not from the Linux kernel source tree I think we don't want to "harm" the source tree, so we won't be needing to extract the source tarball two times. --- doc/3-Chroot/005-Kernel_Headers | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/3-Chroot/005-Kernel_Headers b/doc/3-Chroot/005-Kernel_Headers index 5384e5a..30ef08d 100644 --- a/doc/3-Chroot/005-Kernel_Headers +++ b/doc/3-Chroot/005-Kernel_Headers @@ -19,20 +19,18 @@ patch -Np1 -i ../patches/kernel/include-uapi-linux-swab-Fix-potentially-missing- # For kernels 5.3.x and newer: make headers -# There are also some hidden files used by the kernel -# developers and not needed by MLFS that are removed -# from the intermediate directory. -# Kernels up to 5.2.x: -# find dest/include \( -name .install -o -name ..install.cmd \) -exec rm -rvf {} \; - -# Kernels 5.3.x and newer: -find usr/include -name '.*' -exec rm -rvf {} \; - # Install Headers # Kernel up to 5.2.x: # cp -rv dest/include/* /usr/include # Kernels 5.2.x and newer: cp -rv usr/include/* /usr/include -rm -v /usr/include/Makefile +# After installed, there still are also some hidden +# files used by the kernel developers (for what?) +# and not needed by MLFS that now can be removed +# from our /usr/include. +find /usr/include -name '.*' -exec rm -vf {} \; + +# The Makefile present also won't be used +rm -v /usr/include/Makefile