This only have to be done once in a lifetime.
r=28535 cd ~ mkdir -p build/openwrt mkdir build/dl mkdir -p build/files/ar71xx cd ~/build/openwrt svn co -r $r svn://svn.openwrt.org/openwrt/trunk/ cd ~/build/openwrt/trunk ln -sf ../../dl ln -sfn ../../files/ar71xx files cp -p scripts/feeds scripts/feeds.sed
When all else fail.
r=28535 cd ~/build/openwrt/trunk rm -fr staging_dir build_dir bin broken_packages make distclean ln -sf ../../dl ln -sfn ../../files/ar71xx files svn up -r $r
Lazy people don't like to spend hours compiling packages you will never use. Instead, download them all and compile your image in a few minutes.
This is where the value of "r" come from.
Current snapshot last for 24 hs, lately. Sync has not much sense, then.
Browse to http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/ and look the value of base-files_??-r?????_ar71xx.ipk
r=29484(At the time of writing this guide)
baseurl=http://downloads.openwrt.org/snapshots/trunk/ platform=ar71xx cd ~/build/openwrt/trunk wget -N $baseurl$platform/packages/Packages.gz r=$(zgrep base-files_ Packages.gz | sed -e 's/^.*-r\(.*\)_ar71xx.ipk/\1/')
After r29686 opkg spit all kmod-* packages not compiled by yourself. There should be a good reason for that, but I take the risk.
grep vermagic include/kernel-defaults.mk $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagicThat line creates the "incompatibility"
cd ~/build/openwrt/trunk zgrep -m 1 "Depends: kernel (=.*)$" Packages.gz | sed -e 's/.*-\(.*\))/\1/' > .vermagic sed -i -e 's/^\(.\).*vermagic$/\1cp $(TOPDIR)\/.vermagic $(LINUX_DIR)\/.vermagic/' include/kernel-defaults.mkNow, that line creates the "compatibility"
grep vermagic include/kernel-defaults.mk cp $(TOPDIR)/.vermagic $(LINUX_DIR)/.vermagicUse at your own risk.
r=29484 cd ~/build/openwrt/trunk svn up -r $r ./scripts/feeds update -a | grep revisi # packages 28574 xwrt 4986 luci 7776 luci=$(zgrep luci_ Packages.gz | sed -e 's/^.*svn\([0-9]*\).*/\1/') # luci=7771 sed -i -e "s/\"svn update.*\",/\"svn update -r $r\",/" ./scripts/feeds.sed ./scripts/feeds.sed update packages sed -i -e "s/\"svn update.*\",/\"svn update -r $luci\",/" ./scripts/feeds.sed ./scripts/feeds.sed update luci ./scripts/feeds install -a echo CONFIG_TARGET_ar71xx=y > .config make defconfig make download make worldIf vanilla build exit with error, current trunk is broken, checkout again tomorrow. Else, is time to add some packages: 1)
echo "CONFIG_TARGET_ar71xx=y # CONFIG_TARGET_ar71xx_generic_Default is not set CONFIG_TARGET_ar71xx_generic_TLMR3220=y CONFIG_ATH_USER_REGD=y CONFIG_PACKAGE_luci=y CONFIG_PACKAGE_luci-app-qos=y CONFIG_PACKAGE_kmod-usb-storage=y CONFIG_PACKAGE_block-mount=y CONFIG_PACKAGE_kmod-fs-ext4=y CONFIG_PACKAGE_kmod-input-gpio-keys-polled=y" > .config make defconfig make download make world ls -lat bin/ar71xx/
We have very few differences with MR3420, however I go step by step.
For MR3220 need to use Development Sources, select a place for buildroot and do:
svn checkout svn://svn.openwrt.org/openwrt/trunk/ cd trunk make menuconfig
If success (check buildroot.exigence if any error) then select:
Target System (Atheros AR71xx/AR7240/AR913x/AR934x) ---> Target Profile (TP-LINK TL-MR3220) --->
Exit and save changes. If you like default configurations (little, similar that snapshots but without extra modules to compile) do:
./scripts/feeds update -a
and install all feeds (not recommended but look for PACKAGE_usb-modeswitch on submenu "Utilities"…) 3)
./scripts/feeds install -a
or select by name:
./scripts/feeds install -a -p luci
With a new "make menuconfig" you see a lot of new options. Select all modules that you like, but only those packages you want to use (built in -*- or not -M-), and note that each package selected, it automatically selects proper dependencies. No need to worry about those do not select, because those are not going to download and compile.
|In principle not a good idea to deselect a package, to avoid compilation, but download it later from the snapshots: that may mean we have a "kernel panic" and a lot of runtime errors, since the kernel is not prepared to work with it. If you want to add more features and packages. then recompile to add support. Any generic image from snapshots have all packages selected as modules.|
it only remains to compile (need internet access, you can use "make download" before to prepare the compilation):
If success you can find a trunk/bin/ar71xx with factory and sysupgrade images, along with the packages you have selected to compile on trunk/bin/ar71xx/packages
If you have a compatible backup of configuration (such as those through LuCI) you can enter it in your image, so as simple as creating a folder called trunk/files and unzip the contents there, for example the file trunk/files/etc/config/network with the correct settings for 3g modem. 4)
In case of conflicts between versions if the installed version is older than snapshots (or may not yet have an internet connection configured correctly), a way to fix is have a local server with our compiled packages: on your computer copy trunk/bin/ar71xx/packages over /srv/ftp/packages (vsftpd default with anonymous enabled), and on router edit first line on /etc/opkg.conf:
src/gz snapshots ftp://192.168.1.100/packages
A simple "opkg update" and you will see that it work.
Due to the recent addition to OpenWrt, it is likely that this will improve support for this router, so we can take a look at the scripts to update the code in the first part of this howto about MR3420. However, basic command, before run make over trunk directory, is:
svn update ./scripts/feeds update -a
And remember do a previous backup of your .config, it's easy to be overwritten in the process. But it may not be advisable to recover the backup directly, because it may have added new options or packages. An easy way to see the differences is through diff command.
block-hotplughave been merged with