tl-wr802n v1: 使用Image Generator重新生成我们所需要的firmware

由于 tl-wr802n v1使用的是官方固件:openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin,使得第一次开机,factory reset或者是进入OpenWrt的failsafe模式之后,我们都无法通过有线或者是无线访问设备,进行配置的修改。我想到的方法是对这个固件进行解包:先分离出kernel与rootfs, 再将rootfs进行解包,进而对rootfs中的文件修改。修改完成之后,再打包rootfs,再对kernel进行合并。殊不知官方提供的更好的方法,可以对重新生成我们所需要的image:可以添加、删除固件中预置的package;更重要的是生成的image中的文件都是官方预编译的文件。你甚至可以生成跟官方一模一样的固件。

 

  • 首先从官网下载Image Builder:
mkdir /data/openwrt && cd /data/openwrt
wget https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64.tar.bz2
tar -xvjf OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64.tar.bz2
cd OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64

配置本地编译环境(我所使用的操作系统为:ubuntu-14.04 x86_64):

$ sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc

使用编译系统默认的package配置,生成profile为TLWR841的固件,具体的编译log如下:

hzak@B85PRO:/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64$ make image PROFILE=TLWR841 V=s
make[1]: Entering directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'
echo 'Building images for ar71xx - TP-LINK TL-WR841N/ND'
Building images for ar71xx - TP-LINK TL-WR841N/ND
echo 'Packages: base-files busybox dnsmasq dropbear firewall fstools ip6tables iptables kernel kmod-ath9k kmod-gpio-button-hotplug kmod-nf-nathelper libc libgcc mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe swconfig uboot-envtools uci wpad-mini'
Packages: base-files busybox dnsmasq dropbear firewall fstools ip6tables iptables kernel kmod-ath9k kmod-gpio-button-hotplug kmod-nf-nathelper libc libgcc mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe swconfig uboot-envtools uci wpad-mini
echo

rm -rf /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx
mkdir -p /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/dl
if [ ! -f "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/packages/Packages" ] || [ ! -f "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/packages/Packages.gz" ] || [ "`find /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/packages -cnewer /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/packages/Packages.gz`" ]; then \
		echo "Package list missing or not up-to-date, generating it.";\
		make package_index; \
	else \
		mkdir -p /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp; \
		IPKG_NO_SCRIPT=1 IPKG_TMP="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp/ipkgtmp" IPKG_INSTROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" IPKG_CONF_DIR="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp" IPKG_OFFLINE_ROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/repositories.conf --force-depends --force-overwrite --force-postinstall --cache /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/dl --offline-root /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx --add-dest root:/ --add-arch all:100 --add-arch ar71xx:200 update || true; \
	fi
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/Packages.gz.
Updated list of available packages in /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx//usr/lib/opkg/lists/chaos_calmer_base.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/luci/Packages.gz.
Updated list of available packages in /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx//usr/lib/opkg/lists/chaos_calmer_luci.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/packages/Packages.gz.
Updated list of available packages in /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx//usr/lib/opkg/lists/chaos_calmer_packages.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/routing/Packages.gz.
Updated list of available packages in /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx//usr/lib/opkg/lists/chaos_calmer_routing.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/telephony/Packages.gz.
Updated list of available packages in /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx//usr/lib/opkg/lists/chaos_calmer_telephony.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/management/Packages.gz.
Updated list of available packages in /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx//usr/lib/opkg/lists/chaos_calmer_management.
Downloading file:packages/Packages.
Updated list of available packages in /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx//usr/lib/opkg/lists/imagebuilder.
make package_install
make[2]: Entering directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'

Installing packages...
IPKG_NO_SCRIPT=1 IPKG_TMP="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp/ipkgtmp" IPKG_INSTROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" IPKG_CONF_DIR="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp" IPKG_OFFLINE_ROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/repositories.conf --force-depends --force-overwrite --force-postinstall --cache /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/dl --offline-root /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx --add-dest root:/ --add-arch all:100 --add-arch ar71xx:200 install /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/packages/base/libc_0.9.33.2-1_ar71xx.ipk
Installing libc (0.9.33.2-1) to root...
Installing libgcc (4.8-linaro-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libgcc_4.8-linaro-1_ar71xx.ipk.
Configuring libgcc.
Configuring libc.
IPKG_NO_SCRIPT=1 IPKG_TMP="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp/ipkgtmp" IPKG_INSTROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" IPKG_CONF_DIR="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp" IPKG_OFFLINE_ROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/repositories.conf --force-depends --force-overwrite --force-postinstall --cache /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/dl --offline-root /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx --add-dest root:/ --add-arch all:100 --add-arch ar71xx:200 install /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/packages/base/kernel_3.18.20-1-7bed08fa9c06eb8089e82c200340ec66_ar71xx.ipk
Installing kernel (3.18.20-1-7bed08fa9c06eb8089e82c200340ec66) to root...
Configuring kernel.
IPKG_NO_SCRIPT=1 IPKG_TMP="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp/ipkgtmp" IPKG_INSTROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" IPKG_CONF_DIR="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/tmp" IPKG_OFFLINE_ROOT="/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx" /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/repositories.conf --force-depends --force-overwrite --force-postinstall --cache /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/dl --offline-root /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx --add-dest root:/ --add-arch all:100 --add-arch ar71xx:200 install base-files busybox dnsmasq dropbear firewall fstools ip6tables iptables kernel kmod-ath9k kmod-gpio-button-hotplug kmod-nf-nathelper libc libgcc mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe swconfig uboot-envtools uci wpad-mini
Installing base-files (157-r46767) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/base-files_157-r46767_ar71xx.ipk.
Installing netifd (2015-06-08-8795f9ef89626cd658f615c78c6a17e990c0dcaa) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/netifd_2015-06-08-8795f9ef89626cd658f615c78c6a17e990c0dcaa_ar71xx.ipk.
Installing libuci (2015-04-09.1-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libuci_2015-04-09.1-1_ar71xx.ipk.
Installing libubox (2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libubox_2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8_ar71xx.ipk.
Installing libnl-tiny (0.1-4) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libnl-tiny_0.1-4_ar71xx.ipk.
Installing libubus (2015-05-25-f361bfa5fcb2daadf3b160583ce665024f8d108e) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libubus_2015-05-25-f361bfa5fcb2daadf3b160583ce665024f8d108e_ar71xx.ipk.
Installing ubus (2015-05-25-f361bfa5fcb2daadf3b160583ce665024f8d108e) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/ubus_2015-05-25-f361bfa5fcb2daadf3b160583ce665024f8d108e_ar71xx.ipk.
Installing libblobmsg-json (2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libblobmsg-json_2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8_ar71xx.ipk.
Installing libjson-c (0.12-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libjson-c_0.12-1_ar71xx.ipk.
Installing ubusd (2015-05-25-f361bfa5fcb2daadf3b160583ce665024f8d108e) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/ubusd_2015-05-25-f361bfa5fcb2daadf3b160583ce665024f8d108e_ar71xx.ipk.
Installing jshn (2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/jshn_2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8_ar71xx.ipk.
Installing procd (2015-08-16-0da5bf2ff222d1a499172a6e09507388676b5a08) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/procd_2015-08-16-0da5bf2ff222d1a499172a6e09507388676b5a08_ar71xx.ipk.
Installing libjson-script (2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libjson-script_2015-06-14-d1c66ef1131d14f0ed197b368d03f71b964e45f8_ar71xx.ipk.
Installing ubox (2015-07-14-907d046c8929fb74e5a3502a9498198695e62ad8) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/ubox_2015-07-14-907d046c8929fb74e5a3502a9498198695e62ad8_ar71xx.ipk.
Installing jsonfilter (2014-06-19-cdc760c58077f44fc40adbbe41e1556a67c1b9a9) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/jsonfilter_2014-06-19-cdc760c58077f44fc40adbbe41e1556a67c1b9a9_ar71xx.ipk.
Installing usign (2015-05-08-cf8dcdb8a4e874c77f3e9a8e9b643e8c17b19131) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/usign_2015-05-08-cf8dcdb8a4e874c77f3e9a8e9b643e8c17b19131_ar71xx.ipk.
Installing busybox (1.23.2-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/busybox_1.23.2-1_ar71xx.ipk.
Installing dnsmasq (2.73-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/dnsmasq_2.73-1_ar71xx.ipk.
Installing dropbear (2015.67-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/dropbear_2015.67-1_ar71xx.ipk.
Installing firewall (2015-07-27) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/firewall_2015-07-27_ar71xx.ipk.
Installing libip4tc (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libip4tc_1.4.21-1_ar71xx.ipk.
Installing libxtables (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libxtables_1.4.21-1_ar71xx.ipk.
Installing libip6tc (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libip6tc_1.4.21-1_ar71xx.ipk.
Installing kmod-ipt-core (3.18.20-1) to root...
Downloading file:packages/base/kmod-ipt-core_3.18.20-1_ar71xx.ipk.
Installing kmod-nf-ipt (3.18.20-1) to root...
Downloading file:packages/base/kmod-nf-ipt_3.18.20-1_ar71xx.ipk.
Installing kmod-ipt-nat (3.18.20-1) to root...
Downloading file:packages/base/kmod-ipt-nat_3.18.20-1_ar71xx.ipk.
Installing kmod-nf-nat (3.18.20-1) to root...
Downloading file:packages/base/kmod-nf-nat_3.18.20-1_ar71xx.ipk.
Installing kmod-nf-conntrack (3.18.20-1) to root...
Downloading file:packages/base/kmod-nf-conntrack_3.18.20-1_ar71xx.ipk.
Installing fstools (2015-05-24-09027fc86babc3986027a0e677aca1b6999a9e14) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/fstools_2015-05-24-09027fc86babc3986027a0e677aca1b6999a9e14_ar71xx.ipk.
Installing ip6tables (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/ip6tables_1.4.21-1_ar71xx.ipk.
Installing kmod-ip6tables (3.18.20-1) to root...
Downloading file:packages/base/kmod-ip6tables_3.18.20-1_ar71xx.ipk.
Installing kmod-nf-ipt6 (3.18.20-1) to root...
Downloading file:packages/base/kmod-nf-ipt6_3.18.20-1_ar71xx.ipk.
Installing kmod-nf-conntrack6 (3.18.20-1) to root...
Downloading file:packages/base/kmod-nf-conntrack6_3.18.20-1_ar71xx.ipk.
Installing kmod-ipv6 (3.18.20-1) to root...
Downloading file:packages/base/kmod-ipv6_3.18.20-1_ar71xx.ipk.
Installing kmod-ipt-conntrack (3.18.20-1) to root...
Downloading file:packages/base/kmod-ipt-conntrack_3.18.20-1_ar71xx.ipk.
Installing iptables (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/iptables_1.4.21-1_ar71xx.ipk.
Package iptables (1.4.21-1) installed in root is up to date.
Package kernel (3.18.20-1-7bed08fa9c06eb8089e82c200340ec66) installed in root is up to date.
Installing kmod-ath9k (3.18.20+2015-03-09-3) to root...
Downloading file:packages/base/kmod-ath9k_3.18.20+2015-03-09-3_ar71xx.ipk.
Installing kmod-ath9k-common (3.18.20+2015-03-09-3) to root...
Downloading file:packages/base/kmod-ath9k-common_3.18.20+2015-03-09-3_ar71xx.ipk.
Installing kmod-ath (3.18.20+2015-03-09-3) to root...
Downloading file:packages/base/kmod-ath_3.18.20+2015-03-09-3_ar71xx.ipk.
Installing kmod-mac80211 (3.18.20+2015-03-09-3) to root...
Downloading file:packages/base/kmod-mac80211_3.18.20+2015-03-09-3_ar71xx.ipk.
Installing kmod-crypto-core (3.18.20-1) to root...
Downloading file:packages/base/kmod-crypto-core_3.18.20-1_ar71xx.ipk.
Installing kmod-crypto-arc4 (3.18.20-1) to root...
Downloading file:packages/base/kmod-crypto-arc4_3.18.20-1_ar71xx.ipk.
Installing kmod-crypto-aes (3.18.20-1) to root...
Downloading file:packages/base/kmod-crypto-aes_3.18.20-1_ar71xx.ipk.
Installing kmod-cfg80211 (3.18.20+2015-03-09-3) to root...
Downloading file:packages/base/kmod-cfg80211_3.18.20+2015-03-09-3_ar71xx.ipk.
Installing iw (3.17-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/iw_3.17-1_ar71xx.ipk.
Installing hostapd-common (2015-03-25-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/hostapd-common_2015-03-25-1_ar71xx.ipk.
Installing kmod-gpio-button-hotplug (3.18.20-1) to root...
Downloading file:packages/base/kmod-gpio-button-hotplug_3.18.20-1_ar71xx.ipk.
Installing kmod-nf-nathelper (3.18.20-1) to root...
Downloading file:packages/base/kmod-nf-nathelper_3.18.20-1_ar71xx.ipk.
Package libc (0.9.33.2-1) installed in root is up to date.
Package libgcc (4.8-linaro-1) installed in root is up to date.
Installing mtd (21) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/mtd_21_ar71xx.ipk.
Package netifd (2015-06-08-8795f9ef89626cd658f615c78c6a17e990c0dcaa) installed in root is up to date.
Installing odhcp6c (2015-07-13-024525798c5f6aba3af9b2ef7b3af2f3c14f1db8) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/odhcp6c_2015-07-13-024525798c5f6aba3af9b2ef7b3af2f3c14f1db8_ar71xx.ipk.
Installing odhcpd (2015-05-21-2ebf6c8216287983779c8ec6597d30893b914a7c) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/odhcpd_2015-05-21-2ebf6c8216287983779c8ec6597d30893b914a7c_ar71xx.ipk.
Installing opkg (9c97d5ecd795709c8584e972bfdf3aee3a5b846d-7) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-7_ar71xx.ipk.
Installing ppp (2.4.7-6) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/ppp_2.4.7-6_ar71xx.ipk.
Installing kmod-ppp (3.18.20-1) to root...
Downloading file:packages/base/kmod-ppp_3.18.20-1_ar71xx.ipk.
Installing kmod-lib-crc-ccitt (3.18.20-1) to root...
Downloading file:packages/base/kmod-lib-crc-ccitt_3.18.20-1_ar71xx.ipk.
Installing kmod-slhc (3.18.20-1) to root...
Downloading file:packages/base/kmod-slhc_3.18.20-1_ar71xx.ipk.
Installing ppp-mod-pppoe (2.4.7-6) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/ppp-mod-pppoe_2.4.7-6_ar71xx.ipk.
Installing kmod-pppoe (3.18.20-1) to root...
Downloading file:packages/base/kmod-pppoe_3.18.20-1_ar71xx.ipk.
Installing kmod-pppox (3.18.20-1) to root...
Downloading file:packages/base/kmod-pppox_3.18.20-1_ar71xx.ipk.
Installing swconfig (10) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/swconfig_10_ar71xx.ipk.
Installing uboot-envtools (2014.10-2) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/uboot-envtools_2014.10-2_ar71xx.ipk.
Installing uci (2015-04-09.1-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/uci_2015-04-09.1-1_ar71xx.ipk.
Installing wpad-mini (2015-03-25-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/wpad-mini_2015-03-25-1_ar71xx.ipk.
Configuring opkg.
Configuring libubox.
Configuring libubus.
Configuring libjson-c.
Configuring libblobmsg-json.
Configuring ubusd.
Configuring ubus.
Configuring libnl-tiny.
Configuring iw.
Configuring busybox.
Configuring libuci.
Configuring odhcpd.
Configuring swconfig.
Configuring kmod-lib-crc-ccitt.
Configuring kmod-nf-conntrack.
Configuring kmod-nf-ipt.
Configuring kmod-nf-nat.
Configuring kmod-nf-nathelper.
Configuring kmod-slhc.
Configuring kmod-ppp.
Configuring kmod-pppox.
Configuring kmod-pppoe.
Configuring kmod-ipt-core.
Configuring kmod-ipt-conntrack.
Configuring jshn.
Configuring netifd.
Configuring libjson-script.
Configuring ubox.
Configuring procd.
Configuring jsonfilter.
Configuring usign.
Configuring base-files.
Configuring uboot-envtools.
Configuring dnsmasq.
Configuring libxtables.
Configuring libip4tc.
Configuring libip6tc.
Configuring kmod-ipt-nat.
Configuring firewall.
Configuring kmod-ipv6.
Configuring kmod-nf-conntrack6.
Configuring kmod-nf-ipt6.
Configuring kmod-ip6tables.
Configuring odhcp6c.
Configuring fstools.
Configuring kmod-crypto-core.
Configuring kmod-crypto-arc4.
Configuring kmod-crypto-aes.
Configuring kmod-cfg80211.
Configuring hostapd-common.
Configuring kmod-mac80211.
Configuring kmod-ath.
Configuring kmod-ath9k-common.
Configuring kmod-ath9k.
Configuring uci.
Configuring wpad-mini.
Configuring dropbear.
Configuring mtd.
Configuring ppp.
Configuring kmod-gpio-button-hotplug.
Configuring iptables.
Configuring ip6tables.
Configuring ppp-mod-pppoe.
rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/opkg/lists/*
make[2]: Leaving directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'
make package_postinst
make[2]: Entering directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'

Cleaning up

Activating init scripts
rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/usr/lib/opkg/info/*.postinst
make[2]: Leaving directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'
make build_image
make[2]: Entering directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'

Building images...
make V=ss -C target/linux/ar71xx/image install TARGET_BUILD=1 IB=1 \
		PROFILE="TLWR841"
make[3]: Entering directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/target/linux/ar71xx/image'
mkdir -p /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp
# Use symbolic permissions to avoid clobbering SUID/SGID/sticky bits
find /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx -type f -not -perm /0100 -not -name 'ssh_host*' -not -name 'shadow' -print0 | xargs -r -0 chmod u+rw,g+r,o+r
find /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx -type f -perm /0100 -print0 | xargs -r -0 chmod u+rwx,g+rx,o+rx
find /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx -type d -print0 | xargs -r -0 chmod u+rwx,g+rx,o+rx
install -d -m0755 /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/overlay
chmod 1777 /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.elf /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-vmlinux.elf
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-vmlinux.bin
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.lzma of=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-vmlinux.lzma bs=65536 conv=sync
16+1 records in
17+0 records out
1114112 bytes (1.1 MB) copied, 0.00070491 s, 1.6 GB/s
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.gz of=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-vmlinux.gz bs=65536 conv=sync
23+1 records in
24+0 records out
1572864 bytes (1.6 MB) copied, 0.00100859 s, 1.6 GB/s
mkimage -A mips -O linux -T kernel -a 0x80060000 -C gzip  -e 0x80060000 -n 'MIPS OpenWrt Linux-3.18.20' -d /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.gz /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-uImage-gzip.bin
Image Name:   MIPS OpenWrt Linux-3.18.20
Created:      Tue Jan 26 09:52:15 2016
Image Type:   MIPS Linux Kernel Image (gzip compressed)
Data Size:    1530864 Bytes = 1494.98 kB = 1.46 MB
Load Address: 80060000
Entry Point:  80060000
mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma  -e 0x80060000 -n 'MIPS OpenWrt Linux-3.18.20' -d /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.lzma /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-uImage-lzma.bin
Image Name:   MIPS OpenWrt Linux-3.18.20
Created:      Tue Jan 26 09:52:15 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1098458 Bytes = 1072.71 kB = 1.05 MB
Load Address: 80060000
Entry Point:  80060000
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-generic.elf /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-vmlinux-lzma.elf
mkdir -p /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mksquashfs4 /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs -nopad -noappend -root-owned -comp xz -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2  -b 256k -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' -processors 1
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs, block size 262144.
Pseudo file "/dev" exists in source filesystem "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/dev".
Ignoring, exclude it (-e/-ef) to override.
[==================================================================================================================================================================================================\] 511/511 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 262144
	compressed data, compressed metadata, compressed fragments, no xattrs
	duplicates are removed
Filesystem size 1803.03 Kbytes (1.76 Mbytes)
	35.47% of uncompressed filesystem size (5082.89 Kbytes)
Inode table size 5660 bytes (5.53 Kbytes)
	22.76% of uncompressed inode table size (24870 bytes)
Directory table size 7244 bytes (7.07 Kbytes)
	48.04% of uncompressed directory table size (15078 bytes)
Number of duplicate files found 68
Number of inodes 744
Number of files 507
Number of fragments 12
Number of symbolic links  180
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 56
Number of ids (unique uids + gids) 1
Number of uids 1
	unknown (0)
Number of gids 1
	unknown (0)
[ -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v8-kernel.bin -a -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs ]
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs  >> /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin
3606+1 records in
3606+1 records out
1846300 bytes (1.8 MB) copied, 0.00553082 s, 334 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410008 -W 0x1 -F 4Mlzma -N OpenWrt -V r46767 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v8-kernel.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin.new -j -X 0x40000 -a 0x4 -s && mv /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin.new /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin || rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin
[mktplinkfw] kernel length aligned to 1098588
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin.new" completed
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin
[ -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v8-kernel.bin -a -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs ]
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs  >> /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin
3606+1 records in
3606+1 records out
1846300 bytes (1.8 MB) copied, 0.00550053 s, 336 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410008 -W 0x1 -F 4Mlzma -N OpenWrt -V r46767 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v8-kernel.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin.new -j -X 0x40000 -a 0x4  && mv /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin.new /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin || rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin
[mktplinkfw] kernel length aligned to 1098588
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin.new" completed
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin
[ -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v9-kernel.bin -a -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs ]
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs  >> /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin
3606+1 records in
3606+1 records out
1846300 bytes (1.8 MB) copied, 0.00547247 s, 337 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410009 -W 0x1 -F 4Mlzma -N OpenWrt -V r46767 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v9-kernel.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin.new -j -X 0x40000 -a 0x4 -s && mv /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin.new /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin || rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin
[mktplinkfw] kernel length aligned to 1098588
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin.new" completed
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin
[ -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v9-kernel.bin -a -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs ]
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs  >> /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin
3606+1 records in
3606+1 records out
1846300 bytes (1.8 MB) copied, 0.00575575 s, 321 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410009 -W 0x1 -F 4Mlzma -N OpenWrt -V r46767 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr841n-v9-kernel.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin.new -j -X 0x40000 -a 0x4  && mv /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin.new /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin || rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin
[mktplinkfw] kernel length aligned to 1098588
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin.new" completed
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin
[ -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr847n-v8-kernel.bin -a -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs ]
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs  >> /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin
3606+1 records in
3606+1 records out
1846300 bytes (1.8 MB) copied, 0.00550677 s, 335 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08470008 -W 0x1 -F 4Mlzma -N OpenWrt -V r46767 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr847n-v8-kernel.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin.new -j -X 0x40000 -a 0x4 -s && mv /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin.new /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin || rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin
[mktplinkfw] kernel length aligned to 1098588
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin.new" completed
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin
[ -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr847n-v8-kernel.bin -a -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs ]
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs  >> /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin
3606+1 records in
3606+1 records out
1846300 bytes (1.8 MB) copied, 0.0054616 s, 338 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08470008 -W 0x1 -F 4Mlzma -N OpenWrt -V r46767 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tl-wr847n-v8-kernel.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin.new -j -X 0x40000 -a 0x4  && mv /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin.new /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin || rm -f /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin
[mktplinkfw] kernel length aligned to 1098588
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin.new" completed
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-raw
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-64k
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/padjffs2 /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-64k 64
padding image to 001d0000
cp /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-64k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-root.squashfs-64k
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/padjffs2 /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs 4 8 16 64 128 256
padding image to 001c3000
padding image to 001c4000
padding image to 001d0000
padding image to 001e0000
padding image to 00200000
dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs of=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-root.squashfs bs=128k conv=sync
16+1 records in
17+0 records out
2228224 bytes (2.2 MB) copied, 0.00133788 s, 1.7 GB/s
[ -e "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v1.5.gz" ]
mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma -M 0x4f4b4c49 -e 0x80060000 -n 'MIPS OpenWrt Linux-3.18.20' -d /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.lzma /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v1.5.okli
Image Name:   MIPS OpenWrt Linux-3.18.20
Created:      Tue Jan 26 09:52:17 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1098458 Bytes = 1072.71 kB = 1.05 MB
Load Address: 80060000
Entry Point:  80060000
( dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v1.5.gz bs=7680 count=1 conv=sync; dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v1.5.okli conv=sync; ) > /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v1.5.bin
0+1 records in
1+0 records out
7680 bytes (7.7 kB) copied, 5.4255e-05 s, 142 MB/s
2145+1 records in
2146+0 records out
1098752 bytes (1.1 MB) copied, 0.00334573 s, 328 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410002 -W 2 -F 4M -N OpenWrt -V r46767 -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v1.5.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v1.5-squashfs-factory.bin
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v1.5-squashfs-factory.bin" completed
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410002 -W 2 -F 4M -N OpenWrt -V r46767 -s -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v1.5.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v1.5-squashfs-sysupgrade.bin
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v1.5-squashfs-sysupgrade.bin" completed
[ -e "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v3.gz" ]
mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma -M 0x4f4b4c49 -e 0x80060000 -n 'MIPS OpenWrt Linux-3.18.20' -d /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.lzma /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v3.okli
Image Name:   MIPS OpenWrt Linux-3.18.20
Created:      Tue Jan 26 09:52:17 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1098458 Bytes = 1072.71 kB = 1.05 MB
Load Address: 80060000
Entry Point:  80060000
( dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v3.gz bs=7680 count=1 conv=sync; dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v3.okli conv=sync; ) > /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v3.bin
0+1 records in
1+0 records out
7680 bytes (7.7 kB) copied, 5.2303e-05 s, 147 MB/s
2145+1 records in
2146+0 records out
1098752 bytes (1.1 MB) copied, 0.00332072 s, 331 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410003 -W 3 -F 4M -N OpenWrt -V r46767 -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v3.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-raw -a 0x4 -j -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v3-squashfs-factory.bin
[mktplinkfw] kernel length aligned to 1106432
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v3-squashfs-factory.bin" completed
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410003 -W 3 -F 4M -N OpenWrt -V r46767 -s -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v3.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-raw -a 0x4 -j -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v3-squashfs-sysupgrade.bin
[mktplinkfw] kernel length aligned to 1106432
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v3-squashfs-sysupgrade.bin" completed
[ -e "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v5.gz" ]
mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma -M 0x4f4b4c49 -e 0x80060000 -n 'MIPS OpenWrt Linux-3.18.20' -d /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.lzma /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v5.okli
Image Name:   MIPS OpenWrt Linux-3.18.20
Created:      Tue Jan 26 09:52:17 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1098458 Bytes = 1072.71 kB = 1.05 MB
Load Address: 80060000
Entry Point:  80060000
( dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v5.gz bs=7680 count=1 conv=sync; dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v5.okli conv=sync; ) > /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v5.bin
0+1 records in
1+0 records out
7680 bytes (7.7 kB) copied, 5.4539e-05 s, 141 MB/s
2145+1 records in
2146+0 records out
1098752 bytes (1.1 MB) copied, 0.00331697 s, 331 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410005 -W 1 -F 4M -N OpenWrt -V r46767 -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v5.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-raw -a 0x4 -j -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v5-squashfs-factory.bin
[mktplinkfw] kernel length aligned to 1106432
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v5-squashfs-factory.bin" completed
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410005 -W 1 -F 4M -N OpenWrt -V r46767 -s -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v5.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-raw -a 0x4 -j -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v5-squashfs-sysupgrade.bin
[mktplinkfw] kernel length aligned to 1106432
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v5-squashfs-sysupgrade.bin" completed
[ -e "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v7.gz" ]
mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma -M 0x4f4b4c49 -e 0x80060000 -n 'MIPS OpenWrt Linux-3.18.20' -d /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/vmlinux.bin.lzma /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v7.okli
Image Name:   MIPS OpenWrt Linux-3.18.20
Created:      Tue Jan 26 09:52:17 2016
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:    1098458 Bytes = 1072.71 kB = 1.05 MB
Load Address: 80060000
Entry Point:  80060000
( dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/loader-tl-wr841nd-v7.gz bs=7680 count=1 conv=sync; dd if=/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/vmlinux-tl-wr841nd-v7.okli conv=sync; ) > /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v7.bin
0+1 records in
1+0 records out
7680 bytes (7.7 kB) copied, 5.3959e-05 s, 142 MB/s
2145+1 records in
2146+0 records out
1098752 bytes (1.1 MB) copied, 0.00330209 s, 333 MB/s
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410007 -W 1 -F 4M -N OpenWrt -V r46767 -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v7.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-raw -a 0x4 -j -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v7-squashfs-factory.bin
[mktplinkfw] kernel length aligned to 1106432
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v7-squashfs-factory.bin" completed
/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/mktplinkfw -H 0x08410007 -W 1 -F 4M -N OpenWrt -V r46767 -s -X 0x40000 -k /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/tmp/kernel-tl-wr841nd-v7.bin -r /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/root.squashfs-raw -a 0x4 -j -o /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v7-squashfs-sysupgrade.bin
[mktplinkfw] kernel length aligned to 1106432
[mktplinkfw] firmware file "/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx/openwrt-15.05-ar71xx-generic-tl-wr841nd-v7-squashfs-sysupgrade.bin" completed
( cd /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs md5sum --binary > md5sums )
( cd /data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs openssl dgst -sha256 > sha256sums )
make[3]: Leaving directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/target/linux/ar71xx/image'
make[2]: Leaving directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'
make[1]: Leaving directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'

#### make completed successfully (5 seconds) ####

最终在bin目录下生成所有相关的固件:

hzak@B85PRO:/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64$ ls bin/ar71xx/
md5sums                                                               openwrt-15.05-ar71xx-generic-tl-wr841nd-v7-squashfs-factory.bin     openwrt-15.05-ar71xx-generic-uImage-lzma.bin
openwrt-15.05-ar71xx-generic-root.squashfs                            openwrt-15.05-ar71xx-generic-tl-wr841nd-v7-squashfs-sysupgrade.bin  openwrt-15.05-ar71xx-generic-vmlinux.bin
openwrt-15.05-ar71xx-generic-root.squashfs-64k                        openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin      openwrt-15.05-ar71xx-generic-vmlinux.elf
openwrt-15.05-ar71xx-generic-tl-wr841nd-v1.5-squashfs-factory.bin     openwrt-15.05-ar71xx-generic-tl-wr841n-v8-squashfs-sysupgrade.bin   openwrt-15.05-ar71xx-generic-vmlinux.gz
openwrt-15.05-ar71xx-generic-tl-wr841nd-v1.5-squashfs-sysupgrade.bin  openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-factory.bin      openwrt-15.05-ar71xx-generic-vmlinux.lzma
openwrt-15.05-ar71xx-generic-tl-wr841nd-v3-squashfs-factory.bin       openwrt-15.05-ar71xx-generic-tl-wr841n-v9-squashfs-sysupgrade.bin   openwrt-15.05-ar71xx-generic-vmlinux-lzma.elf
openwrt-15.05-ar71xx-generic-tl-wr841nd-v3-squashfs-sysupgrade.bin    openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-factory.bin      sha256sums
openwrt-15.05-ar71xx-generic-tl-wr841nd-v5-squashfs-factory.bin       openwrt-15.05-ar71xx-generic-tl-wr847n-v8-squashfs-sysupgrade.bin
openwrt-15.05-ar71xx-generic-tl-wr841nd-v5-squashfs-sysupgrade.bin    openwrt-15.05-ar71xx-generic-uImage-gzip.bin

不得不服啊!

  • 再看看如何生成跟官方固件一样的固件:

从路由器由获取package安装列表:

root@OpenWrt-wr802n-v1:~# echo $(opkg list_installed | awk '{ print $1 }')
base-files busybox dnsmasq dropbear firewall fstools hostapd-common ip6tables iptables iw jshn jsonfilter kernel kmod-ath kmod-ath9k kmod-ath9k-common kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-gpio-button-hotplug kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-ipv6 kmod-lib-crc-ccitt kmod-mac80211 kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-ipt kmod-nf-ipt6 kmod-nf-nat kmod-nf-nathelper kmod-ppp kmod-pppoe kmod-pppox kmod-slhc libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo libiwinfo-lua libjson-c libjson-script liblua libnl-tiny libubox libubus libubus-lua libuci libuci-lua libxtables lua luci luci-app-firewall luci-base luci-lib-ip luci-lib-nixio luci-mod-admin-full luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe procd rpcd swconfig uboot-envtools ubox ubus ubusd uci uhttpd uhttpd-mod-ubus usign wpad-mini
root@OpenWrt-wr802n-v1:~# 

编译时指定package:

hzak@B85PRO:/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64$ make image PROFILE=TLWR841 V=s PACKAGES="base-files busybox dnsmasq dropbear firewall fstools hostapd-common ip6tables iptables iw jshn jsonfilter kernel kmod-ath kmod-ath9k kmod-ath9k-common kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-gpio-button-hotplug kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-ipv6 kmod-lib-crc-ccitt kmod-mac80211 kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-ipt kmod-nf-ipt6 kmod-nf-nat kmod-nf-nathelper kmod-ppp kmod-pppoe kmod-pppox kmod-slhc libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo libiwinfo-lua libjson-c libjson-script liblua libnl-tiny libubox libubus libubus-lua libuci libuci-lua libxtables lua luci luci-app-firewall luci-base luci-lib-ip luci-lib-nixio luci-mod-admin-full luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe procd rpcd swconfig uboot-envtools ubox ubus ubusd uci uhttpd uhttpd-mod-ubus usign wpad-mini"
make[1]: Entering directory `/data/openwrt/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64'
echo 'Building images for ar71xx - TP-LINK TL-WR841N/ND'
Building images for ar71xx - TP-LINK TL-WR841N/ND
echo 'Packages: base-files busybox dnsmasq dropbear firewall fstools hostapd-common ip6tables iptables iw jshn jsonfilter kernel kmod-ath kmod-ath9k kmod-ath9k-common kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-gpio-button-hotplug kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-ipv6 kmod-lib-crc-ccitt kmod-mac80211 kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-ipt kmod-nf-ipt6 kmod-nf-nat kmod-nf-nathelper kmod-ppp kmod-pppoe kmod-pppox kmod-slhc libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo libiwinfo-lua libjson-c libjson-script liblua libnl-tiny libubox libubus libubus-lua libuci libuci-lua libxtables lua luci luci-app-firewall luci-base luci-lib-ip luci-lib-nixio luci-mod-admin-full luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe procd rpcd swconfig uboot-envtools ubox ubus ubusd uci uhttpd uhttpd-mod-ubus usign wpad-mini'
Packages: base-files busybox dnsmasq dropbear firewall fstools hostapd-common ip6tables iptables iw jshn jsonfilter kernel kmod-ath kmod-ath9k kmod-ath9k-common kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-gpio-button-hotplug kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-ipv6 kmod-lib-crc-ccitt kmod-mac80211 kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-ipt kmod-nf-ipt6 kmod-nf-nat kmod-nf-nathelper kmod-ppp kmod-pppoe kmod-pppox kmod-slhc libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo libiwinfo-lua libjson-c libjson-script liblua libnl-tiny libubox libubus libubus-lua libuci libuci-lua libxtables lua luci luci-app-firewall luci-base luci-lib-ip luci-lib-nixio luci-mod-admin-full luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe procd rpcd swconfig uboot-envtools ubox ubus ubusd uci uhttpd uhttpd-mod-ubus usign wpad-mini

当然,你也可以指定FILES变量加入到固件中的文件,如配置文件:

$ make image PROFILE=XXX PACKAGES="XXX" FILES=files/

NOTE: files是当前路径下的一个文件夹,包含你希望加入到固件中的文件。

  • 实战

包含更改flash size为8MB, 使用自定义的/etc/config/firewall和/etc/config/wireless文件

#! /bin/bash
set -e -x

FLASH_SIZE=16

sed -i -e "519s/4mlzma/${FLASH_SIZE}mlzma/g" \
    -e "526s/4mlzma/${FLASH_SIZE}mlzma/g" \
    -e "547s/4mlzma/${FLASH_SIZE}mlzma/g" \
    -e "1953s/4M/${FLASH_SIZE}M/g" \
    -e "1968s/4M/${FLASH_SIZE}M/g" \
    -e "1969s/4M/${FLASH_SIZE}M/g" \
    -e "1970s/4M/${FLASH_SIZE}M/g" target/linux/ar71xx/image/Makefile

mkdir -pv files/etc/config
cat > files/etc/config/firewall << EOF
config defaults
	option syn_flood	1
	option input		ACCEPT
	option output		ACCEPT
	option forward		REJECT
# Uncomment this line to disable ipv6 rules
#	option disable_ipv6	1

config zone
	option name		lan
	list   network		'lan'
	option input		ACCEPT
	option output		ACCEPT
	option forward		ACCEPT

config zone
	option name		wan
	list   network		'wan'
	list   network		'wan6'
	option input		ACCEPT
	option output		ACCEPT
	option forward		REJECT
	option masq		1
	option mtu_fix		1

config forwarding
	option src		lan
	option dest		wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
	option name		Allow-DHCP-Renew
	option src		wan
	option proto		udp
	option dest_port	68
	option target		ACCEPT
	option family		ipv4

# Allow IPv4 ping
config rule
	option name		Allow-Ping
	option src		wan
	option proto		icmp
	option icmp_type	echo-request
	option family		ipv4
	option target		ACCEPT

config rule
	option name		Allow-IGMP
	option src		wan
	option proto		igmp
	option family		ipv4
	option target		ACCEPT

# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
	option name		Allow-DHCPv6
	option src		wan
	option proto		udp
	option src_ip		fe80::/10
	option src_port		547
	option dest_ip		fe80::/10
	option dest_port	546
	option family		ipv6
	option target		ACCEPT

config rule
	option name		Allow-MLD
	option src		wan
	option proto		icmp
	option src_ip		fe80::/10
	list icmp_type		'130/0'
	list icmp_type		'131/0'
	list icmp_type		'132/0'
	list icmp_type		'143/0'
	option family		ipv6
	option target		ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Input
	option src		wan
	option proto	icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	list icmp_type		router-solicitation
	list icmp_type		neighbour-solicitation
	list icmp_type		router-advertisement
	list icmp_type		neighbour-advertisement
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
	option name		Allow-ICMPv6-Forward
	option src		wan
	option dest		*
	option proto		icmp
	list icmp_type		echo-request
	list icmp_type		echo-reply
	list icmp_type		destination-unreachable
	list icmp_type		packet-too-big
	list icmp_type		time-exceeded
	list icmp_type		bad-header
	list icmp_type		unknown-header-type
	option limit		1000/sec
	option family		ipv6
	option target		ACCEPT

# include a file with users custom iptables rules
config include
	option path /etc/firewall.user


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option dest		wan
#	option proto	tcp
#	option target	REJECT

# block a specific mac on wan
#config rule
#	option dest		wan
#	option src_mac	00:11:22:33:44:66
#	option target	REJECT

# block incoming ICMP traffic on a zone
#config rule
#	option src		lan
#	option proto	ICMP
#	option target	DROP

# port redirect port coming in on wan to lan
#config redirect
#	option src			wan
#	option src_dport	80
#	option dest			lan
#	option dest_ip		192.168.16.235
#	option dest_port	80
#	option proto		tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#	option src		wan
#	option src_dport	22001
#	option dest		lan
#	option dest_port	22
#	option proto		tcp

# allow IPsec/ESP and ISAKMP passthrough
config rule
	option src		wan
	option dest		lan
	option proto		esp
	option target		ACCEPT

config rule
	option src		wan
	option dest		lan
	option dest_port	500
	option proto		udp
	option target		ACCEPT

### FULL CONFIG SECTIONS
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port	80
#	option dest		wan
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
#	option target	REJECT

#config redirect
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port		1024
#	option src_dport	80
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
EOF

cat > files/etc/config/wireless << EOF

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'platform/qca953x_wmac'
	option htmode 'HT20'
	option country 'US'
	option channel '10'
	option txpower '28'

config wifi-iface
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option ssid 'OpenWrt-wr802n-v1'
	option key 'happy@unknown'
EOF

make PROFILE=TLWR841 PACKAGES="base-files bind-dig bind-libs busybox dnsmasq \
	dropbear firewall fstools hostapd-common ip ip6tables ipset iptables \
	iptables-mod-tproxy iw jshn jsonfilter kernel kmod-ath kmod-ath9k \
	kmod-ath9k-common kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 \
	kmod-crypto-core kmod-gpio-button-hotplug kmod-ip6tables kmod-ipt-conntrack \
	kmod-ipt-core kmod-ipt-ipset kmod-ipt-nat kmod-ipt-tproxy kmod-ipv6 \
	kmod-lib-crc-ccitt kmod-mac80211 kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-ipt \
	kmod-nf-ipt6 kmod-nf-nat kmod-nf-nathelper kmod-nfnetlink kmod-ppp kmod-pppoe \
	kmod-pppox kmod-slhc libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo \
	libiwinfo-lua libjson-c libjson-script liblua libmnl libnl-tiny libopenssl \
	libpcap libpthread libubox libubus libubus-lua libuci libuci-lua libxtables lua \
	luci luci-app-firewall luci-base luci-lib-ip luci-lib-nixio luci-mod-admin-full \
	luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd \
	opkg ppp ppp-mod-pppoe procd rpcd swconfig tcpdump uboot-envtools ubox ubus \
	ubusd uci uhttpd uhttpd-mod-ubus usign wpad-mini zlib" FILES=files/ image

相关的文档可以参考:

  1. https://wiki.openwrt.org/doc/howto/obtain.firmware.generate
  2. https://wiki.openwrt.org/doc/howto/obtain.firmware
  3. https://wiki.openwrt.org/doc/howto/build

 

评论

Be the First to Comment!

提醒我
avatar

wpDiscuz