OpenWRT Build file --- Error


 
Well, I had things working pretty well, I was able to get openwrt-brcm2708-sdcard-vfat-ext4.img built, but now it's fallen off the rails again after attempting to build things from a clean slate.

It's trying to copy build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-install/usr/lib/lua/5.1/rrd.so to build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-brcm2708/librrd/usr/lib/lua/, but no file exists.

Code:
make[3]: Entering directory `/home/steve/heatermeter/openwrt/package/rrdtool'
mkdir -p /home/steve/openwrt/bin/brcm2708/packages /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-brcm2708/librrd/CONTROL /home/steve/openwrt/staging_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/pkginfo
install -d -m0755 /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-brcm2708/librrd/usr/lib
cp -fpR -L /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-install/usr/lib/librrd.so.4 /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-brcm2708/librrd/usr/lib/
install -d -m0755 /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-brcm2708/librrd/usr/lib/lua
cp -fpR -L /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-install/usr/lib/lua/5.1/rrd.so /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-brcm2708/librrd/usr/lib/lua/
cp: cannot stat '/home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-install/usr/lib/lua/5.1/rrd.so': No such file or directory
make[3]: *** [/home/steve/openwrt/bin/brcm2708/packages/librrd_1.4.5-LM3_brcm2708.ipk] Error 1
make[3]: Leaving directory `/home/steve/heatermeter/openwrt/package/rrdtool'

Code:
$ ls -l build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-install/usr/lib/
total 388
-rw-r--r-- 1 steve steve 213740 Oct  3 14:21 librrd.a
-rwxr-xr-x 1 steve steve   1250 Oct  3 14:21 librrd.la
lrwxrwxrwx 1 steve steve     15 Oct  3 14:21 librrd.so -> librrd.so.4.1.4
lrwxrwxrwx 1 steve steve     15 Oct  3 14:21 librrd.so.4 -> librrd.so.4.1.4
-rwxr-xr-x 1 steve steve 170931 Oct  3 14:21 librrd.so.4.1.4
drwxr-xr-x 2 steve steve   4096 Oct  3 14:21 pkgconfig

There's no lua dir in there...

Looks like this command should do something, but doesn't:

Code:
install -d -m0755 /home/steve/openwrt/build_dir/target-arm_v6zk_uClibc-0.9.33.2_eabi/rrdtool-1.4.5/ipkg-brcm2708/librrd/usr/lib/lua
 
Last edited:
The longer you do stuff, the better you get at it. I used to have to compile linux kernels from source code in 1995. That used to take 8-10 hours per compile on a lone Pentium 75 MHz machine , and boy was it annoying when it bombed out!

OpenWRT is a bit of a different beast because it's downloading external packages from all over the place to satisfy its dependency chain, and HeaterMeter is using a version that is now 2 major revisions behind ( v12.09 ) the current stable version ( v15.05 ).

Not that it looks like anyone does any actual heatermeter development other than Bryan right now, I'd like to have a straightforward set of steps in place so that anyone can download and build it, since that would be a good start in helping others contribute to the code base. Even if the compile fails the first round and you have to compile the mac80211 package and then continue the build, it should all be documented and known.

Looks like I've been spending too much time in meetings with the build manager at work. I normally stick to ops/devops things :)
 
Last edited:
And now that the sun has set, I'm able to once again successfully build things from scratch. Bizarro land, I tell ya!

Code:
++ ptgen -o /home/steve/openwrt/bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img -h 255 -s 63 -l 4096 -t c -p 9M -t 83 -p 20M
+ set 4194304 9437184 16777216 20971520
+ BOOTOFFSET=8192
+ BOOTSIZE=18432
+ ROOTFSOFFSET=32768
+ ROOTFSSIZE=40960
+ dd bs=512 if=/home/steve/openwrt/build_dir/linux-brcm2708/boot.img of=/home/steve/openwrt/bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img seek=8192 conv=notrunc
18432+0 records in
18432+0 records out
9437184 bytes (9.4 MB) copied, 0.0432708 s, 218 MB/s
+ dd bs=512 if=/home/steve/openwrt/build_dir/linux-brcm2708/root.ext4 of=/home/steve/openwrt/bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img seek=32768 conv=notrunc
40960+0 records in
40960+0 records out
20971520 bytes (21 MB) copied, 0.0826324 s, 254 MB/s


Code:
$ file bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img
bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img: x86 boot sector

$ dd if=bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img of=/dev/null
73728+0 records in
73728+0 records out
37748736 bytes (38 MB) copied, 0.0381967 s, 988 MB/s
 
Last edited:
Yeah I'm really impressed as well! Most people give up after the second or third time they type `make` and it fails. Seeing it through is definitely improving the process as you find things that actually are broken. I've been out of town since Thursday which is why I haven't been able to help you out. I've updated the rpi firmware patch and included it in the install.sh now.

The reason HeaterMeter doesn't try to chase the latest and greatest OpenWrt is simple: there's no new features in newer versions that we'd take advantage of. If it were simple to switch OpenWrt versions then it would be a no-brainer. However, our source code is HEAVILY patched so every patch would have to be rebuilt and re-validated. Because of kernel version changes that would mean driver might need to have parts be rewritten to match new kernel constructs and methods (which might be impossible without hardware vendor support). Some functions we rely on in OpenWrt might be eliminated or require extensive rewrites on our side to support (for starters lucid is deprecated if not completely removed now). It all adds up to possibly hundreds of hours of work and all you get is a sticker that says you're on a piece of software that has a version with a different name. Basically, the HeaterMeter OpenWrt software works, most the bugs we've patched out, so there's nothing to gain and only time to lose.
 
Sweet. I just tested a build with a fresh copy of your HeaterMeter git repo and the OpenWRT svn repo.

Code:
$ ls -ld bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img
-rw-r--r-- 1 steve steve 37748736 Oct  4 14:23 bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img

$ dd if=bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img of=/dev/null
73728+0 records in
73728+0 records out
37748736 bytes (38 MB) copied, 0.0373854 s, 1.0 GB/s

$ sfdisk -l bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img
Disk bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img: cannot get geometry

Disk bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img: 4 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img1   *      0+      1-      2-      9216    c  W95 FAT32 (LBA)
bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img2          2+      4-      3-     20480   83  Linux
bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img3          0       -       0          0    0  Empty
bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img4          0       -       0          0    0  Empty

61718521.jpg
 
Steve. Could you write up the steps you did? Little confused if I need to pull final 12.09 release of openwrt or a specific commit.
 
Yah, hats off to Steve_M for seeing it through and having the patience and skills to do so. It's been a long while since I compiled any code, maybe even all the way back to engineering school when the computer used was called a VAX and it literally filled a room! Those were the days before digital bits and bytes took over so much of our lives as it does today... good times... lol
 
Steve. Could you write up the steps you did? Little confused if I need to pull final 12.09 release of openwrt or a specific commit.

The steps on the Building OpenWrt from Source wiki page should work now.

Code:
cd ~
git clone git://github.com/CapnBry/HeaterMeter.git heatermeter
svn co svn://svn.openwrt.org/openwrt/tags/attitude_adjustment_12.09 -r36422 openwrt
cd ~/heatermeter/openwrt
./install.sh BCM2708 ~/openwrt
cd ~/openwrt
make menuconfig (exit and save)
make V=s ; make package/mac80211/compile V=s ; make V=s

It takes about an hour or so using an Ubuntu 14.04 virtualbox VM running on my 2012 mac mini.

If you really want to speed things up, you can increase the make jobs, but you'll need to run make a few times.

ie:

make -j4 V=s
make -j4 package/mac80211/compile V=s
make -j4 V=s # repeat this command until the build finishes clean.
 
There's seems to be some inconsistency with the build of the rrdtool package. The symptoms are that of the missing rrd.so that I previously mention appear. It doesn't happen every time, and it only seems to happen when running make with no -j option. If I do -j3 (or more) I don't seem to run into any problems other than needing to run make a couple of times to get things fully built. Inconsistent problems are annoying!

I _may_ have spotted a trend.

If "package/lua host-compile" isn't done before "package/lua compile", it looks like it causes trouble.

Maybe the ~/openwrt/package/lua/Makefile needs "PKG_BUILD_DEPENDS:=lua/host" ?
 
Last edited:
No reason I used menuconfig vs oldconfig, probably because I didn't know of that target originally.

The RRD package took me forever to figure out how to build. You may note that there's a patch that specifically tries to address those issues. Most of it is due to the RRD package referencing files in the host system rather than the buildroot. Its massive Makefile.am or Config.in is very complex and probably could use another patch to fix it up even more. However, it builds correctly every time on my system so I don't see the errors any more, most likely because I have lua, lua-devel, and rrd on my host system.
 
It worked ---- make -j4 V=s # repeat this command until the build finishes clean. # was 3 times for me.

Would have never thought of just retrying --- sure order must be an issue somewhere.
 
Nice. This is working for me in auto-pilot mode.

Code:
cd ~
git clone git://github.com/CapnBry/HeaterMeter.git heatermeter
svn co svn://svn.openwrt.org/openwrt/tags/attitude_adjustment_12.09 -r36422 openwrt
cd ~/heatermeter/openwrt
./install.sh BCM2708 ~/openwrt
cd ~/openwrt
make oldconfig
make -j4
make -j4 package/mac80211/compile
while [ ! -f ~/openwrt/bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img ]
do make -j4
done
ls -ld ~/openwrt/bin/brcm2708/*.img

Here's what the compile process looks like:

http://pastebin.ca/3181841
 
Last edited:
That is awesome Steve:

I make a file install_script in the root of /home/user

I copied your items into the file:
----------------------
cd ~
git clone git://github.com/CapnBry/HeaterMeter.git heatermeter
svn co svn://svn.openwrt.org/openwrt/tags/attitude_adjustment_12.09 -r36422 openwrt
cd ~/heatermeter/openwrt
./install.sh BCM2708 ~/openwrt
cd ~/openwrt
make oldconfig
make -j4
make -j4 package/mac80211/compile
while [ ! -f ~/openwrt/bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img ]
do make -j4
done
ls -ld ~/openwrt/bin/brcm2708/*.img
----------------------------------------

I ran "chmod 755 install_script"

I ran "./install_script"

Worked Perfect:::::::::::::::
 
However, it builds correctly every time on my system so I don't see the errors any more, most likely because I have lua, lua-devel, and rrd on my host system.

I installed lua5.1 on the build box and it compiles without incident now using "make ; make package/mac80211/compile ; make"
 
Ah I knew there had to be documentation on what is supported. My ability to read their perl script is not great. Now that I look at it though, the old version of /scripts/feeds in our tree doesn't support the "^" only a ";".

my ($base, $branch) = split(/;/, $src, 2);

But the good news is that it calls git clone --depth 1 --branch '%s' '%s' '%s' (branch, base, local path) so assuming you have git >= 1.8 the branch parameter can specify a tag as well. Try it like this if you don't mind.
Code:
src-git luci http://github.com/openwrt/luci.git;0.11.1

I don't think it makes a difference because they're not going back to add anything to 0.11 I'm sure, but at least this way we both use the same tag. I'd try it myself but I am afraid I might break my own build by swapping out just that part and end up having to manually repatch.

This did not work for me. Here is the original error that I received when using

Code:
src-git luci http://github.com/openwrt/luci.git;0.11.1

Code:
Updating feed 'luci' from 'http://github.com/openwrt/luci.git;0.11.1' ...
Cloning into './feeds/luci'...
error: RPC failed; result=22, HTTP code = 408
fatal: The remote end hung up unexpectedly
failed.

Changing the URL to use SSL I was able to clone the repo but then it couldn't find the 0.11.1 branch and used HEAD instead. This compiled successfully but the web interface never starts up.

Code:
src-git luci https://github.com/openwrt/luci.git;0.11.1

Code:
Updating feed 'luci' from 'https://github.com/openwrt/luci.git;0.11.1' ...
Cloning into './feeds/luci'...
remote: Counting objects: 12530, done.
remote: Compressing objects: 100% (6661/6661), done.
remote: Total 12530 (delta 4278), reused 10397 (delta 2682), pack-reused 0
Receiving objects: 100% (12530/12530), 8.51 MiB | 7.35 MiB/s, done.
Resolving deltas: 100% (4278/4278), done.
warning: Remote branch 0.11.1 not found in upstream origin, using HEAD instead

My workaround was to clone the luci repo prior to running the install.sh script and checking out the necessary tag/branch and changing the src-git link in the install script to

Code:
src-cpy luci /path/to/luci

After making the above changes, I was able to successfully build openwrt with linkmeter however, I noticed that the patches for luci were not being applied as noted by the lack of specifying a URL to upload a new image so to correct this I created a series file and added a line to copy it along with the luci patches into the patches directory and manually apply them before running make. There is probably a better way to do this or a reason why the patches aren't being applied but this was the only way that I could get it to work. I also created series files for the rrdtool and 8192cu packages in case those weren't being applied as well.

You can view all my changes here.

https://github.com/dwright134/HeaterMeter/commits/bugfix/compiler

I also created a builder script which I included in the tools directory. This will download and setup everything including the necessary system packages if you are setting up a build environment from scratch based on Ubuntu. I tested on 12.04 but should work for any of the latest versions.

Make sure your user has sudo access

Code:
$ curl -o hm_builder.sh https://raw.githubusercontent.com/dwright134/HeaterMeter/294ae2051c37474c347956bc59a78368a1c954a8/tools/OpenWRTBuildScript/hm_builder.sh
$ chmod +x hm_builder.sh
$ ./hm_builder.sh --setup
$ ./hm_builder.sh ~

The only warning/errors I can see that aren't resolved are the following when the install.sh script in heater/openwrt is creating the feeds for linkmeter. It doesn't appear to cause any problems so as the warning states these may be already part of a standard package.

Code:
WARNING: No feed for package 'olsrd' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-dyn-gw-plain' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-txtinfo' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-nameservice' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-watchdog' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-dyn-gw-plain' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-nameservice' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-txtinfo' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-txtinfo' found, maybe it's already part of the standard packages?
WARNING: No feed for package 'olsrd-mod-nameservice' found, maybe it's already part of the standard packages?
 
I just tried using a fresh download and it's ok for me.

Code:
Collecting package info: done
Updating feed 'luci' from 'http://github.com/openwrt/luci.git;0.11.1' ...
Cloning into './feeds/luci'...
remote: Counting objects: 3142, done.
remote: Compressing objects: 100% (2159/2159), done.
Receiving objects: 100% (3142/3142), 3.73 MiB | 3.44 MiB/s, done.
remote: Total 3142 (delta 661), reused 2665 (delta 399), pack-reused 0
Resolving deltas: 100% (661/661), done.
Checking connectivity... done.
Note: checking out 'adc4c2932ec7039a6b7effeace098e5bc46861c6'.
 

 

Back
Top