OpenWrt Forum Archive

Topic: could not compile AA, host not found, connection refused, etc

The content of this topic has been archived on 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi, I'm trying to compile AA with specific revision r33298 for old edimax 6200nL with 16MB ram (because of switch bugs in new revisions)

did this:

git clone git://git.openwrt.org/12.09/openwrt.git
cd openwrt
git checkout -B 33298
git clone git://git.openwrt.org/12.09/packages.git
./scripts/feeds update -a

Updating feed 'packages' from 'svn://svn.openwrt.org/openwrt/branches/packages_12.09' ...
svn: E000111: Unable to connect to a repository at URL 'svn://svn.openwrt.org/openwrt/branches/packages_12.09'
svn: E000111: Can't connect to host 'svn.openwrt.org': Connection refused
failed.
Updating feed 'xwrt' from 'http://x-wrt.googlecode.com/svn/trunk/package' ...
svn: E160013: Unable to connect to a repository at URL 'http://x-wrt.googlecode.com/svn/trunk/package'
svn: E160013: 'http://x-wrt.googlecode.com/svn/trunk/package' path not found
failed.
Updating feed 'luci' from 'http://svn.luci.subsignal.org/luci/branches/luci-0.11/contrib/package' ...
svn: E175002: Unable to connect to a repository at URL 'http://svn.luci.subsignal.org/luci/branches/luci-0.11/contrib/package'
svn: E175002: OPTIONS of 'http://svn.luci.subsignal.org/luci/branches/luci-0.11/contrib/package': Could not resolve hostname `svn.luci.subsignal.org': Host not found (http://svn.luci.subsignal.org)
failed.
Updating feed 'routing' from 'git://github.com/openwrt-routing/packages.git;for-12.09.x' ...
Already up-to-date.
Create index file './feeds/routing.index'

I got connection refused and host not found errors. Is it possible to compile old AA in the new age? At the times of AA I used svn, but it was not retrieving anything. Git retrieved at least something, but packages cannot be updated or installed.

Btw. I'm not even sure, if I'm picking up the specific revision correctly, if I have something wrong, please correct me. Last time I needed this I used svn co --revision=33298 smile Barrier breaker seems to be working with git (so far), so I will try it instead, but I'd prefer aa because it needed less memory.

Thanks.

1)
Cloning the "packages" that way is wrong. Packages is a "feed", downloaded by the build system using the info at  feeds.conf.default

The svn download servers for feeds have been deprecated. You need to edit feeds.conf.default to use git servers before updating the feeds. "packages" can be found from git.openwrt.org, while "luci" is both at Github and git.openwrt.org

feeds.conf.default should be something like:

src-git packages https://git.openwrt.org/12.09/packages.git
src-git luci https://github.com/openwrt/luci.git;luci-0.11
src-git routing git://github.com/openwrt-routing/packages.git;for-12.09.x

(you don't need xwrt feed)

2)
The attempt to pick the correct revision looks really strange to me. That creates a new branch, but GIT knows nothing about the old SVN revisions.

Easiest is probably to identify the date/time for svn 33298 and then use that as the tool to checkout the correct revisions with

 git checkout `git rev-list -n 1 --before="yyyy-mm-dd hh:mm" master`

To be meticulous, you should fetch not only the main sources but also luci and packages from the same moment. I use this script to do "time machine" magic:

+#!/bin/bash
+#
+# versionT  -  Update source code to revision T and then build
+#              T argument: date as yyyy-mm-dd or "yyyy-mm-dd hh:mm"
+#              first "git pull --depth=500" to deepen git history (shallow)
+#              use "git checkout master" for each feed to get back to HEAD
+
+git checkout `git rev-list -n 1 --before="$1" master`
+(cd feeds/luci     ; git checkout `git rev-list -n 1 --before="$1" master`)
+(cd feeds/packages ; git checkout `git rev-list -n 1 --before="$1" master`)
+(cd feeds/routing  ; git checkout `git rev-list -n 1 --before="$1" master`)
+echo "...install feeds..."
+./scripts/feeds install -a

The script is designed to be run after first updating the build system and feeds normally. Then I use "git pull --depth=500" in main source dir and in each feed directory (feeds/luci, feeds/packages) to deepen git history (to get the history of old commits).

EDIT:
Due to the partially arbitrary timestamps in native GIT commits, the script does not work perfectly with the newest commits that have been made directly to GIT. The reason is that GIT date parsing stops after finding the first commit with a suitable date even if that is not the oldest target commit. The commits may have been rebased without correcting the dates, so even a linear GIT history does not have linear timestamps. The script works ok for the old commits made originally via SVN as those have strictly linear timestamps.

(Last edited by hnyman on 12 Sep 2016, 16:39)

Thank you, also for the info on picking up revisions. Picking up the older revision is now quite difficult comparing with svn, shame it is no longer supported.

I have no idea how to find the date, so I can try to pick something by random and then see what revision I'm at and again and again..., but how do I find out the "current" revision after using the --before parameter?

Thank you.

You can find the date from svn...
https://dev.openwrt.org/changeset/33298/

The date/time of that exact svn revision seems to be 2012-08-29T12:37:35+02:00
Timezones can make getting the exactly same git commit a bit difficult, so if it does not need to be exactly that, you might just use 2012-08-30

And you can of course also browse git history (now that you know the date) and find out the git commit hash for that commit. Then you could checkout directly that commit. ...hmmm... Apparently 12.09 has been branched off in December 2012, so this is earlier. So you likely need to use the trunk/master for obtaining that revision.

Looking at trunk/master history d6de6b1e833ed4fdc8c5489900e4dc29fccac5d0 looks right:
http://git.openwrt.org/?p=openwrt.git;a=shortlog;pg=131
http://git.openwrt.org/?p=openwrt.git;a … 29fccac5d0

Going back to ancient history is not easy. And it was not that easy with svn either, if you wanted the exactly same old feed versions (instead of using old main source with up-to-date feeds, which can lead into nasty surprises).

You may also run into problems e.g. with toolchain. Some of the old compilers (used then) are not happy with current OS versions. E.g. some old gcc versions do not run with new Ubuntus.

(Last edited by hnyman on 23 Aug 2016, 12:37)

Thank you very much, I will try with that commit id you found.

edit, I tried to specify some of the IDs mentioned in the git links you found, but I get errors like this:

[me@linux openwrt]$ git checkout d6de6b1e833ed4fdc8c5489900e4dc29fccac5d0
fatal: reference is not a tree: d6de6b1e833ed4fdc8c5489900e4dc29fccac5d0
[me@linux openwrt]$ git checkout 78eb11eacb8690766454e1672827f282dcfd1fe0
fatal: reference is not a tree: 78eb11eacb8690766454e1672827f282dcfd1fe0

I'm trying with barrier breaker folder though, could that be a problem? AA heavily relies on svn, so I don't think I could replace all the occurences with git.

edit2: tried with aa, replaced svn with git, it went fine, but still I get 78eb11eacb8690766454e1672827f282dcfd1fe0 is not a tree. So how do I specify that tree?

(Last edited by nozombian on 23 Aug 2016, 15:37)

edit4: I tried to read git log and oldest what I see is 33625. So am I out of luck and cannot specify 33298?
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33625 3c298f89-4303-0410-b956-a3cf2f4a3e73

Shame that the switch problem was never fixed (https://dev.openwrt.org/ticket/12125). I thought I could use this old router with new lte modem, because it fits perfectly in a pet bottle and can be used on the roof, but I need to precompile cdc ethernet support, opkg does not work with 16MB ram.

Like I said above, AA was branched from trunk later than 33298 (likely at 33625), so you need to use trunk to get 33298. Start again, and git clone directly from Openwrt trunk.

It works. Example below:

perus@ub16041:/Openwrt/test$ git clone http://git.openwrt.org/openwrt.git
Cloning into 'openwrt'...
remote: Counting objects: 343902, done.
remote: Compressing objects: 100% (94096/94096), done.
remote: Total 343902 (delta 237354), reused 340863 (delta 235080)
Receiving objects: 100% (343902/343902), 117.82 MiB | 9.53 MiB/s, done.
Resolving deltas: 100% (237354/237354), done.
Checking connectivity... done.
perus@ub16041:/Openwrt/test$ cd openwrt/
perus@ub16041:/Openwrt/test/openwrt$ git checkout d6de6b1e833ed4fdc8c5489900e4dc29fccac5d0 
Note: checking out 'd6de6b1e833ed4fdc8c5489900e4dc29fccac5d0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at d6de6b1... ramips: ramips_esw.c indentation cleanup
perus@ub16041:/Openwrt/test/openwrt$ 

Note that you should edit feeds.conf.default to use git to fetch package feeds from the trunk of the ancient time. You might also succeed with the luci and packages feeds from 12.09, but those were created later at branching.

(Last edited by hnyman on 23 Aug 2016, 16:26)

Oh, I see. Thank you, now I understand. I wrongly thought that I can go only back to latest release in the trunk.

Hi, I followed everything you told, returned back to date, thanks for perfect instructions. But it looks the like compilation fails, because it requires svn at some point too. Maybe just opkg? What and where should I change/replace, when I get errors like this? (compiled using single thread)

.
.
make[3]: Entering directory `/home/me/openwrt-trunk/openwrt/package/opkg'
mkdir -p /home/me/openwrt-trunk/openwrt/dl
echo "Checking out files from the svn repository..."; mkdir -p /home/me/openwrt-trunk/openwrt/tmp/dl && cd /home/me/openwrt-trunk/openwrt/tmp/dl && rm -rf opkg-618 && [ \! -d opkg-618 ] && ( svn help export | grep -q trust-server-cert && svn export --non-interactive --trust-server-cert -r618 http://opkg.googlecode.com/svn/trunk/ opkg-618 || svn export --non-interactive -r618 http://opkg.googlecode.com/svn/trunk/ opkg-618 ) && echo "Packing checkout..." &&  /usr/bin/gtar cfz /home/me/openwrt-trunk/openwrt/tmp/dl/opkg-618.tar.gz opkg-618 && mv /home/me/openwrt-trunk/openwrt/tmp/dl/opkg-618.tar.gz /home/me/openwrt-trunk/openwrt/dl/ && rm -rf opkg-618;
Checking out files from the svn repository...
svn: E160013: Unable to connect to a repository at URL 'http://opkg.googlecode.com/svn/trunk'
svn: E160013: 'http://opkg.googlecode.com/svn/trunk' path not found
svn: E160013: Unable to connect to a repository at URL 'http://opkg.googlecode.com/svn/trunk'
svn: E160013: 'http://opkg.googlecode.com/svn/trunk' path not found
make[3]: *** [/home/me/openwrt-trunk/openwrt/dl/opkg-618.tar.gz] Error 1
make[3]: Leaving directory `/home/me/openwrt-trunk/openwrt/package/opkg'
make[2]: *** [package/opkg/host/compile] Error 2
make[2]: Leaving directory `/home/me/openwrt-trunk/openwrt'
make[1]: *** [/home/me/openwrt-trunk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/me/openwrt-trunk/openwrt'
make: *** [world] Error 2

Thank you.

Edit: I took a look at package/opkg/Makefile and there is:

PKG_SOURCE_PROTO:=svn
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=opkg-$(PKG_VERSION)
PKG_SOURCE_URL:=http://opkg.googlecode.com/svn/trunk/
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES = autogen.sh aclocal.m4

This should be probably changed to git. How?

If this has to be done with every single package, it is probably imposible and I will put the router where it belongs (=to the trash can), but only if a few of the packages require svn, it worths a try ;-) Thanks.

Edimax 6200nl is still marked as supported, new images are compiled, but they don't work, probably same problem has 6200n, which has 32MB RAM, but same hardware :-( Precompiled AA and BB from downloads just turn the router into brick, I have not tested CC. Shame that no one fixed that switch bug :-(

(Last edited by nozombian on 31 Aug 2016, 17:01)

nozombian wrote:

svn: E160013: Unable to connect to a repository at URL 'http://opkg.googlecode.com/svn/trunk'
svn: E160013: 'http://opkg.googlecode.com/svn/trunk' path not found

Your svn tool is working ok, but Google has scrapped the server that existed 5 years ago.

Googlecode is shut down and only some archives are left.
https://code.google.com/archive/p/opkg/

The error is likely just for that one package "opkg". (or possible for other packages, if they are from googlecode)

First idea for you:
Download the problematic source package opkg-618.tar.gz manually to your "dl" directory. It will be used from there, if it is found there.
The package can be found at least from   http://mirror2.openwrt.org/sources/
Direct link: http://mirror2.openwrt.org/sources/opkg-618.tar.gz

The mirror2 site contains lots of other source packages, too, so check that in case you run into a missing package.

(Last edited by hnyman on 31 Aug 2016, 18:40)

hnyman wrote:

Download the problematic source package opkg-618.tar.gz manually to your "dl" directory. It will be used from there, if it is found there.

A big thank you again, hnyman, that worked perfectly! There have been yet the same problem with hotplug package, but then compilation completed. Bin only for 6200n was created, but I'm going to test it on 6200nl anyway.

Edit: shame, but that 6200n image is not working :-( But at least I learned know how to turn back time ;-) Thanks again.

(Last edited by nozombian on 8 Sep 2016, 11:37)

The discussion might have continued from here.