From 5e4ff8cb2e04ddadea4f0401725caeb4c32a0ee9 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Fri, 13 Jun 2025 15:52:08 +0200 Subject: [PATCH] Fix "Too many levels of symbolic links" in chapter 8 ncurses The problem is that TIC_PATH is nor honored anymore in chapter 6, so that tic from the host is used to create the terminfo database in chapter 6. The problem is that old versions of tic create symlinks in the database, while newer versions create hardlinks. Since we use a DESTDIR install in chapter 8 (with a recent version of ncurses, so with hardlinks), and copy it in place with cp -a, then it seems that copying hardlinks to symlinks. If an old version of tic has been used in chapter 6, this copies hardlinks to symlinks, which creates symlinks pointing to themselves (cp bug?). Anyway, the solution is to copy the auxilliary tic built in chapter 6 to $LFS/tools/bin (suggestion by Xi Ruoyao). Now, there is no need to set TIC_PATH or whatever because this tic is in the PATH. Bug first reported by Marcin Dulak. Analysis with the help of Bruce Dubbs and Thomas Trepl. Fixes https://wiki.linuxfromscratch.org/lfs/ticket/5744 --- chapter06/ncurses.xml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index 2d2baf7dc..a29bcea7f 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -44,13 +44,16 @@ Installation of Ncurses First, run the following commands to build the tic - program on the build host: + program on the build host. We install it in + $LFS/tools, so that it is found + in the PATH when needed: mkdir build pushd build - ../configure AWK=gawk + ../configure --prefix=$LFS/tools AWK=gawk make -C include make -C progs tic + install progs/tic $LFS/tools/bin popd Prepare Ncurses for compilation: @@ -147,28 +150,14 @@ popd Install the package: -make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install +make DESTDIR=$LFS install ln -sv libncursesw.so $LFS/usr/lib/libncurses.so sed -e 's/^#if.*XOPEN.*$/#if 1/' \ -i $LFS/usr/include/curses.h - The meaning of the install options: - - TIC_PATH=$(pwd)/build/progs/tic - - We need to pass the path of the newly built - tic program that runs on the building machine, so - the terminal database can be created without errors. - - - ln -sv libncursesw.so $LFS/usr/lib/libncurses.so