<div dir="ltr">Hello,<div><br></div><div>I am trying to add lua-serial[1] into openwrt I have.</div><div>There is openwrt Makefile[2] and I modified it like this below:<br></div><div><br></div><div>--------------------------- [[below]] -----------------------------------------------------------</div><div>#<br># Copyright (C) 2015 OpenWrt.org<br>#<br># This is free software, licensed under the GNU General Public License v2.<br># See /LICENSE for more information.<br>#<br><br>include $(TOPDIR)/<a href="http://rules.mk">rules.mk</a><br><br>PKG_NAME:=lua-serial<br>PKG_VERSION:=1.0.0<br>PKG_RELEASE:=1<br>PKG_MAINTAINER:=Unwired Devices <<a href="mailto:info@unwds.com">info@unwds.com</a>><br>PKG_LICENSE:=MIT<br><br>PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz<br>#PKG_SOURCE_URL:=<a href="https://github.com/unwireddevices/lua-serial">https://github.com/unwireddevices/lua-serial</a><br>PKG_SOURCE_PROTO:=git<br>PKG_SOURCE_VERSION:=bd2e35d56ffe79db307341a70a51e3fbc1e698e9<br>PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)<br><br>PKG_INSTALL:=1<br><br>include $(INCLUDE_DIR)/<a href="http://package.mk">package.mk</a><br><br>define Package/lua-serial<br> SUBMENU:=Lua<br> SECTION:=lang<br> CATEGORY:=Languages<br> TITLE:=Lua Serial UART Library<br> URL:=<a href="https://github.com/unwireddevices/lua-serial">https://github.com/unwireddevices/lua-serial</a><br> DEPENDS:=+lua<br>endef<br><br>define Package/lua-serial/description<br> Serial port communication functions for Lua<br>endef<br><br>CONFIGURE_ARGS += \<br> --with-lua-inc=$(STAGING_DIR)/usr/include \<br> --with-lua-lib=$(STAGING_DIR)/usr/lib<br><br>define Build/Configure<br> $(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))<br>endef<br><br>define Build/Install<br>endef<br><br>define Package/lua-serial/install<br> $(INSTALL_DIR) $(1)/usr/lib/lua<br> $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/lin32/_ul_serial.so $(1)/usr/lib/lua/<br> $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/ul_serial.lua $(1)/usr/lib/lua/<br>endef<br><br>$(eval $(call BuildPackage,lua-serial))<br></div><div>------------------------------------------------------------------------------------------ <br></div><div><br></div><div><br></div><div>After I have compiled and flashed the firmware, I changed a bit of a lua source file below:</div><div>./package/lua-serial/src/ul_serial.lua<br></div><div><br></div><div>And I tried to clean and compile again and flashed it and checked to see if my change is applied well.</div><div>But my change is NOT applied at all.</div><div>I did :</div><div><div>- added some change in ./package/lua-serial/src/ul_serial.lua<br></div><div></div></div><div>- make package/lua-serial/clean<br></div><div>- make<br></div><div>- flashed new firmware</div><div>- check to see if my change is applied into /usr/lib/lua/ul_serial.lua
</div><div>But my change is not applied at all!<br></div><div><br></div><div>When I tried to "find -name ul_serial.lua" under the top openwrt directory, I get output like:</div><div><br></div><div>./package/lua-serial/src/ul_serial.lua<br>./staging_dir/target/root-mediatek/usr/lib/lua/ul_serial.lua<br>./build_dir/target/root.orig-mediatek/usr/lib/lua/ul_serial.lua<br>./build_dir/target/root-mediatek/usr/lib/lua/ul_serial.lua<br>./build_dir/target/lua-serial-1.0.0/ipkg-aarch64_cortex-a53_neon-vfpv4/lua-serial/usr/lib/lua/ul_serial.lua<br>./build_dir/target/lua-serial-1.0.0/ul_serial.lua<br>./build_dir/target/lua-serial-1.0.0/src/ul_serial.lua<br></div><div><br></div><div>And after I clean the package lua-serial with :</div><div>make -j25 V=s package/lua-serial/clean<br></div><div><br></div><div>I tried to "
find -name ul_serial.lua" under the top openwrt directory, I get output like:
</div><div>./package/lua-serial/src/ul_serial.lua</div><div>./staging_dir/target/root-mediatek/usr/lib/lua/ul_serial.lua<br>./build_dir/target/root.orig-mediatek/usr/lib/lua/ul_serial.lua<br>./build_dir/target/root-mediatek/usr/lib/lua/ul_serial.lua<br></div><div><br></div><div><div>./package/lua-serial/src/ul_serial.lua is original source code of my working package.</div><div>What are those below and why don't they get removed?</div><div><div><br></div><div>./staging_dir/target/root-mediatek/usr/lib/lua/ul_serial.lua<br>./build_dir/target/root.orig-mediatek/usr/lib/lua/ul_serial.lua<br>./build_dir/target/root-mediatek/usr/lib/lua/ul_serial.lua<br></div><div></div></div><div></div></div><div><br></div><div>How am I supposed to really clean previous built package?</div><div><br></div><div>And I'd like to understand build system architecture and behavior of openwrt.</div><div>Is there a good reference I can study?</div><div><br></div><div>Thank you very much in advance.</div><div>Jeonghum</div><div><br></div><div>[1] <a href="https://github.com/unwireddevices/lua-serial">https://github.com/unwireddevices/lua-serial</a></div><div>[2] <a href="https://github.com/unwireddevices/lua-serial/blob/master/openwrt/Makefile">https://github.com/unwireddevices/lua-serial/blob/master/openwrt/Makefile</a></div><div><br></div></div>