|
59 | 59 | ROOTFS_SECTIONS = ("fs", "rootfs") |
60 | 60 | FS_SECTIONS = ROOTFS_SECTIONS + ("app",) |
61 | 61 |
|
62 | | -RE_BANNER = re.compile(b"\x00(Linux version .+? \(.+?@.+?\) \(.+?\) .+?)\n\x00") |
63 | | -RE_COMPLINK = re.compile(b"\x00([^\x00]+?-linux-.+? \(.+?\) [0-9].+?)\n\x00+(.+?)\n\x00") |
| 62 | +RE_BANNER = re.compile(rb"\x00(Linux version .+? \(.+?@.+?\) \(.+?\) .+?)\n\x00") |
| 63 | +RE_COMPLINK = re.compile(rb"\x00([^\x00]+?-linux-.+? \(.+?\) [0-9].+?)\n\x00+(.+?)\n\x00") |
64 | 64 | RE_IKCFG = re.compile(b"IKCFG_ST(.+?)IKCFG_ED", re.DOTALL) |
65 | 65 | RE_KERNEL_COMP = re.compile( |
66 | 66 | b"(?P<lz4>" + FileType.LZ4_LEGACY_FRAME.value + b')' |
|
74 | 74 | # Type: kernel (0x02) |
75 | 75 | # Only used for MStar/SigmaStar cameras (Lumus and RLC-410W IPC_30K128M4MP) |
76 | 76 | RE_MSTAR = re.compile(FileType.UIMAGE.value + b".{24}\x11.\x02.{33}", re.DOTALL) |
77 | | -RE_UBOOT = re.compile(b"U-Boot [0-9]{4}\.[0-9]{2}.*? \(.+?\)") |
| 77 | +RE_UBOOT = re.compile(rb"U-Boot [0-9]{4}\.[0-9]{2}.*? \(.+?\)") |
78 | 78 |
|
79 | 79 | DUMMY = object() |
80 | 80 |
|
@@ -446,7 +446,7 @@ def get_info_from_files(files: InfoFiles) -> DVRInfo: |
446 | 446 | info["version_file"] = files["version_file"].decode().strip() |
447 | 447 | if not info.get("firmware_version_prefix"): |
448 | 448 | thefile = files["dvr"] if files["dvr"] is not None else files["router"] |
449 | | - match = re.search(b"echo (v[23]\.0\.0)", thefile) if thefile is not None else None |
| 449 | + match = re.search(rb"echo (v[23]\.0\.0)", thefile) if thefile is not None else None |
450 | 450 | info["firmware_version_prefix"] = match.group(1).decode() if match else None |
451 | 451 | return info # type: ignore |
452 | 452 |
|
|
0 commit comments