"""Validate the music allocation before a music-only update.""" import struct MUSIC_OFFSET = 0x410000 MUSIC_BYTES = 16 * 1024 * 1024 def require_music_partition(table): found = [] for offset in range(0, min(len(table), 0xC00), 32): entry = table[offset:offset + 32] if len(entry) != 32 or entry[:2] != b"\xaa\x50": break magic, kind, subtype, address, size, label, flags = struct.unpack('