Make error when installing glibc after LFS chroot/bin/sh: Command substitution: Line 3: syntax error near unexpected token ')

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.