openwrt:install: cannot create directory ‘XXX’:File exists 的出错处理

OpenWrt 专栏收录该内容
6 篇文章 0 订阅

用openwrt把一个程序编译成固件时,出现下面的错误输出:

install -m0755 /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/daemon.sh /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/ipkg-ramips_24kec/kf580client/bin/
install -m0755 /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/o2_machine /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/ipkg-ramips_24kec/kf580client/bin/
install -d -m0755 /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/br_machine /home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/ipkg-ramips_24kec/kf580client/bin/
install: cannot create directory '/home/Joker/trunk/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/kf580client/br_machine': File exists
make[3]: *** [/home/Joker/trunk/bin/ramips/packages/base/kf580client_0.1-1_ramips_24kec.ipk] Error 1
make[3]: Leaving directory `/home/Joker/trunk/package/kf580client'
make[2]: *** [package/kf580client/compile] Error 2
make[2]: Leaving directory `/home/Joker/trunk'
make[1]: *** [/home/Joker/trunk/staging_dir/target-mipsel_24kec+dsp_musl-1.1.11/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/Joker/trunk'
make: *** [world] Error 2

后来在仔细检查要编译的程序的Makefile时,发现在define Packet/$(PKG_NAME)/install时发现关键字用错了:

 define Package/$(PKG_NAME)/install
 $(INSTALL_DIR) $(1)/bin
 $(INSTALL_BIN) $(PKG_BUILD_DIR)/daemon.sh $(1)/bin/
 $(INSTALL_BIN) $(PKG_BUILD_DIR)/o2_machine $(1)/bin/
 $(INSTALL_DIR) $(PKG_BUILD_DIR)/br_machine $(1)/bin/


第5行,正确的是$(INSTALL_BIN),但我错写成了$(INSTALL_DIR),最终导致出错。


                
  • 2
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值