學習Linux From Scratch的部分總結記錄 今天上午終于解決了最後一個錯誤,使得LFS終于可以正常啟動運作了。前前後後折騰了10來天左右,感覺辛苦,累;但真心有收獲,接觸了各種詭異的指令,還有各種詭異的系統啟動時需要的檔案。之前一直在使用debian,學習如何使用linux,真正了解并熟悉這個系統,我想這個--Linux From Scratch,是不可缺少的。
今天上午的最後一個錯誤是:在登入時,輸入使用者名和密碼之後,bash提示:cannot execute /bin/bash :No such file or directory錯誤。在網絡google了一下,看了十個八個的網頁,終于發現一個部落格上也記錄到這種錯誤,不是之前我認為的bash配置錯誤,而是/etc/passwd檔案寫錯了,在passwd檔案第一行:root:x:0:0:root/root:/bin/bash,之後被我添加了一個空格,習慣性的敲完一句後,敲了一個空格。唉,錯誤的習慣害死人。那行最後是不能有空格的。。。。。
還有之前出現的gpm錯誤,也是由于/etc/sysconfig/mouse配置檔案寫錯了,出現了MDEVICE無法擷取的錯誤。最後還是删除了那個配置檔案,重寫了。
最郁悶的一個認知是:linux不是一個系統,是一個核心。要知道,我之前天天嘴巴上喊:“linux系統”,丢大發了都。
幾個注意點: 1.得熟悉linux的指令,這樣才能區分指令中的數字“1”和字母“l“。太損了........ 2.工具鍊的編譯調整,要非常小心,我錯了兩次,非常細微,汗.... 3.編譯tcl時出現139錯誤,就是前期的工具鍊的錯誤.... 4.最坑人的,小破本上在虛拟機裡編譯gcc,居然花了3hours還多;在桌上型電腦上編譯,需要1hours不到,直接就宣判俺的小破本該報廢了不是.... 5.出現錯誤,學着利用google去查主題的郵件清單還有相關錯誤文章,盡管有些是英文的。因為通常我們都不是第一個犯那種錯誤的人,外國人也一樣啊,哈哈!如以下 Glibc make 錯誤:
Hello:
I'm following book version 6.7 on host distribution lfslivecd-x86-6.3-r2145-min running in a VirtualBox VM on a Core2Duo Macbook Pro. I have attempted to not deviate from the book instructions. At this time I cannot easily run the version-check.sh script because I cannot copy/paste to the VM's console. But, I figure having progressed this far, it's probably OK.
In section 6.9 I encountered an error issuing "make install" for Glibc-2.12.1. It ran for a while then stopped with:
CC="gcc" /usr/bin/perl scripts/test-installation.pl /sources/glibc-build/usr/bin/ldd: line 126: /tmp/test-prg30149: cannot execute binary file
ldd execution failed at scripts/test-installation.pl line 182
make[1]: *** [install] Error 1
In the previous step the tests were all good except for the expected posix/annexc and a couple math tests.
Is this a show-stopper? Any suggestions as to how to proceed?
Thank you.
-Casey
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page
) Casey,
Hmm... it appears that you didn't run one of the commands given in the
book.
QUOTING FROM THE BOOK: Section 6.9
When running *make install*, a script called test-installation.pl performs a
small sanity test on our newly installed Glibc. However, because our
toolchain still points to the /tools directory, the sanity test would be
carried out against the wrong Glibc. We can force the script to check the
Glibc we have just installed with the following:
DL=$(readelf -l /bin/sh | sed -n '[email protected]*interpret.*/tools\(.*\)][email protected]\[email protected]')
sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \
scripts/test-installation.pl
unset DL