LFS 7.9, chap.6.7 fails on make mrproper
Hi all, I've already completed a build of LFS 7.9 upto chap 6.73. Did it by cutting pasting commands into a console. Now I've started to automate by putting commands into shell scripts. Section 5 works and section 6 works up to ch 6.7. the scripts are simple at this point containing just the commands shown in LFS book.
Ch 6.7 fails as follows: "... make -f ./scripts/Makefile.clean obj=Documentation/DocBook make -f ./scripts/Makefile.clean obj=scripts make -f ./scripts/Makefile.clean obj=scripts/basic make -f ./scripts/Makefile.clean obj=scripts/dtc make -f ./scripts/Makefile.clean obj=scripts/gdb make -f ./scripts/Makefile.clean obj=scripts/gdb/linux make -f ./scripts/Makefile.clean obj=scripts/genksyms make -f ./scripts/Makefile.clean obj=scripts/kconfig make -f ./scripts/Makefile.clean obj=scripts/mod make -f ./scripts/Makefile.clean obj=scripts/package make -f ./scripts/Makefile.clean obj=scripts/selinux make -f ./scripts/Makefile.clean obj=scripts/selinux/genheaders make -f ./scripts/Makefile.clean obj=scripts/selinux/mdp rm -rf rm -f CHK include/generated/uapi/linux/version.h UPD include/generated/uapi/linux/version.h HOSTCC scripts/basic/fixdep /bin/sh: line 1: 21739 Segmentation fault scripts/basic/fixdep scripts/basic/.fixdep.d scripts/basic/fixdep 'gcc -Wp,-MD,scripts/basic/.fixdep.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -o scripts/basic/fixdep scripts/basic/fixdep.c ' > scripts/basic/.fixdep.tmp make[1]: *** [scripts/basic/fixdep] Error 139 scripts/Makefile.host:91: recipe for target 'scripts/basic/fixdep' failed make: *** [scripts_basic] Error 2 Makefile:439: recipe for target 'scripts_basic' failed" It is the "make mrproper" command that fails. I used make V=1 mrproper to generate the output. If instead of running the script I enter the command into the same console it works as follows: bash-4.3# make mrproper CLEAN scripts/basic CLEAN include/generated bash-4.3# Have tried #!/tools/bin/bash and #!/bin/bash as script header, both fail. Also observed that the script can echo text but cannot read input. So "echo foobar" works but "read -p foobar" does not. running script with set -ex shows that it does not fail on the read -p, its just ignored. Running 'expect -c "spawn ls"' at the top of the script produces correct output. I've searched for this problem and found similar errors but for those that had solutions they do not work. the most promising was to create these outside of a script: mknod -m 600 $LFS/dev/console c 5 1 mknod -m 666 $LFS/dev/null c 1 3 Did it but did not work. Hope someone can help. |
Post your actual script that is failing and PLEASE use code tags
http://www.linuxquestions.org/questi....php?do=bbcode |
Is
Code:
mount -v --bind /dev $LFS/dev Can you do this part manuely along with the chroot. |
spiky0011:
will try Code:
mount -v --bind /dev $LFS/dev, etc... The output of version-check: Code:
bash, version 4.2.53(2)-release the script is shown below: Code:
#!/bin/bash |
Well just ran your script ( on version 4.2 ) and no problems at all both in a chroot environment and not and with/without dev etc mounted in the chroot, so I must assume you have a badly mounted LFS partition or a corrupt kernel archive ( unlikely but check the md5sum ) or something went weirdly wrong earlier and you have some cross contamination from the host system, what happens if you run your script in the host system? does it fail there?
|
Keith, i'm not home yet so cant check this but how can I test for a badly mounted LFS partition? also if I remember correctly these are the things to note:
I can complete all chap 5.04 through to 6.73 if I cut / paste into a console. Using the same user setup and source I can run chaps 5.04 to 5.34 in a script, then if I manually run chap 6 commands then success. If I run the same chap 6 commands as scripts like I sent you then chap 6.07 fails. I have tried to run the script I sent you in an xterm, rxvt and then out of X in a console with same failure. I have checked from within chroot the following: Code:
mkdir -pv $LFS/{dev,proc,sys,run} What I was hoping would be meaningful is the fact that it seems stdout and stderr work ok but not stdin in the script I sent you. Maybe a red herring? will let you guys know as soon as I've made progress |
stdin is not used in the script you posted, as you don't do any reads.
|
Quote:
|
Keith, two points:
1. yes I did run those commands before entering chroot otherwise even manual running of scripts would not work. sorry if gave you wrong understanding, I meant I checked those from within chroot. 2. the script I sent you is exactly the one that I first ran and got error. I then added read -p lines to be able to pause it and check what was going on and that is when I realized stdin was being ignored. Furthermore I repeated some tests last night and can definitely say that after completing chap 6 manually up to part 6, then running part 7 'linux headers' manually I get no failures. If I run the same commands in a script I get the segmentation fault at make mrproper, which may mean that the bash build (in 5.16) went wrong but I did not see any errors. |
Try running ( from the chroot )
Code:
ldd $(which bash) |
At the point of entering chroot there is no 'which' so cant do what you ask but the
result of ldd /bin/bash (which points to /tools/bin/bash) is: Code:
ldd /bin/bash thanks |
You are of course correct there is no 'which' at that stage! Sorry, just goes to prove that no matter how many times you build LFS you can still make stupid mistakes!
Your ldd output looks fine so I can't understand why your script is failing, something went subtly wrong during the tools build phase I'm guessing, don't know what else to suggest :( |
What happens if you chroot in manualy and complete all of Ch6 to 6.6 manualy, Then run script from Ch6.7
|
spiky0011: the way you suggest fails as well. But I may have found a solution.
I completed all of chap 5 via automated scripts; completed chap 6 up to & including part 6.6 manually, then continued with 6.7, etc manually. By doing cut/paste the steps are known to work. Then during part 6.17. GCC-5.3.0 build, I entered another chroot via an xterm and ran a test script: Code:
!/bin/bash I need to repeat this later to verify that nothing installed during 6.7 to 6.16 influenced things. Note that 6.17 was still running tests so had not installed anything at that point. So one of two things could be true: 1. something done between 6.7 - 6.16 provided a fix 2. something in the initial chroot environment is screwed Remember that in chap 6 we do'chroot' and then an 'exec /tools/bin/bash --login +h' before we start make mrproper whereas entering another chroot environment we simply do chroot, the files /etc/passwd and /etc/group exist already so we don't have to do another login. I'm speculating, not saying this is the solution; and it is probable that something is wrong in my chap 5 tools. However if I have found the solution it may point to the problem, kind of reverse engineering ;-) hopefully I can provide a definite answer soon. |
[SOLVED] LFS 7.9, chap.6.7 fails on make mrproper
I've figured out the cause of the problem. I had archived the tools from two separate runs of chap 5. #2 I had used to compare to Slackware binaries, but I had deleted all locales, manpages & docs from it to save space. Stupidly this is the one I had restored later.
I've restored the pristine archive and verified that that results in everything working just fine. The automated scripts work as expected. After some quick tests I think that the problem wasn't 'bash' but 'make' was failing on some line of the kernel makefile. As well, the reading of stdin is solved as well. Haven't looked deeper into this but with 'LC_ALL=POSIX' defined but no locales, (even /usr/share/i18n was empty) it caused my problem. So I'm marking this thread as solved. Thanks to all for the help. |
All times are GMT -5. The time now is 08:16 AM. |