I am a beginner in Linux,ArticleIf you have any questions, please correct them. Thank you.
I did lfs7.1, but I heard that lfs7.0 will encounter the same error.
Many overseas users may encounter such an error when searching on Google. Some people say that the symbolic link from the/bin directory to the/tools/bin directory is incorrect, so it cannot be solved after all reconstruction, although I cannot solve this problem, we recommend that you try it out when encountering such a mistake.
The shell parser defaults to dash,#! /Bin/sh may use the default dash instead of the bash we installed in Chapter 5. But what about LFS in chroot? Besides, you have run the following command to change the default parser before installing glibc:
Sed-I'S | @ bash @ |/bin/bash |'Elf/LDD. Bash.In
I can proceed to this step. A similar problem has been encountered before, that is, if you use ')' After chroot, the error will occur. Of course, other methods are used to solve the problem. For example:
DL = $ (readelf-L/bin/sh | sed-n'S @. * interpret. */tools \ (. * \)] $ @ \ 1 @ P')
Sed-I"S | libs-o | libs-L/usr/lib-wl,-dynamic-linker = $ DL-o |"\
Scripts/test-installation.pl
Unset DL
Syntax Error near unexpected token ')'
The solution is to execute
Readelf-L/bin/sh | sed-n'S @. * interpret. */tools \ (. * \)] $ @ \ 1 @ P'
Expected result xxxxxxx is displayed,
Then
DL = xxxxxxx
I didn't answer the question at the linuxsir forum, so I began to suspect that it was a bash question ..
Lfs7.1 is installed with bash4.2. I tried to return to the environment in chapter 5, delete the content involved in bash installation, and then reinstall bash4.1.
That is, change bash4.2 to bash4.1. Remember to install by step
Return to the chroot environment. First, delete and recreate the/bin directory. Re-create the symbolic link to/tools/bin
Ln-SV/tools/bin/{bash, Cat, Echo, PWD, stty}/bin
An impulsive command
Dd = $ (uname-m)
If the call succeeds, no error is reported. Then you can use brackets.
Go back and install glibc.
Make
Smooth sailing.
I don't know if changing bash4.2 to 4.1 will affect subsequent installation. In short, you can refer to recruitment and removal.