Hello,
I am new to OpenWrt packaging and, I can't figure out why a postinst section which is meant to run after the installation of the package on the OpenWrt device. But it is running on my Linux machine where I am running the make and building the package. For reference, have posted postinst section of the Makefile. And the make log.
And the Make has a post install section like this
define Package/$(PKG_NAME)/postinst
#!/bin/sh
# Set dnsmasq to noresolv
uci set dhcp.@dnsmasq[0].noresolv=0
uci commit
# to trigger the hotplug turing up the interface
ifup lan
endef
Here is the make log. make -j1 V=sc
cp -fpR /home/saswata/git/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips /home/saswata/git/openwrt/build_dir/target-mipsel_24kc_musl/root.orig-ramips
/home/saswata/git/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/usr/lib/opkg/info/some-pkg.postinst-pkg: line 3: uci: command not found
/home/saswata/git/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/usr/lib/opkg/info/some-pkg.postinst-pkg: line 4: uci: command not found
/home/saswata/git/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/usr/lib/opkg/info/some-pkg.postinst-pkg: line 6: ifup: command not found
postinst script ./usr/lib/opkg/info/some-pkg.postinst has failed with exit code 127
make[2]: *** [package/Makefile:73: package/install] Error 1
make[2]: Leaving directory '/home/saswata/git/openwrt'
make[1]: *** [package/Makefile:123: /home/saswata/git/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/saswata/git/openwrt'
And if there is a better way to do it other than making a UCI defaults file. Please let me know.
Thank you for your help...