Compile OpenWrt including openvpn / vpn policy routing and config files

I'm fooling around with an second WRT3200ACM router, I own one as production router, this one is for fun and testing.

I did compile my first OpenWrt firmware :wink: (just latest stable build and al settings are default)

Now I'm wondering if I can compile a firmware, that includes a few packages by default, like OpenVPN, VPN policy routing, Adblock, well you've got the idea. And if this is possible, can I add config files, so the firmware I compile is like the one on my production router. (no real need just to learn compile)

For config files see custom files, you of course can put what you need in your own build. As an example, you could check the config.buildinfo file to be found off the stuff link on my avatar, just the custom bits as to what I run on a rango.

2 Likes

You can also save time using imagebuilder

2 Likes

If you are building from source, you can put anything you want to be included in the final image in the ./files folder-tree.

It's based on the eventual root-dir.. Meaning, to put something in /etc/config, you'd put the file in ./files/etc/config

Just be aware this is across ALL builds you make (not just the current target)

1 Like

thanks all, I'll give it a try :wink:

When I am ready to compile (make) there is no ./files directory. Am I looking at the wrong location?

This is the content of my dir /openwrt

total 1132
drwxrwxr-x 17 raymond raymond   4096 nov 18 15:39 .
drwxr-xr-x 17 raymond raymond   4096 nov 18 15:12 ..
drwxr-xr-x  4 raymond raymond   4096 nov 17 10:27 bin
-rw-rw-r--  1 raymond raymond    179 nov 17 08:14 BSDmakefile
drwxr-xr-x  5 raymond raymond   4096 nov 18 15:13 build_dir
-rw-rw-r--  1 raymond raymond 237613 nov 18 15:21 .config
drwxrwxr-x  2 raymond raymond   4096 nov 17 08:16 config
-rw-rw-r--  1 raymond raymond    576 nov 17 08:14 Config.in
-rw-rw-r--  1 raymond raymond 237613 nov 18 15:21 .config.old
-rw-rw-r--  1 raymond raymond 238017 nov 18 15:39 .configrmm
-rw-rw-r--  1 raymond raymond 259879 nov 18 15:33 .configrmm.old
drwxr-xr-x  2 raymond raymond   4096 nov 17 10:45 dl
drwxrwxr-x 10 raymond raymond   4096 nov 18 15:21 feeds
-rw-rw-r--  1 raymond raymond    395 nov 17 08:16 feeds.conf.default
drwxrwxr-x  8 raymond raymond   4096 nov 18 15:20 .git
-rw-rw-r--  1 raymond raymond      8 nov 17 08:14 .gitattributes
drwxrwxr-x  2 raymond raymond   4096 nov 17 08:14 .github
-rw-rw-r--  1 raymond raymond    261 nov 17 08:16 .gitignore
drwxrwxr-x  3 raymond raymond   4096 nov 17 08:16 include
-rw-r--r--  1 raymond raymond    176 nov 17 10:33 key-build
-rw-r--r--  1 raymond raymond     92 nov 17 10:33 key-build.pub
-rw-r--r--  1 raymond raymond    356 nov 17 10:33 key-build.ucert
-rw-r--r--  1 raymond raymond    260 nov 17 10:33 key-build.ucert.revoke
-rw-rw-r--  1 raymond raymond  17992 nov 17 08:16 LICENSE
-rw-rw-r--  1 raymond raymond   3740 nov 17 08:16 Makefile
drwxrwxr-x 12 raymond raymond   4096 nov 17 08:18 package
-rw-rw-r--  1 raymond raymond   1295 nov 17 08:16 README
-rw-rw-r--  1 raymond raymond  13347 nov 17 08:16 rules.mk
drwxrwxr-x  4 raymond raymond   4096 nov 17 08:16 scripts
drwxrwxr-x  5 raymond raymond   4096 nov 18 15:13 staging_dir
drwxrwxr-x  6 raymond raymond   4096 nov 17 08:16 target
drwxrwxr-x  3 raymond raymond  16384 nov 18 15:21 tmp
drwxrwxr-x 12 raymond raymond   4096 nov 17 08:16 toolchain
drwxrwxr-x 61 raymond raymond   4096 nov 17 08:16 tools
-rw-rw-r--  1 raymond raymond     18 nov 17 08:16 version
-rw-rw-r--  1 raymond raymond     11 nov 17 08:16 version.date

You need to create it if you want to add custom files.

1 Like

May want to add this to your image

vfpv3.patch
diff --git a/target/linux/mvebu/cortexa9/target.mk b/target/linux/mvebu/cortexa9/target.mk
index cdd4d86e49..2a75599bc9 100644
--- a/target/linux/mvebu/cortexa9/target.mk
+++ b/target/linux/mvebu/cortexa9/target.mk
@@ -10,5 +10,5 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARDNAME:=Marvell Armada 37x/38x/XP
 CPU_TYPE:=cortex-a9
-CPU_SUBTYPE:=vfpv3-d16
+CPU_SUBTYPE:=vfpv3
 KERNELNAME:=zImage dtbs

reason

I'm busy with the imagebuilder, do I need to add the patch with imagebuilder, or is this allready included?

If I make a build with stable and al my packages and config files it works like a charm (even with x86 on a virtualbox instead on my extra wrt3200acm) with is fun by the way. (I know the patch is for the wrt3200acm)

When I try to achieve the same with snapshot I get errors on some packages, I asume that is because it's snapshot and not everything is working.

image builder is not an option as everything is compiled for you, you are just combining bits into an image.