Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| toh:etisalat:s3 [2023/02/25 19:09] – [sercomm-recovery utility] csharper2005 | toh:etisalat:s3 [2023/10/16 20:12] – [Installation] csharper2005 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| /* USE https:// | /* USE https:// | ||
| - | {{page> | ||
| OEM: Sercomm S3 | OEM: Sercomm S3 | ||
| Line 40: | Line 39: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| /* stable release */ | /* stable release */ | ||
| - | /* uncomment once stable release is available | + | |
| ---- datatable ---- | ---- datatable ---- | ||
| cols : Model, Versions, Supported Current Rel, Firmware OpenWrt Install URL_url, Firmware OpenWrt Upgrade URL_url, Firmware OEM Stock URL_url | cols : Model, Versions, Supported Current Rel, Firmware OpenWrt Install URL_url, Firmware OpenWrt Upgrade URL_url, Firmware OEM Stock URL_url | ||
| headers : Model, Version, Current Release, Firmware OpenWrt Install, Firmware OpenWrt Upgrade, Firmware OEM Stock | headers : Model, Version, Current Release, Firmware OpenWrt Install, Firmware OpenWrt Upgrade, Firmware OEM Stock | ||
| - | align : c,c,c | ||
| - | filter | ||
| - | filter | ||
| - | ---- | ||
| - | */ | ||
| - | |||
| - | |||
| - | /* snapshot */ | ||
| - | /* delete once stable release is available */ | ||
| - | ---- datatable ---- | ||
| - | cols : Model, Versions, Supported Current Rel, Firmware OpenWrt snapshot Install URL_url, Firmware OpenWrt snapshot Upgrade URL_url, Firmware OEM Stock URL_url | ||
| - | headers : Model, Version, Current Release, Firmware OpenWrt snapshot Install, Firmware OpenWrt snapshot Upgrade, Firmware OEM Stock | ||
| align : c,c,c | align : c,c,c | ||
| filter | filter | ||
| Line 71: | Line 58: | ||
| cfgtool.py -u configurationBackup.cfg | cfgtool.py -u configurationBackup.cfg | ||
| </ | </ | ||
| + | |||
| + | <hidden cfgtool.py> | ||
| + | <code bash> | ||
| + | """ | ||
| + | Copyright (c) 2022 r3d5ky | ||
| + | |||
| + | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| + | of this software and associated documentation files (the " | ||
| + | in the Software without restriction, | ||
| + | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| + | copies of the Software, and to permit persons to whom the Software is | ||
| + | furnished to do so, subject to the following conditions: | ||
| + | |||
| + | The above copyright notice and this permission notice shall be included in all | ||
| + | copies or substantial portions of the Software. | ||
| + | |||
| + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| + | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| + | MERCHANTABILITY, | ||
| + | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
| + | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
| + | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE | ||
| + | OR OTHER DEALINGS IN THE SOFTWARE. | ||
| + | """ | ||
| + | |||
| + | import zlib | ||
| + | import sys | ||
| + | import argparse | ||
| + | |||
| + | def unpack(cfg_file, | ||
| + | with open(cfg_file, | ||
| + | infile = f.read() | ||
| + | |||
| + | unpacked = zlib.decompress(infile[4: | ||
| + | config = unpacked[unpacked.find(b' | ||
| + | userdata = unpacked[: | ||
| + | | ||
| + | if raw: | ||
| + | with open(cfg_file[: | ||
| + | f.write(unpacked) | ||
| + | |||
| + | with open(cfg_file[: | ||
| + | f.write(config) | ||
| + | with open(cfg_file[: | ||
| + | f.write(userdata) | ||
| + | |||
| + | |||
| + | def pack(xml_file, | ||
| + | with open(xml_file, | ||
| + | rawconfig = f.read() + b' | ||
| + | with open(xml_file[: | ||
| + | userdata = f.read() | ||
| + | endian = " | ||
| + | if endianness: | ||
| + | endian = " | ||
| + | crc = zlib.crc32(rawconfig).to_bytes(4, | ||
| + | config = userdata + rawconfig + crc | ||
| + | | ||
| + | with open(sys.argv[2][: | ||
| + | f.write(len(config).to_bytes(4, | ||
| + | |||
| + | |||
| + | def main(): | ||
| + | parser = argparse.ArgumentParser(description=" | ||
| + | group = parser.add_mutually_exclusive_group(required=True) | ||
| + | group.add_argument(" | ||
| + | group.add_argument(" | ||
| + | parser.add_argument(" | ||
| + | parser.add_argument(" | ||
| + | parser.add_argument(' | ||
| + | args = parser.parse_args() | ||
| + | | ||
| + | if args.unpack: | ||
| + | unpack(args.file, | ||
| + | elif args.pack: | ||
| + | pack(args.file, | ||
| + | |||
| + | print(" | ||
| + | |||
| + | |||
| + | if __name__ == ' | ||
| + | main() | ||
| + | </ | ||
| + | </ | ||
| + | |||
| 4. Open configurationBackup.xml and find the following line: | 4. Open configurationBackup.xml and find the following line: | ||
| Line 194: | Line 266: | ||
| </ | </ | ||
| where //enp0s3// - network interface connected the router, // | where //enp0s3// - network interface connected the router, // | ||
| + | |||
| + | 3. Wait until the router is flashed and rebooted. | ||
| [[https:// | [[https:// | ||