2017年10月27日 星期五

tar 檔解開後 換位置 make build 不過

1.打make時出現的error


make[5]: *** No rule to make target 'xxx old file ', needed by 'xxx.o'.

[ ! -d "iptables-1.4.4" ] || make -C iptables-1.4.4 || exit $?
make[3]: Entering directory '/root/work/8197f_build/rtl819x_orig2/users/iptables-1.4.4'
make  all-recursive
make[4]: Entering directory '/root/work/8197f_build/rtl819x_orig2/users/iptables-1.4.4'
Making all in extensions
make[5]: Entering directory '/root/work/8197f_build/rtl819x_orig2/users/iptables-1.4.4/extensions'
  GEN      matches4.man
-e + ./libipt_addrtype.man
-e + ./libipt_ah.man
-e + ./libxt_cluster.man
-e + ./libxt_comment.man

-e + ./libxt_TRACE.man
  GEN      initext4.c
  CC       initext4.o
make[5]: *** No rule to make target '/ssd/home_ssd/jwsyu/8197f_apteam_sdk/rtl819x-SDK-v3.4.11C-full-package/rtl819x_orig2/linux-3.10/include/uapi/linux/posix_types.h', needed by 'libxt_tcpmss.o'.  Stop.
make[5]: Leaving directory '/root/work/8197f_build/rtl819x_orig2/users/iptables-1.4.4/extensions'
Makefile:1126: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/root/work/8197f_build/rtl819x_orig2/users/iptables-1.4.4'
Makefile:434: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/root/work/8197f_build/rtl819x_orig2/users/iptables-1.4.4'
Makefile:1643: recipe for target 'iptables-1.4.4' failed
make[2]: *** [iptables-1.4.4] Error 2
make[2]: Leaving directory '/root/work/8197f_build/rtl819x_orig2/users'
Makefile:472: recipe for target 'app' failed
make[1]: *** [app] Error 2
make[1]: Leaving directory '/root/work/8197f_build/rtl819x_orig2/users'
Makefile:165: recipe for target 'bins' failed
make: *** [bins] Error 2



2.到出錯的目錄用 grep 找出 有舊位置字串的檔案
  grep oldaddress
 發現是在  xxxxx.o.d

3.在出錯的目錄 將 .o.d砍掉
cd /root/work/8197f_build/rtl819x_orig2/users/iptables-1.4.4/extensions

find . -name "*.o.d"   | xargs rm -f

linux 找出所有的 soft link檔案



https://askubuntu.com/questions/522051/how-to-list-all-symbolic-links-in-a-directory

Parsing ls is a Bad Idea®, prefer a simple find in that case:

find . -type l -ls

To only process the current directory:

find . -maxdepth 1 -type l -ls


找出失效的 symlinks
https://unix.stackexchange.com/questions/34248/how-can-i-find-broken-symlinks


find . -xtype l




# 先把 -exec 後面的東西先清掉, 用 -print 來先確認輸出
# rm 可以多用 -i 的參數來加以確認
find . -name "*.php" -exec rm -i {} \;
#
# 系統直接刪除
find . -delete -name "*.php"
find . -name "*.php" | xargs /bin/rm -rf