#!/usr/bin/python3 # Copyright (C) 2021 SUSE LLC # program to show gpt partition attributes or set attributes of # partition 1 # only works with 512 sectors and standard GPT header layout (128 # partition entires with 128 bytes each, secondary header at end of # device) from struct import unpack_from, pack_into from zipfile import crc32 import array import sys class Gpt: # Calculate and insert the CRCs of the partition entires and the # header. def calc_crcs(self, header, entries): # compute crc of partition entries crc2 = crc32(entries) & 0xFFFFFFFF pack_into('