Skip to content

Commit 77cc454

Browse files
feat: add Xiaomi AX6000 support
1 parent 9018a66 commit 77cc454

9 files changed

Lines changed: 398 additions & 377 deletions

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ jobs:
2020
- name: pip install
2121
run: pip install python-lzo ubi_reader
2222
- name: make
23-
run: make
23+
run: make all
2424

2525
- uses: actions/upload-artifact@v3
2626
with:
27-
name: miwifi_r3600_all_6510e_3.0.22_INT_SSH.bin
28-
path: miwifi_r3600_all_6510e_3.0.22_INT_SSH.bin
27+
name: miwifi_r3600_all_6510e_3.0.22_INT_AX3600_SSH.bin
28+
path: miwifi_r3600_all_6510e_3.0.22_INT_AX3600_SSH.bin
29+
30+
- uses: actions/upload-artifact@v3
31+
with:
32+
name: miwifi_ra72_firmware_129d1_1.0.103_AX6000_SSH.bin
33+
path: miwifi_ra72_firmware_129d1_1.0.103_AX6000_SSH.bin

Makefile

100644100755
Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1-
FIRMWARES:=$(shell cd orig-firmwares; ls *.bin | sed 's/\.bin$$//')
2-
3-
TARGETS_SSH:=$(patsubst %,%_SSH.bin,$(FIRMWARES))
4-
TARGETS:=$(shell echo $(TARGETS_SSH) | sed 's/ /\n/g' | sort)
5-
6-
all: $(TARGETS)
7-
8-
%_SSH.bin: orig-firmwares/%.bin repack-squashfs.sh
9-
rm -f $@
10-
-rm -rf ubifs-root/$*.bin
11-
ubireader_extract_images -w orig-firmwares/$*.bin
12-
fakeroot -- ./repack-squashfs.sh ubifs-root/$*.bin/img-*_vol-ubi_rootfs.ubifs cuong.ga 1234567890
13-
./ubinize.sh ubifs-root/$*.bin/img-*_vol-kernel.ubifs ubifs-root/$*.bin/img-*_vol-ubi_rootfs.ubifs.new
14-
mv r3600-raw-img.bin $@
1+
TARGETS_AX3600_SSH:=$(shell cd orig-firmwares/AX3600; ls *.bin | sed 's/\.bin$$/_AX3600_SSH.bin/')
2+
TARGETS_AX6000_SSH:=$(shell cd orig-firmwares/AX6000; ls *.bin | sed 's/\.bin$$/_AX6000_SSH.bin/')
3+
TARGETS_AX3600:=$(shell echo $(TARGETS_AX3600_SSH) | sed 's/ /\n/g' | sort)
4+
TARGETS_AX6000:=$(shell echo $(TARGETS_AX6000_SSH) | sed 's/ /\n/g' | sort)
5+
6+
AX3600: $(TARGETS_AX3600)
7+
AX6000: $(TARGETS_AX6000)
8+
all: $(TARGETS_AX3600) $(TARGETS_AX6000)
9+
10+
clean:
11+
rm *.bin
12+
13+
%_AX3600_SSH.bin: orig-firmwares/AX3600/%.bin repack-squashfs.sh
14+
rm -f $@
15+
-rm -rf ubifs-root/$*.bin
16+
ubireader_extract_images -w orig-firmwares/AX3600/$*.bin
17+
fakeroot -- ./repack-squashfs.sh ubifs-root/$*.bin/img-*_vol-ubi_rootfs.ubifs AX3600
18+
./ubinize.sh ubifs-root/$*.bin/img-*_vol-kernel.ubifs ubifs-root/$*.bin/img-*_vol-ubi_rootfs.ubifs.new
19+
mv r3600-raw-img.bin $@
20+
21+
%_AX6000_SSH.bin: orig-firmwares/AX6000/%.bin repack-squashfs.sh
22+
rm -f $@
23+
-rm -rf ubifs-root/$*.bin
24+
ubireader_extract_images -w orig-firmwares/AX6000/$*.bin
25+
fakeroot -- ./repack-squashfs.sh ubifs-root/$*.bin/img-*_vol-ubi_rootfs.ubifs AX6000
26+
./ubinize.sh ubifs-root/$*.bin/img-*_vol-kernel.ubifs ubifs-root/$*.bin/img-*_vol-ubi_rootfs.ubifs.new
27+
mv r3600-raw-img.bin $@

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
xqrepack
22
=========
33

4-
These scripts allow you to modify the *Xiaomi R3600* firmware image to make sure SSH and UART access is always enabled.
4+
These scripts allow you to modify the *Xiaomi AX3600 and Xiaomi AX6000* firmware image to make sure SSH and UART access is always enabled.
55

66
The default root password is `password`. Please remember to login to the router and change that after the upgrade. Your router settings like IP address and SSIDs are stored in the nvram and should stay the same.
77

@@ -17,7 +17,7 @@ Requirements
1717
You will need to install the following tools:
1818

1919
- [ubi_reader](https://github.com/jrspruitt/ubi_reader)
20-
- ubinize
20+
- ubinize (mtd-utils)
2121
- unsquashfs / mksquashfs
2222
- fakeroot
2323

@@ -26,19 +26,21 @@ Usage
2626

2727
1. Download the firmware(s) from miwifi.com.
2828
It should be something like `miwifi_r3600_firmware_xxx_yyy.bin`.
29-
Put it/them to `orig-firmwares` directory.
29+
Put it/them to `orig-firmwares` in the specific router model directory.
30+
E.g. for an AX3600 router copy the firmware to `orig-firmwares/AX3600`
3031

3132
2. Run `make` to build archives of patched firmwares.
3233
This will build patched images with following naming convention:
33-
- `<firmware_image_name>_SSH.zip`: patched with original `repack-squashfs.sh` script, which enables SSH and does its best to disable Xiaomi functions/bloatware
34+
- `<firmware_image_name>_<ROUTER_MODEL>_SSH.bin`: patched with original `repack-squashfs.sh` script, which enables SSH and does its best to disable Xiaomi functions/bloatware
3435

35-
3. After extracting a generated archive of your liking, you will get `r3600-raw-img.bin` file.
36-
Flash this file directly into the router using SSH.
36+
3. Flash this file directly into the router using SSH.
3737
You cannot use the web UI because this is a raw image, and more importantly has no signature.
3838

3939
If you are using a recently xqrepack'ed firmware, you can use the `xqflash` utility on the router to flash an update image:
4040

41-
xqflash /tmp/r3600-raw-img.bin
41+
xqflash /tmp/r<firmware_image_name>_<ROUTER_MODEL>_SSH.bin
42+
43+
If you are using a original image, just copy xqrepack via scp to the router to prevent manual flashing.
4244

4345
After it completes successfully, you should be able to `reboot`.
4446

@@ -50,7 +52,7 @@ Manual Flashing
5052

5153
The R3600 firmware uses an A/B partition system, called `rootfs` and `rootfs_1`. This corresponds to `mtd12` and `mtd13`. Find the partition that is not the one in use and use `ubiformat` to write the raw image onto the partition:
5254

53-
ubiformat /dev/mtd12 -f /tmp/r3600-raw-img.bin -s 2048 -O 2048
55+
ubiformat /dev/mtd12 -f /tmp/<firmware_image_name>_<ROUTER_MODEL>_SSH.bin -s 2048 -O 2048
5456

5557
Set the nvram variable to re-initialize `/etc` (and I think to switch partitions also):
5658

orig-firmwares/miwifi_r3600_all_6510e_3.0.22_INT.bin renamed to orig-firmwares/AX3600/miwifi_r3600_all_6510e_3.0.22_INT.bin

File renamed without changes.
26.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)