Custom rc.local at build time

I'd like a custom rc.local in my build images i've read https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem#custom_files but unsure as to what/where the "buildroot" directory is. i've done

git clone https://git.openwrt.org/openwrt/openwrt.git
git checkout openwrt-19.07
./scripts/feeds update -a
./scripts/feeds install -a

The buildroot root dir means here the directory from which you run all the build commands.

The root of the cloned OpenWrt repo.

The one where you run all this:

git checkout openwrt-19.07
./scripts/feeds update -a
./scripts/feeds install -a
...
make 
...
etc.

I have already tried creating it in the openwrt directory but that didn't work i.e

openwrt/etc/rc.local

i will try it in

../openwrt

You are missing the files/

From wiki:

the correct place to put them is:

  • <buildroot>/files/

you want an image with a custom /etc/config/firewall or a custom etc/sysctl.conf, then create this files as:

  • <buildroot>/files/etc/config/firewall

  • <buildroot>/files/etc/sysctl.conf

E.g. if your <buildroot> is ~/source and you want some files to be copied into firmware image's /etc/config directory, the correct place to put them is ~/source/files/etc/config.

3 Likes

Great thanks everything I put in files/etc now gets added correctly except rc.local it's always the default one instead of my modified one.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

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