How to skip the download step when I compile package

after I made the first build of the whole openwrt system, all code packages are downloaded in the "dl" direcotry, and exacted to "build_dir/target_xxx" direcotry

if I modified a source file of some package,for example, package "dnsmasq", how can I compile with the modifed code directly, without downloading the dnsmasq source code from repository again?

e.g. make packege/dnsmasq/compile LOC=xx?

you can skip the download part as long as the tarball is in the dl folder but you still need to add your changes as patches [OpenWrt Wiki] Patching your application: Editing existing files

2 Likes

thank you for reply, I found there is a "USE_SOURCE_DIR" MACRO in package.mk, can i use it to compile package with local source instead of using "USE_GIT_SRC_CHECKOUT" or "USE_GIT_TREE" ,

ifdef USE_SOURCE_DIR
define Build/Prepare/Default
rm -rf $(PKG_BUILD_DIR)
$(if $(wildcard $(USE_SOURCE_DIR)/*),,@echo "Error: USE_SOURCE_DIR=$(USE_SOURCE_DIR) path not found"; false)
ln -snf $(USE_SOURCE_DIR) $(PKG_BUILD_DIR)
touch $(PKG_BUILD_DIR)/.source_dir
endef
endif

update

i modified the Makefile file in package/xxx/, set PKG_MIRROR_HASH :=skip
then modified the source of package, and make package/xxx/compile
it works as i expect

1 Like

Well the devs made openwrt easy to patch and to upstream those changes.
If you want to keep your changes local it's up to you only remember that you'll probably never going to upstream the kind of modifications you just managed.

1 Like