Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
projects:hh40v [2023/04/08 12:44] – created Andreas Böhler | projects:hh40v [2023/04/27 21:20] (current) – [Installing OpenWrt] Andreas Böhler | ||
---|---|---|---|
Line 23: | Line 23: | ||
Long story short, with the information in this '' | Long story short, with the information in this '' | ||
- | This is the script, run it as '' | + | This is the script |
<code python [enable_line_numbers=" | <code python [enable_line_numbers=" | ||
Line 164: | Line 164: | ||
</ | </ | ||
- | Once you have SSH access, you can proceed with installin | + | Once you have SSH access, you can proceed with installing |
+ | |||
+ | ==== Backup file format ==== | ||
+ | |||
+ | Very brief overview of the file format after decryption. | ||
+ | |||
+ | < | ||
+ | String: ALCATEL BACKUP FILE HEAD | ||
+ | 0x00 | ||
+ | 0x00 | ||
+ | 0x00 | ||
+ | 0xzz length of filename (without 0 terminator - maybe it's a ushort with the previous 0x00) | ||
+ | String: filename | ||
+ | 0x00 | ||
+ | 0x00 | ||
+ | 0xzz file | ||
+ | 0xzz length (ushort) | ||
+ | TAR GZ ARCHIVE | ||
+ | 0x00 | ||
+ | 0x00 | ||
+ | 0x00 | ||
+ | 0xzz length of filename (without 0 terminator - maybe it's a ushort with the previous 0x00) | ||
+ | Binary: file content | ||
+ | String: filename | ||
+ | 0x00 | ||
+ | 0x00 | ||
+ | 0xzz number of bytes remaining in file (ushort) | ||
+ | 0xzz | ||
+ | String: ALCATEL BACKUKP FILE HEAD | ||
+ | 0xf7 Lenght of file, different endian (originates from modem) | ||
+ | 0x3b | ||
+ | 0x00 | ||
+ | 0x00 | ||
+ | Binary: file content | ||
+ | Binary: Some sort of trailer, didn't attempt to decode | ||
+ | </ | ||
+ | |||
+ | ===== Installing OpenWrt ===== | ||
+ | |||
+ | OpenWrt support to snapshot was added on 2023/04/23 with commit https:// | ||
+ | |||
+ | Running OpenWrt on this device requires a slightly different partition layout, because the kernel partition is fixed with 1.5MB and thus too small to run a recent kernel. However, there is enough space and initial installation requires a small modification of one U-Boot variable. As long as the system boots normally, there are no problems with this approach. Installing via TFTP (recovery) restores the variable back to default, forcing the installation of a stock firmware. | ||
+ | |||
+ | NB: Although the systems is running a variation of OpenWrt, the sysupgrade process is heavily modified and cannot be used as-is to install OpenWrt. | ||
+ | |||
+ | - Boot the stock firmware | ||
+ | - Take a configuration backup | ||
+ | - Modify the backup to enable SSH access | ||
+ | - Restore the configuration using the modified backup | ||
+ | - Reboot and log in via SSH - User " | ||
+ | - Transfer the OpenWrt -factory.bin image to the router: '' | ||
+ | - Transfer the following script named " | ||
+ | - On the router, make the file executable: '' | ||
+ | - Run the script with the new firmware to install as parameter: '' | ||
+ | - Wait for the router to upgrade and to boot into OpenWrt | ||
+ | |||
+ | Contents of / | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | |||
+ | IMAGE_NAME=" | ||
+ | |||
+ | if [ ! -e ${IMAGE_NAME} ]; then | ||
+ | echo "Image file not found: ${IMAGE_NAME}" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | . / | ||
+ | |||
+ | fw_setenv bootcmd "bootm 0x9f150000" | ||
+ | |||
+ | kill_remaining TERM | ||
+ | sleep 3 | ||
+ | kill_remaining KILL | ||
+ | |||
+ | run_ramfs mtd write ${IMAGE_NAME} firmware | ||
+ | sleep 2 | ||
+ | reboot -f | ||
+ | </ | ||
+ | |||
+ | ===== Configuring the LTE modem ===== | ||
+ | |||
+ | The LTE modem is an RNDIS device and works out-of-the-box if it was properly set up for the stock firmware. Limited configuration can be achieved using AT commands over USB (/ | ||
+ | |||
+ | ===== Restoring Stock ===== | ||
+ | |||
+ | To restore stock, you need a system image. Unfortunately, | ||
+ | |||
+ | - Power off the device | ||
+ | - Put firwmare-system.bin to your TFTP server | ||
+ | - Configure a static IP of 192.168.1.112 | ||
+ | - Hold the buttons " | ||
+ | - Keep holding for about 10 seconds, until U-Boot has booted | ||
+ | - Once transfer is completed, the system starts flashing, this takes some time | ||
+ | - Ultimately, you are back to stock |