Building a package: what am I doing wrong?

Hi all,

For some reason I'm getting errors when trying to build my package.
What I have:

  • x86-64 cpu and Linux Mint running on it
  • SDK form here:

https://downloads.openwrt.org/releases/23.05.3/targets/x86/64/

Files (only scripts and some config files) inside /home/myusesrname/geoip-shell/OpenWrt/owrt-build/files
(there is files/usr/bin, files/usr/lib, files/etc/init.d etc etc)

  • This Makefile in /home/myusesrname/geoip-shell/OpenWrt/owrt-build:
Summary
include $(TOPDIR)/rules.mk

PKG_NAME:=geoip-shell
PKG_VERSION:=0.3.4
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later

include $(INCLUDE_DIR)/package.mk

define Package/geoip-shell
SECTION:=net
CATEGORY:=Network
TITLE:=geoip-shell
DEPENDS:=+firewall4 +ca-bundle
PKGARCH:=all
endef

define Package/geoip-shell/description
(some description)
endef

define Build/Prepare
endef

define Build/Configure
endef

define Build/Compile
endef

define Package/geoip-shell/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_CONF) ./files/etc/init.d/geoip-shell-init $(1)/etc/init.d

$(INSTALL_DIR) $(1)/etc/geoip-shell
$(INSTALL_CONF) ./files/etc/geoip-shell/geoip-shell.conf $(1)/etc/geoip-shell
$(INSTALL_CONF) ./files/etc/geoip-shell/cca2.list $(1)/etc/geoip-shell
$(INSTALL_CONF) ./files/etc/geoip-shell/geoip-shell-constants $(1)/etc/geoip-shell

$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-fetch.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-fw-include.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-backup.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-geoinit.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-run.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-uninstall.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-mk-fw-include.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-manage.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-apply.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-detect-lan.sh $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/geoip-shell-cronsetup.sh $(1)/usr/bin

$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-status.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-backup-nft.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-ip-regex.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-apply-nft.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-status-nft.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-owrt-common.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-common.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-arrays.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-setup.sh $(1)/usr/lib
$(INSTALL_CONF) ./files/usr/lib/geoip-shell-lib-nft.sh $(1)/usr/lib
endef

$(eval $(call BuildPackage,geoip-shell))
  • modified feeds.conf.default file:
Summary
src-link local /home/myusesrname/geoip-shell/OpenWrt/owrt-build
src-git-full base https://git.openwrt.org/openwrt/openwrt.git;openwrt-23.05
src-git packages https://git.openwrt.org/feed/packages.git^8e3a1824645f5e73ec44c897ac0755c53fb4a1f8
# src-git luci https://git.openwrt.org/project/luci.git^7739e9f5b03b830f51d53c384be4baef95054cb3
# src-git routing https://git.openwrt.org/feed/routing.git^83ef3784a9092cfd0a900cc28e2ed4e13671d667
# src-git telephony https://git.openwrt.org/feed/telephony.git^9746ae8f964e18f04b64fbe1956366954ff223f8
  • I ran menuconfig and deselected Select all [target|kernel module|userspace] packages by default.

When running ./scripts/feeds update -a, I'm getting this output:

Summary
Updating feed 'local' from '/home/myusername/geoip-shell/OpenWrt/owrt-build' ...
Updating feed 'base' from 'https://git.openwrt.org/openwrt/openwrt.git;openwrt-23.05' ...
Already up to date.
Updating feed 'packages' from 'https://git.openwrt.org/feed/packages.git^8e3a1824645f5e73ec44c897ac0755c53fb4a1f8' ...
Create index file './feeds/local.index'
grep: feeds/local/Makefile:$(eval: No such file or directory
grep: $(call: No such file or directory
grep: BuildPackage,geoip-shell))/Makefile: No such file or directory
/home/myusername/owrt-sdk/feeds/local.tmp/info/.files-packageinfo.mk:1: *** target pattern contains no '%'.  Stop.
Collecting target info: done
Create index file './feeds/base.index'
Create index file './feeds/packages.index'

So it looks like something is wrong with the Makefile? Or is my build system misconfigured? Help will be appreciated.

I tried copying the pbr package and making a local feed out of it, then running
./scripts/feeds update -a

Getting similar errors with it:

Create index file './feeds/local.index'
grep: feeds/local/Makefile:#$(eval: No such file or directory
grep: $(call: No such file or directory
grep: BuildPackage,pbr-netifd))/Makefile: No such file or directory
grep: feeds/local/Makefile:$(eval: No such file or directory
grep: $(call: No such file or directory
grep: BuildPackage,pbr))/Makefile: No such file or directory
grep: feeds/local/Makefile:$(eval: No such file or directory
grep: $(call: No such file or directory
grep: BuildPackage,pbr-iptables))/Makefile: No such file or directory
/home/myusername/owrt-sdk/feeds/local.tmp/info/.files-packageinfo.mk:1: *** target pattern contains no '%'.  Stop.

So it looks like the issue is not with my Makefile but rather for some reason, the SDK won't accept any local feeds? I tried to delete the SDK and do everything again, no change.

Ok found the solution:

1 Like

P.s. i also couldn't build anything using the downloaded SDK, not sure why but it just said at every command "no rule to build X". Wouldn't even build the tools. Fetching the whole project from github and building from there worked.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.