Documentation ¶
Index ¶
- func DisableSystemdService(service string) error
- func ExtendOEMPartition(disk string, statePartNum, oemPartNum int, oemSize string) error
- func HandleDiskLayout(disk string, statePartNum, oemPartNum int, oemSize string, reclaimSDA3 bool) error
- func SealOEMPartition(veritysetupImgPath string, oemFSSize4K uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableSystemdService ¶
DisableSystemdService disables the auto-update service.
func ExtendOEMPartition ¶
ExtendOEMPartition moves stateful partition towards the end of the disk Then move OEM partition to the original place of the stateful partition Finally resize the OEM partition to 1 sector before the new stateful partition OEMSize can be the number of sectors (without unit) or size like "3G", "100M", "10000K" or "99999B"
func HandleDiskLayout ¶
func HandleDiskLayout(disk string, statePartNum, oemPartNum int, oemSize string, reclaimSDA3 bool) error
HandleDiskLayout changes the partitions on a COS disk. If the auto-update is disabled, it will shrink sda3 to reclaim the space. It also moves stateful partition and the OEM partition (if extended) by a distance relative to a start point.
If sda3 is shrinked, the start point will be the start of sda3 + sda3Margin (2MB). Otherwise, start point will be the original start of the stateful partition.
The stateful partition will be moved to leave enough space for the OEM partition, and the OEM partition will be moved to the start point. Finally OEM partition will be resized to 1 sector before the new stateful partition.
OEMSize can be the number of sectors (without unit) or size like "3G", "100M", "10000K" or "99999B". If there's no need to extend the OEM partition, `oemSize` in the input will be "", a valid input.
func SealOEMPartition ¶
SealOEMPartition sets the hashtree of the OEM partition with "veritysetup" and modifies the kernel command line to verify the OEM partition at boot time.
Types ¶
This section is empty.