I didn't end up contacting liquidcz off-list because I got side-tracked into making my own OpenWRT builds.
And making a build of my own is exactly what I have done. In the hope that it will be useful/helpful for someone else, I'm sharing it with you all here.
My main goal was not to create another generic build of OpenWRT and to make all possible packages for it. Instead, my mission was to come up with a solid build of Asterisk to run inside of MetaROUTER. I didn't really care whether it was with OpenWRT or something else, but OpenWRT just happened to be the best way to accomplish this goal.
Whether it is because of newer versions of the kernel, uClibc, gcc, or even Asterisk itself, the current OpenWRT trunk snapshots seem to have some issues with Asterisk stability and stability in general within MetaROUTER. My past experience with nik247's old Kamikaze-era builds, though, demonstrated to me that there was a point in time when it was all working properly. So I decided to start from a known-good foundation first, with older OpenWRT snapshots. Once I'm at a point where I have familiarized myself with the OWRT buildroot process and have Kamikaze working, I can try my hand at getting more recent code to work.
nik247's old builds did work for me, but there were a couple of shortcomings:
1) He made his builds before MikroTik released their latest patch set, which is when PowerPC RouterBOARDs were finally supported. Consequently, his old builds only run on mipsbe.
2) There was always a laundry-list of tweaks I had to make after installing his build, not to mention the fact that Asterisk had to be installed separately from a package repository. I wanted to be able to install and go.
So what I came up with is a build of OpenWRT for both MIPS and PPC that includes Asterisk within the rootfs itself, fixes a few Asterisk-specific things that OpenWRT doesn't get right during the build process by default (hotplug2 behaving nicely with DAHDI device files, permanent storage of voicemail), and assumes some sane system defaults (gets IP via DHCP). The goal was a lean and mean, plug-and-play MetaROUTER image tuned specifically for running Asterisk.
So here are the details:
- It is based off of the last official stable release of Kamikaze (8.09.2, r18961).
- It uses MikroTik's OpenWRT patch set v1.2, with PPC support.
- It builds and runs on both mipsbe and ppc!
- It uses the official set of packages and package versions from Kamikaze 8.09.2; as a result, it runs Asterisk 1.4.
- Asterisk is built into the rootfs and does not need to be installed separately.
- It includes asterisk14, asterisk14-app-meetme, asterisk14-res-agi, asterisk14-sounds, and asterisk14-voicemail.
In order to make this possible, I had to make a few modifications to the stable Kamikaze buildroot tree; 126.96.36.199, which is the Linux kernel version that MikroTik's v1.2 patch was made against, is not supported by the official Kamikaze stable branch, so I had to merge in the 2.6.31 patchfiles that existed in OpenWRT trunk from around that time. Also, there was a bug in the build scripts that prevented Asterisk from being able to be included in the rootfs that I had to work around. iptables had to be upgraded from the stock version that was included with Kamikaze 8.09.2 because too much had changed between kernel 2.6.26 and 2.6.31. Finally, I ended up leaving out dnsmasq, mtd, and opkg from my images; dnsmasq's default config is broken when you are only using one ethernet interface and aren't using OpenWRT as a router, mtd isn't applicable to a MetaROUTER environment, and I have no interest in running a package repository. Other than that, it's pretty much a stock build of Kamikaze.
I have images to download for anyone that wants them:
http://www.nconx.com/~nathan/ast-owrt-m ... s_mips.tgz
http://www.nconx.com/~nathan/ast-owrt-m ... fs_ppc.tgz
Here are some notes on its use:
- As mentioned earlier, it will try to get an IP via DHCP on eth0.
- The 'root' account already has a default password set of 'ast-owrt', and you can SSH in immediately.
- There is a second account, 'admin', that you can login as via SSH (same default password) which will dump you directly at an Asterisk console shell instead of an ash/busybox shell.
- Both account passwords are set separately, and it IS highly recommended that you change them ASAP! Just SSH as root and run 'passwd root' and 'passwd admin'.
- Asterisk is set to run automatically at boot as a daemon.
- Because /var is a symlink to /tmp on OpenWRT, Asterisk's spool directory has been relocated to /usr/local/var/spool/asterisk. All persistent session data is stored here (voicemail audio files, astdb, etc.) so that it is not lost when the system is rebooted.
- Asterisk configuration files are located in /etc/asterisk
If you want to build it yourself, either just for the experience or in order to re-mix your own version with your own tweaks, here is what you do:
1. Ensure that the host that you want to set up the OpenWRT buildroot on has all necessary requirements and dependencies met.
2. Download all of the essentials (for sake of command examples, I'll assume you are storing these in your home directory):
http://downloads.openwrt.org/kamikaze/8 ... ce.tar.bz2
(official Kamikaze 8.09.2 stable source tarball)
http://www.mikrotik.com/download/metaro ... -1.2.patch
(MikroTik MetaROUTER Linux/OpwnWRT patch v1.2)
http://www.nconx.com/~nathan/ast-owrt-m ... r.patch.gz
(My patch set against Kamikaze 8.09.2)
http://www.nconx.com/~nathan/ast-owrt-m ... ips.config
(My OpenWRT buildroot configuration file for MIPS)
http://www.nconx.com/~nathan/ast-owrt-m ... ppc.config
(My OpenWRT buildroot configuration file for PowerPC)
3. Unpack the Kamkiaze 8.09.2 source tree somewhere:
$ mkdir ~/openwrt; cd ~/openwrt
$ tar xvjf ~/kamikaze_8.09.2_source.tar.bz2
4. Apply the MikroTik v1.2 patchset:
$ cd ~/openwrt/8.09.2
$ cat ~/openwrt-metarouter-1.2.patch | patch -p0
5. Take either the MIPS or PPC config file, and place a copy as '.config' in the root of the OpenWRT buildroot tree:
$ cp ~/ast-owrt-mr_mips.config ~/openwrt/8.09.2/.config
6. The official Kamikaze tarball only comes with a small subset of the build files for various packages, and Asterisk is not included in the default set. So grab the full set:
7. Finally, apply my patchset:
$ zcat ~/kamikaze_ast-owrt-mr.patch.gz | patch -p1
8. (OPTIONAL) If you want to make any changes to the default configuration options, then run the OpenWRT buildroot configurator:
9. Now run 'make' to build everything; the final file will be located at 8.09.2/bin/openwrt-mr-mips-rootfs.tgz or 8.09.2/bin/openwrt-mr-ppc-rootfs.tgz depending on which version you built:
That should do it. Hopefully others will find this useful. I hope to continue to find time to make changes and enhancements; ultimately, I want to get either FreePBX or some other web-based Asterisk GUI running on MetaROUTER along with Asterisk.