insert prepare script

include numerous fixes
ansible
Peter Babič 3 years ago
parent 9297efe1f5
commit 720d11c539
Signed by: peter.babic
GPG Key ID: 4BB075BC1884BA40
  1. 1
      .gitattributes
  2. 2
      .gitignore
  3. 59
      README.md
  4. 5
      build.sh
  5. BIN
      firmware/Archer MR200v1_0.9.1_1.2_up_boot_v004a.0 Build 180502 Rel.53881n.bin
  6. BIN
      firmware/ArcherC2V1_tp_recovery.bin
  7. BIN
      firmware/ArcherMR200_bootloader.bin
  8. 9
      firmware/README.md
  9. BIN
      firmware/extracted_firmware.bin
  10. BIN
      firmware/openwrt-19.07.6-ramips-mt7620-ArcherMR200-squashfs-sysupgrade.bin
  11. 20
      prepare.sh

1
.gitattributes vendored

@ -0,0 +1 @@
*.bin filter=lfs diff=lfs merge=lfs -text

2
.gitignore vendored

@ -1,3 +1,3 @@
openwrt-imagebuilder*
bin/
mt7620
sha256sum*

@ -1,14 +1,28 @@
# OpenWRT for TP-Link MR200v1
Turn on the device while pushing the WPS button until the WPS light turns
on. At that point, the bootloaders integrated tftp client with the ip
address of 192.168.1.1, tries to connect to a tftp server running at
address 192.168.0.66 and getting the file named ArcherC2V1_tp_recovery.bin.
so you need to be running a tftp server with the ip/netmask of
192.168.0.66/23 and connect it to lan port1. It is vital that your firmware
includes the bootloader at the very beginning (without any extra tp-link
header) as the bootloader will start writing the firmware to flash with the
starting address of 0x00000000.
**Follow all steps at own risk!**
Before downloading anything, consider reading the blog post:
<https://peterbabic.dev/blog/how-verify-openwrt-integrity-files>
## Recovery image preparation
The recovery image is used to replace the stock firmware with OpenWRT via
TFTP. Citing the MR200 OpenWRT
[manual](https://openwrt.org/toh/tp-link/archer-mr200):
> Turn on the device while pushing the WPS button until the WPS light turns
> on. At that point, the bootloaders integrated tftp client with the ip
> address of 192.168.1.1, tries to connect to a tftp server running at
> address 192.168.0.66 and getting the file named
> **ArcherC2V1_tp_recovery.bin**. so you need to be running a tftp server
> with the ip/netmask of 192.168.0.66/23 and connect it to lan port1. It is
> vital that your firmware includes the bootloader at the very beginning
> (without any extra tp-link header) as the bootloader will start writing
> the firmware to flash with the starting address of 0x00000000.
Manual recovery image preparation:
```bash
cd firmware
@ -16,8 +30,18 @@ dd bs=512 obs=512 skip=1 count=256 if=Archer\ MR200v1_0.9.1_1.2_up_boot_v004a.0\
cat ArcherMR200_bootloader.bin openwrt-19.07.6-ramips-mt7620-ArcherMR200-squashfs-sysupgrade.bin > ArcherC2V1_tp_recovery.bin
```
More at MR200 OpenWRT
[manual](https://openwrt.org/toh/tp-link/archer-mr200).
Manual recovery image upload using TFTP:
```bash
sudo pacman -S atftp
sudo mkdir -p /srv/atftp
sudo cp firmware/ArcherC2V1_tp_recovery.bin /srv/atftp
sudo chown -R atftp:atftp /srv/atftp
sudo ifconfig enp0s31f6 192.168.0.66/23
sudo systemctl start atftpd.service
# Optionally test TFTP server is working properly
#curl -O tftp:/192.168.0.66/ArcherC2V1_tp_recovery.bin
```
## Revert to TP-Link stock firmware
@ -29,7 +53,7 @@ cd firmware
dd bs=512 obs=512 skip=257 count=15744 if=Archer\ MR200v1_0.9.1_1.2_up_boot_v004a.0\ Build\ 180502\ Rel.53881n.bin of=extracted_firmware.bin
scp extracted_firmware.bin root@openwrt:/tmp
/usr/bin/ssh root@openwrt
mtd -r write stock.bin firmware
mtd -r write extracted_firmware.bin firmware
```
## 4G signal LED integration
@ -48,6 +72,8 @@ reboot
## Custom image with built in LED signal integration
Manual custom image build steps:
```bash
pacman -S --needed base-devel ncurses zlib gawk git gettext openssl libxslt wget unzip python
wget https://downloads.openwrt.org/snapshots/targets/ramips/mt7620/openwrt-imagebuilder-ramips-mt7620.Linux-x86_64.tar.xz
@ -57,11 +83,12 @@ ln -s ../files .
make image PROFILE=tplink_archer-mr200 PACKAGES="curl" FILES=files/
```
The sysupgrade
[file](./openwrt-imagebuilder-ramips-mt7620.Linux-x86_64/bin/targets/ramips/mt7620/openwrt-ramips-mt7620-tplink_archer-mr200-squashfs-sysupgrade.bin)
is available at
The sysupgrade file is available at
`openwrt-imagebuilder-ramips-mt7620.Linux-x86_64/bin/targets/ramips/mt7620/openwrt-ramips-mt7620-tplink_archer-mr200-squashfs-sysupgrade.bin`
and includes `curl` and the LED script.
after the build and includes `curl` and the LED script.
Alternatively, the steps are automated in a [build.sh](./build.sh) script.
After running, the custom image file is conveniently symlinked to `mt7620`.
## Credit

@ -5,7 +5,6 @@ dlUrl="https://downloads.openwrt.org/snapshots/targets/ramips/mt7620"
folderName="openwrt-imagebuilder-ramips-mt7620.Linux-x86_64"
sumsFile="sha256sums"
ascFile="$sumsFile.asc"
outDir="bin"
sudo pacman -q -S --needed base-devel ncurses zlib gawk git gettext openssl libxslt wget unzip python gnupg
@ -43,11 +42,11 @@ else
tar xJf "$archive"
fi
mkdir -p "$outDir"
cd "$folderName"
ln -s ../files .
make image PROFILE=tplink_archer-mr200 PACKAGES="curl" FILES=files/
cp ./bin/targets/ramips/mt7620/openwrt-ramips-mt7620-tplink_archer-mr200-squashfs-sysupgrade.bin "../$outDir/ArcherC2V1_tp_recovery.bin"
cd ..
ln -s "$folderName/bin/targets/ramips/mt7620/" .

@ -0,0 +1,9 @@
# Firmware
The file
`Archer MR200v1_0.9.1_1.2_up_boot_v004a.0 Build 180502 Rel.53881n.bin` is
the firmware used in the process and is used during build and stored here
in case that reverting bac kto stock is required.
Other files here are stored for achiving purpose - all the files are
created against the OpenWRT version of `v19.07.6`.

Binary file not shown.

@ -0,0 +1,20 @@
#/bin/bash
sysupgradeUrl="http://downloads.openwrt.org/releases/19.07.7/targets/ramips/mt7620"
sysupgradeFile="openwrt-19.07.7-ramips-mt7620-ArcherMR200-squashfs-sysupgrade.bin"
bootloaderFile="ArcherMR200_bootloader.bin"
recoveryFile="ArcherC2V1_tp_recovery.bin"
dd bs=512 obs=512 skip=1 count=256 if=Archer\ MR200v1_0.9.1_1.2_up_boot_v004a.0\ Build\ 180502\ Rel.53881n.bin of="$bootloaderFile"
cat "$bootloaderFile" "$sysupgradeFile" > "$recoveryFile"
atftpDir="/srv/atftp"
sudo pacman -S atftp
sudo mkdir -p "$atftpDir"
sudo cp "$recoveryFile" "$atftpDir"
sudo chown -R atftp:atftp "$atftpDir"
sudo ifconfig enp0s31f6 192.168.0.66/23
sudo systemctl start atftpd.service
echo "Now connect the MR200 router via LAN1 and restart it while holding WPS button."
Loading…
Cancel
Save