mount /dev/sda9 /mnt/lfs mount -v --bind /dev $LFS/dev mount -vt devpts devpts $LFS/dev/pts mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys if [ -h $LFS/dev/shm ]; then link=$(readlink $LFS/dev/shm) mkdir -p $LFS/$link mount -vt tmpfs shm $LFS/$link unset link else mount -vt tmpfs shm $LFS/dev/shm fi chroot "$LFS" /tools/bin/env -i \ HOME=/root \ TERM="$TERM" \ PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ /tools/bin/bash --login +h
make: /bin/sh: Command not found Makefile:579: /sources/linux-3.10/arch//Makefile: No such file or directory make: gcc: Command not found添加連接:
ln -sf /bin/bash /bin/sh ln -sv /tools/lib/ld-linux.so.2 /lib/ld-linux.so.2
(過後好像發現添加連接不對,應該複製) linux
3. 該中文版文檔提供的Man-pages包下載地址失效了,以前沒下到這個包,到 這裏能夠下載。別把Man-pages和Man-DB當成一個了。
4.glibc測試以後執行grep Error glibc-check-log ,顯示以下錯誤: shell
make[2]: [/sources/glibc-build/posix/annexc.out] Error 1 (ignored) make[2]: *** [/sources/glibc-build/nptl/tst-cancel4.out] Error 1 make[2]: *** [/sources/glibc-build/nptl/tst-cancel5.out] Error 1 make[2]: *** [/sources/glibc-build/nptl/tst-cancelx4.out] Error 1 make[2]: *** [/sources/glibc-build/nptl/tst-cancelx5.out] Error 1 make[1]: *** [nptl/tests] Error 2 make[2]: [/sources/glibc-build/conform/run-conformtest.out] Error 1 (ignored)和文檔聲明的可忽略錯誤不大一致,但忽略以後也沒遇到問題
經常使用中文區域數據 : express
localedef -i zh_CN -f GB18030 zh_CN localedef -i zh_CN -f GBK zh_CN localedef -i zh_CN -f UTF-8 zh_CN localedef -i zh_CN -f GB2312 zh_CN localedef -i zh_HK -f UTF-8 zh_CN localedef -i zh_HK -f BIG5-HKSCS zh_CN localedef -i zh_TW -f EUC-TW zh_CN localedef -i zh_TW -f UTF-8 zh_CN localedef -i zh_TW -f BIG5 zh_CN
5.binutils包,make出錯: api
make[2]: *** [info-recursive] Error 1 make[2]: Leaving directory `/sources/binutils-build/bfd' make[1]: *** [all-bfd] Error 2 make[1]: Leaving directory `/sources/binutils-build' make: *** [all] Error 2make clean, make distclean,重來一遍,竟然好了
6.安裝gcc,安裝測試成功後有個: bash
echo 'main(){}' > dummy.c cc dummy.c -v -Wl,--verbose &> dummy.log readelf -l a.out | grep ': /lib'應該有輸出,可我這沒有。不事後面幾個檢查都正常
7.coreutils,make出錯: ide
help2man: can't get '--help' info from man/expr.td/expr make[2]: *** [man/expr.1] Error 127 make[2]: Leaving directory `/sources/coreutils-8.21' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/sources/coreutils-8.21' make: *** [all] Error 2
這個有點麻煩,出錯緣由可能在上面gcc那裏,dummy函數測試沒有輸出,可要是從新從gcc那開始也太麻煩了。參照這裏的一個帖子,我拼湊出了個解決辦法,有可能不對: 函數
執行 測試
expr --help輸出大概是
./expr: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory ui
說明加載libgmp.so.10這個共享庫時出錯了,在coreutls-8.21目錄下執行 spa
ldd src/expr輸出相似下面:
linux-vdso.so.1 (0x00007fffad9a9000)
libgmp.so.10 => not found
libc.so.6 => /tools/lib/libc.so.6
我仿照前面的章節本身給它添加了連接
mv -v /usr/lib/libgmp.so.10* /lib/ ln -sfv /lib/libgmp.so.10 /usr/lib/libgmp.so.10
以後make就經過了。
但執行ldconfig -v 檢查還有問題,還帶出來前面的一個(據狀況而定):
ldconfig: Cannot stat /usr/lib/libncursesw.so: No such file or directory
ldconfig: Cannot stat /usr/lib/libgmp.so: No such file or directory
如下兩條命令修復:
ln -sfv /lib/libncursesw.so.5 /usr/lib/libncursesw.so ln -sfv /lib/libgmp.so.10 /usr/lib/libgmp.so
/bin/sh: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory make: [install] Error 127 (ignored)
又是動態庫的問題
ln -sv /lib/libncursesw.so.5 /tools/lib/libncursesw.so.5
make[4]: Entering directory `/sources/gettext-0.18.1.3/gettext-tools/src' /bin/sh ../libtool --tag=CC --mode=link gcc -std=gnu99 -g -O2 -o msgcmp msgcmp-msgcmp.o msgcmp-msgl-fsearch.o libgettextsrc.la -lm libtool: link: cannot find the library `/mnt/lfs/sources/gettext-0.18.1.3/gettext-tools/gnulib-lib/libgettextlib.la' or unhandled argument `/mnt/lfs/sources/gettext-0.18.1.3/gettext-tools/gnulib-lib/libgettextlib.la' make[4]: *** [msgcmp] Error 1 make[4]: Leaving directory `/sources/gettext-0.18.1.3/gettext-tools/src'
10.編譯iproute2-3.9.0,make出錯:
lnstat.c: In function 'build_hdr_string': lnstat.c:169:30: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] memset(th.hdr[i], 0, sizeof(th.hdr[i]));
sed -i -e 's/utmpdump/d' \ -e '/mountpoint/d' src/Makefilesed: -e expression #1, char 12: unterminated `s' command 把那個s去掉就行了