tools

package
v0.0.0-...-4aaa17f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableSystemdService

func DisableSystemdService(service string) error

DisableSystemdService disables the auto-update service.

func ExtendOEMPartition

func ExtendOEMPartition(disk string, statePartNum, oemPartNum int, oemSize string) error

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

func SealOEMPartition(veritysetupImgPath string, oemFSSize4K uint64) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL