[OpenWrt-Devel] [RFC PATCH] ar71xx: Support Antminer S1/S3

Dirk Neukirchen dirkneukirchen at web.de
Fri May 1 06:59:22 EDT 2015


some comments inline

On 30.04.2015 04:08, James Hilliard wrote:
> The Antminer S1 and S3 use a controller with a modified version of
> OpenWRT which has a single ethernet port and a wifi antenna header.
> This is the patch from their GPL source release which appears to break
> support for the tl-wr741nd-v4 in order to support their board. What
> would be the proper way to differentiate this device and add support
> for it?
> 

A separate ARCH file because replacing 741ND-v4 will break that unit
This patch contains many different changes so it has to be split up.

> Index: target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c
> ===================================================================
> --- target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c
> (revision 38031)
> +++ target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c
> (working copy)

see above - create new file or make changes so it does not break
supported targets

> Index: target/linux/ar71xx/files/drivers/mtd/tplinkpart.c
> ===================================================================
> --- target/linux/ar71xx/files/drivers/mtd/tplinkpart.c (revision 38031)
> +++ target/linux/ar71xx/files/drivers/mtd/tplinkpart.c (working copy)
> @@ -149,7 +149,7 @@
>   parts[0].name = "u-boot";
>   parts[0].offset = 0;
>   parts[0].size = offset;
> - parts[0].mask_flags = MTD_WRITEABLE;
> + //parts[0].mask_flags = MTD_WRITEABLE;

This seems to remove write protection from u-boot.
This is dangerous and can result in really bad bricks


> Index: target/linux/ar71xx/image/Makefile
> ===================================================================
> --- target/linux/ar71xx/image/Makefile (revision 38031)
> +++ target/linux/ar71xx/image/Makefile (working copy)
> @@ -921,7 +921,8 @@
> -$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR743NV2,tl-wr743nd-v2,TL-WR741ND-v4,ttyATH0,115200,0x07430002,1,4Mlzma))
> +#$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR743NV2,tl-wr743nd-v2,TL-WR741ND-v4,ttyATH0,115200,0x07430002,1,4Mlzma))
> +$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR743NV2,tl-wr743nd-v2,TL-WR741ND-v4,ttyATH0,115200,0x07430002,1,8Mlzma))

Same as first comment - this breaks/disables the working images of that router

> --- package/network/services/dropbear/files/dropbear.config (revision 38031)
> +++ package/network/services/dropbear/files/dropbear.config (working copy)
> @@ -2,4 +2,5 @@
>   option PasswordAuth 'on'
>   option RootPasswordAuth 'on'
>   option Port         '22'
> +# option Interface 'lan'
>  # option BannerFile   '/etc/banner'

dropbear change that affects all other platforms - remove

> Index: package/base-files/files/lib/functions/uci-defaults.sh
> ===================================================================
> --- package/base-files/files/lib/functions/uci-defaults.sh (revision 38031)
> +++ package/base-files/files/lib/functions/uci-defaults.sh (working copy)

afaics this is related to LED and probably not needed


> Index: package/base-files/files/etc/rc.button/reset
> ===================================================================
> --- package/base-files/files/etc/rc.button/reset (revision 38031)
> +++ package/base-files/files/etc/rc.button/reset (working copy)
> @@ -14,5 +14,5 @@
>  elif [ "$SEEN" -gt 5 ]
>  then
>   echo "FACTORY RESET" > /dev/console
> - jffs2reset -y && reboot &
> + jffs2reset -y && reboot -f &

as before this would affect other boards too

>  fi
> Index: package/base-files/files/etc/shadow
> ===================================================================
> --- package/base-files/files/etc/shadow (revision 38031)
> +++ package/base-files/files/etc/shadow (working copy)
> @@ -1,4 +1,5 @@
> -root:x:0:0:99999:7:::
> +root:$1$2zyJL0u3$UjHfNFlkkj9azThzkLaVA0:16013:0:99999:7:::
> +admin:*:16013:0:99999:7:::

remove (default root password that is antminer device/software specific)
Is admin account needed for all other platforms?
(add it to the software packages that needs it)

> Index: package/base-files/files/etc/profile
> ===================================================================
> --- package/base-files/files/etc/profile (revision 38031)
> +++ package/base-files/files/etc/profile (working copy)
> @@ -8,6 +8,7 @@
> 
>  [ -x /bin/more ] || alias more=less
>  [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
> +[ -x /bin/ls ] && alias ll=ls -l

while nice this might waste some bytes 

> 
>  [ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
> 
> Index: package/base-files/files/etc/config/system
> ===================================================================
> --- package/base-files/files/etc/config/system (revision 38031)
> +++ package/base-files/files/etc/config/system (working copy)
> @@ -1,6 +1,8 @@
>  config system
> - option hostname OpenWrt
> - option timezone UTC
> + option hostname antMiner
> + #option timezone UTC
> + option zonename 'Asia/Shanghai'
> +        option timezone 'CST-8'

remove - antMiner firmware specific settings

> Index: tools/firmware-utils/src/mktplinkfw.c
> ===================================================================
> --- tools/firmware-utils/src/mktplinkfw.c (revision 38031)
> +++ tools/firmware-utils/src/mktplinkfw.c (working copy)
> @@ -269,10 +269,16 @@


the changeset for this file disables working images
when it should only add an image for that antminer device

> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list