j0ju / x6100-fw-mangler

A toolchain to mangle, examine and mod firmware images for the Xiegu X6100
GNU General Public License v2.0
4 stars 1 forks source link

X6100 image mangler

It takes X6100 flashable firmware images and creates a modified image or MMC bootable images via Docker. It uses qemu-user-static if needed to run code for foreign architectures.

Motivation

Features

Don'ts

No warranty, I will not be responsible for what ever you do with these generated images. They might break your device,it might eletrocute you, be warned. Act safe and sane. Only transmit in frequency ranges you are allowed to transmit, check for a clean HF of your device. I advise not distributing images generated this way, they contain copyrighted material.

Quickstart

Requirements

OSX

Rancher Desktop or Docker Desktop fulfill this requirements. Homebrew might be handy. With Rancher Desktop you might need to execute the script bin/binfmt-helper before it works.

Ubuntu/Debian

Usage

Docker

General usage

Images

tl:dr Workflow

Patches

The modded Xiegu image includes this patches:

./config and ./config.example

./config is a preseed for different settings:

Under the hood

The make file creates at first a docker image x6100:img-mangler with needed tools. Afterwards the sources from the .url files are downloaded and extracted. The resulting update images from Xiegu or R1BCU are then copied into the contents of /target of a docker image for later modifications. The modified contents then could be used to generate update images or images to be run from sdcard. With binfmt under Linux with docker you can even enter the Image as it would run on the x6100, of course without a GUI.

Debugging

make V=1

Tools

A short description about the tools in ./bin

If you have a running envrc setup, you can use the .envrc to have ./bin included in your PATH.

You have a fresh unknown image and wants to inspect its contents?

General X6100 help

WiFi

How to connect to a WiFi via the serial console:

nmcli device wifi con WLANNAME password XXXXXXXXX

The X6100 is found to have issues with WPA3 personal (SAE) in some environments. This can be disabled to fallback to WPA2 only:

nmcli conn down WLANNAME
nmcli conn edit WLANNAME << EOF
  set wifi-sec.key-mgmt wpa-psk
EOF
nmcli conn up WLANNAME

Overall boot process

Frequency extension / MARS mod

Xiegu's official firmware can be configured to enable TX on all frequencies and bands, also those not be in the HAM bands. It is unknown if the filter circuits in the device itself are taking harm, so this is a modification on your own risk.

The file /etc/xgradio/xgradio.conf needs to be edited. In case of the version 1.1.7 firmware it looks like this:

[mods]
fullband-tx=disable

If you edit this with you favorite editor, you can chose for the fullband-tx setting

Restart the TRX (or just the radio app) afterwards.

Boot counter since official Xiegu 1.1.7

Since 1.1.7 the radio app of Xiegu stores the number of starts in /etc/xgradio/man.conf The exec-counter is incremented on every start of the radio app.

[root@x6100:~]# cat /etc/xgradio/man.conf
[manufacture]
exec-counter=23

Ideas & Plans