[LEDE-DEV] replacing files in base system from a package?

Alberto Bursi alberto.bursi at outlook.it
Mon Oct 3 14:35:46 PDT 2016

On 10/03/2016 11:00 PM, Karl Palsson wrote:
> Alberto Bursi <alberto.bursi at outlook.it> wrote:
>> On 10/03/2016 03:26 PM, Karl Palsson wrote:
>>> What's the "new" way of doing this? In the past, in OpenWrt CC
>>> and before, a package could install files like /etc/banner and
>>> /etc/inittab that were provided by the base-files package. It was
>>> always listed as "unreliable" as apparently you couldn't rely on
>>> the order. In practice it actually worked just fine.
>>> What's the currently accepted mechanism for including replacement
>>> files in a custom build?
>>> Sincerely,
>>> Karl Palsson
>> What I've found so far for my own project is that a script in
>> /files/etc/uci-defaults folder in source folder should work.
>> Anyway scripts in /etc/uci-defaults (from any source) are
>> called on first boot and apply configuration changes on device,
>> just look at the ones you have already there in the rootfs.
> You're absolutely correct, that way _works_ but it's pointlessly
> redundant to ship files just so that I can make the bootup
> process take longer while it "finishes" replacing files that I
> knew from the outset I never wanted. It also means that until
> _my_ uci-defaults file runs, (depends on everyone else) I still
> have the old original files in place. uci-defaults is a great
> mechanism for many things, but i really don't feel it's
> appropriate for everything.
> Sincerely,
> Karl Palsson

Ehm, I did say what I found and works, not necessarily what is best. I'm 
also trying to do the same and info is very meh.

Anyway did you try adding files in a /files folder you create in the 
source folder?
various sources claim that stuff in /files should theoretically go in 
the rootfs's / when building the image, so if you make 
/files/etc/config/myconfig it should go in the right place.
according to some posts in openwrt forum it seems to overwrite stock 
configuration at build time.
But I've not tried that yet in my project so I can't tell.
If it works (or not) please tell me as I'm also interested in that.


More information about the Lede-dev mailing list