diff --git a/.gitignore b/.gitignore
index f2a347215..9595dd32f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
lfs-bootscripts-*.tar.xz
+lfs-*.tar.xz
conditional.ent
version.ent
appendices/*.script
diff --git a/Makefile b/Makefile
index 44613e813..6c7d5b427 100644
--- a/Makefile
+++ b/Makefile
@@ -224,5 +224,14 @@ dump-commands: validate
all: book nochunks pdf dump-commands
-.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list version
+dist:
+ $(Q)DIST=/tmp/LFS-RELEASE ./git-version.sh $(REV)
+ $(Q)rm -f lfs-$$(patch -Np1 -i ../&glibc-memalign-patch;
+
+ Then fix a security vulnerability exploitable when the
+ option is used in
+ /etc/resolv.conf:
+
+sed \
+ -E "/__res_context_search/\
+ {N;N;s/(search \(([^,]*,){6}[^,]*)NULL/\1\&alt_dns_packet_buffer/}" \
+ -i resolv/nss_dns/dns-host.c
+
The Glibc documentation recommends building Glibc
in a dedicated build directory:
diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml
index 3d2837d9a..1e215eba2 100644
--- a/chapter08/stripping.xml
+++ b/chapter08/stripping.xml
@@ -29,9 +29,12 @@
needed by the linker (for static libraries) or dynamic linker (for
dynamically linked binaries and shared libraries).
- The debugging symbols from selected libraries are preserved
- in separate files. That debugging information is needed to run
- regression tests with
+ The debugging symbols from selected libraries are compressed with
+ Zlib and preserved in separate files. That
+ debugging information is needed to run regression tests with valgrind or gdb later, in BLFS.
@@ -77,7 +80,7 @@
cd /usr/lib
for LIB in $save_usrlib; do
- objcopy --only-keep-debug $LIB $LIB.dbg
+ objcopy --only-keep-debug --compress-debug-sections=zlib $LIB $LIB.dbg
cp $LIB /tmp/$LIB
strip --strip-unneeded /tmp/$LIB
objcopy --add-gnu-debuglink=$LIB.dbg /tmp/$LIB
diff --git a/git-version.sh b/git-version.sh
index db2ed62a1..5d8d32e5d 100755
--- a/git-version.sh
+++ b/git-version.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
if [ "$1" = sysv ]; then
SYSV="INCLUDE"
@@ -14,6 +14,10 @@ fi
echo "" > conditional.ent
echo "" >> conditional.ent
+if [ -e LFS-RELEASE ]; then
+ exit 0
+fi
+
if ! git status > /dev/null; then
# Either it's not a git repository, or git is unavaliable.
# Just workaround.
@@ -65,3 +69,5 @@ echo "" >> version.ent
echo "]]>" >> version.ent
echo "" >> version.ent
echo "" >> version.ent
+
+[ -z "$DIST" ] || echo $version > "$DIST"