This is the last part of the quick overview showing how to put and run OpenWRT
on an exemplary device. I’m going to describe how to add this device as
build system target in order to use it as any other. This is rather short
part, because it’s only about adding several files to the OpenWRT’s sources
tree.
Adding target dir
This is quite simple. We need to add a target directory in target/linux/x86/
subdir. In my case it’s ebox3300 dir. In this directory we need to have
a target makefile and default kernel config. We may also have some platform
specific files. I recommend looking at the other targets, because they are
perfect examples.
The target makefile in my case looks like that:
As we can see, there are bunch of variables and target description. I think
they are pretty self-explanatory. For details, please check documentation,
which can be built (sources are in the docs dir, in latex format).
Other file, which is needed, is default linux kernel config. Here is config
I’ve used:
File is named config-3.10. Name is important, because config is identified
by that name. We can have several configs for different kernel versions.
In this case, I’ve used just the 3.10 kernel version.
Important change from the default config for other x86 based platforms is
CONFIG_PATA_IT821X=y. This driver must be compiled in kernel, rather than
built as module, because the default for x86 targets is to mount
the main file system straight from the disk. This is simplest implementation.
The target can be configured to boot with initial ramdisk, rather than mount root
file system from disk. In that case, this option wouldn’t be needed.
Modifying platform makefile
Now, we have to modify the main platform makefile which is
target/linux/x86/Makefile. We just need to add ebox3300 subtarget. The name
is just a target directory name. Here is the diff:
This is it. We may “dirclean” our source tree (make dirclean) and run
menuconfig. There should be our new EBOX3300 subtarget, when we select x86
target system. From this point, we may use this build system as easy as for any
other target.
Summing up
As for the device, I’ve been using it for about three months now and
haven’t run into any problems. System is perfectly stable and works as good
as any off-the-shelf router. Even better, it’s fully customizable and has
enormous potential. For example, I’ve established permanent OpenVPN tunnel
connecting my two remote networks. My future plans include of making this
system as an weather data acquisition device and I know it’s easily capable
of that task.
Comments
comments powered by Disqus