From own package overwriting files of other packages

Used in OpenWrt to customize some files from other packages by overwriting them from my own package and making sure my own was installed last by a little modification of /package Makefile and giving my package a name recognized by this package/Makefile to make it come last.
In LEDE this no longer works and it throws "* check_data_file_clashes: etc. etc." as soon as an already existing file is overwritten.
Can this check be switched off from a package Makefile ?

Experimented further and found a work around using the /files system from a customization package.

Example snippet from the customization package's Makefile:

define Package/zzz-Customize/install
# customize sysctl.conf
	mkdir -p ../../files/etc
	cp -f ./files/sysctl.conf		../../files/etc/

This replaces /etc/sysctl.conf by a customized version and will not meet the protest when the same is done as part of the package install.
In the forced copy line the first ./files is where the zzz-Customization package resides, under /package .
The second /files goes up two directory levels to top level where 'make' is given and then descends into the /files directory from where files can be inserted in the image.
For reference the way it was done before but now meets protest by opkg as part of the build process:

define Package/zzz-Customize/install
# customize sysctl.conf
	$(INSTALL_DIR) $(1)/etc
	$(INSTALL_DATA) ./files/sysctl.conf	$(1)/etc
2 Likes