Documentation
¶
Index ¶
- Constants
- Variables
- func AddKernelCommandLine(ctx context.Context, extraCommandLine []string, ...) error
- func AddOrUpdateGroups(ctx context.Context, groups []imagecustomizerapi.Group, ...) error
- func AddOrUpdateUsers(ctx context.Context, users []imagecustomizerapi.User, baseConfigPath string, ...) error
- func CheckEnvironmentVars() error
- func ConvertImageFile(inputPath string, outputPath string, format imagecustomizerapi.ImageFormatType) error
- func CreateNewImage(targetOs targetos.TargetOs, filename string, ...) (map[string]string, error)
- func CustomizeImage(ctx context.Context, buildDir string, baseConfigPath string, ...) (err error)
- func CustomizeImageHelperImageCreator(ctx context.Context, buildDir string, baseConfigPath string, ...) (map[string]diskutils.FstabEntry, string, error)
- func CustomizeImageWithConfigFile(ctx context.Context, buildDir string, configFile string, inputImageFile string, ...) error
- func EnableOrDisableServices(ctx context.Context, services imagecustomizerapi.Services, ...) error
- func FindLinuxLine(inputGrubCfgContent string) (grub.Line, error)
- func FindNonRecoveryLinuxLine(inputGrubCfgContent string) ([]grub.Line, error)
- func GetDefaultGrubFileLinuxArgs(defaultGrubFileContent string, varName defaultGrubFileVarName) (defaultGrubFileVarAssign, []grubConfigLinuxArg, int, error)
- func GrubArgsToString(args []string) string
- func InjectFiles(ctx context.Context, buildDir string, baseConfigPath string, ...) error
- func InjectFilesWithConfigFile(ctx context.Context, buildDir string, configFile string, inputImageFile string, ...) error
- func LoadOrDisableModules(ctx context.Context, modules imagecustomizerapi.ModuleList, rootDir string) error
- func LogVersionsOfToolDeps()
- func NewDistroHandler(distroName string, version string) distroHandler
- func NewDistroHandlerFromImageConnection(imageConnection *imageconnection.ImageConnection) (distroHandler, error)
- func NewDistroHandlerFromTargetOs(targetOs targetos.TargetOs) distroHandler
- func ParseCommandLineArgs(argTokens []grub.Token) ([]grubConfigLinuxArg, error)
- func ReadGrub2ConfigFile(imageChroot safechroot.ChrootInterface) (string, error)
- func SystemdFormatCorruptionOption(corruptionOption imagecustomizerapi.CorruptionOption) (string, error)
- func UpdateDefaultGrubFileVariable(defaultGrubFileContent string, varName string, newValue string) (string, error)
- func UpdateHostname(ctx context.Context, hostname string, imageChroot safechroot.ChrootInterface) error
- func UpdateSELinuxModeInConfigFile(selinuxMode imagecustomizerapi.SELinuxMode, ...) error
- func ValidateConfig(ctx context.Context, baseConfigPath string, config *imagecustomizerapi.Config, ...) error
- func ValidateRpmSources(rpmsSources []string) error
- func WriteDefaultGrubFile(grub2Config string, imageChroot safechroot.ChrootInterface) error
- type BootCustomizer
- func (b *BootCustomizer) AddKernelCommandLine(extraCommandLine []string) error
- func (b *BootCustomizer) GetSELinuxMode(imageChroot safechroot.ChrootInterface) (imagecustomizerapi.SELinuxMode, error)
- func (b *BootCustomizer) IsGrubMkconfigImage() bool
- func (b *BootCustomizer) PrepareForVerity() error
- func (b *BootCustomizer) SetRootDevice(rootDevice string) error
- func (b *BootCustomizer) UpdateKernelCommandLineArgs(defaultGrubFileVarName defaultGrubFileVarName, argsToRemove []string, ...) error
- func (b *BootCustomizer) UpdateSELinuxCommandLine(selinuxMode imagecustomizerapi.SELinuxMode) error
- func (b *BootCustomizer) UpdateSELinuxCommandLineForEMU(selinuxMode imagecustomizerapi.SELinuxMode) error
- func (b *BootCustomizer) WriteToFile(imageChroot safechroot.ChrootInterface) error
- type BootFilesArchConfig
- type BootloaderType
- type CosiBootloader
- type DistroName
- type ExtendedMountIdentifierType
- type FileSystem
- type ImageBuildData
- type ImageCustomizerError
- type ImageCustomizerParameters
- type ImageFile
- type ImageFileInfo
- type ImageHistory
- type IsoArtifactsStore
- type IsoFilesStore
- type IsoInfoStore
- type KdumpBootFiles
- type KernelBootFiles
- type LiveOSConfig
- type LiveOSSavedConfigs
- type MetadataJson
- type OSSavedConfigs
- type OsPackage
- type PackageManagerType
- type PackageType
- type PackageVersionInformation
- type PxeSavedConfigs
- type SavedConfigs
- type StageFile
- type SystemDBoot
- type SystemDBootEntry
- type SystemDBootEntryType
- type UkiKernelInfo
- type VerityConfig
Constants ¶
const ( ShimDir = "EFI/BOOT" SystemdBootDir = "EFI/systemd" )
const ( BootDir = "boot" EspDir = "boot/efi" DefaultGrubCfgPath = "grub2/grub.cfg" UkiKernelInfoJson = "uki-kernel-info.json" KernelPrefix = "vmlinuz-" UkiBuildDir = "UkiBuildDir" UkiOutputDir = "EFI/Linux" )
const ( // Dracut module directory path for verity boot partition support. VerityMountBootPartitionModuleDir = "/usr/lib/dracut/modules.d/90mountbootpartition" // Standard permission mode for dracut module directories. DracutModuleDirMode = 0o755 // Standard permission mode for executable scripts in dracut modules. DracutModuleScriptFileMode = 0o755 )
const ( SkippableFrameMagicNumber uint32 = 0x184D2A50 SkippableFramePayloadSize uint32 = randomization.UuidSize SkippableFrameHeaderSize int = 8 )
const ( // qemu-specific formats QemuFormatVpc = "vpc" BaseImageName = "image.raw" PartitionCustomizedImageName = "image2.raw" OtelTracerName = "imagecustomizerlib" )
const ( // Minimum dracut version required to enable PXE booting. LiveOsPxeDracutMinVersion = 102 LiveOsPxeDracutMinPackageRelease = 7 LiveOsPxeDracutDistroName = "azl" LiveOsPxeDracutMinDistroVersion = 3 // Minumum dracut version required to enable SELinux. LiveOsSelinuxDracutMinVersion = 102 LiveOsSelinuxDracutMinPackageRelease = 11 LiveOsSelinuxDracutDistroName = "azl" LiveOsSelinuxDracutMinDistroVersion = 3 // Minimum selinux-poicy version required to enable SELinux. LiveOsSelinuxPolicyMinVersion0 = 2 LiveOsSelinuxPolicyMinVersion1 = 20240226 LiveOsSelinuxPolicyMinPackageRelease = 9 LiveOsSelinuxPolicyDistroName = "azl" LiveOsSelinuxPolicyMinDistroVersion = 3 )
const (
ImageCustomizerReleasePath = "etc/image-customizer-release"
)
Variables ¶
var ( // Artifact handling errors ErrArtifactImageConnection = NewImageCustomizerError("Artifacts:ImageConnection", "failed to connect to image file to output artifacts") ErrArtifactESPPartitionMount = NewImageCustomizerError("Artifacts:ESPPartitionMount", "failed to mount ESP partition") ErrArtifactUKIDirectoryRead = NewImageCustomizerError("Artifacts:UKIDirectoryRead", "failed to read UKI directory") ErrArtifactBinaryCopy = NewImageCustomizerError("Artifacts:BinaryCopy", "failed to copy binary") ErrArtifactRootHashDump = NewImageCustomizerError("Artifacts:RootHashDump", "failed to dump root hash") ErrArtifactInjectFilesYamlWrite = NewImageCustomizerError("Artifacts:InjectFilesYamlWrite", "failed to write inject-files.yaml") ErrArtifactInjectFilesYamlMarshal = NewImageCustomizerError("Artifacts:InjectFilesYamlMarshal", "failed to marshal inject files metadata") ErrArtifactInvalidInjectFilesConfig = NewImageCustomizerError("Artifacts:InvalidInjectFilesConfig", "invalid inject files config") ErrArtifactInjectFilesPathResolution = NewImageCustomizerError("Artifacts:InjectFilesPathResolution", "failed to get absolute path of inject-files.yaml") ErrArtifactInjectFilesImageConnection = NewImageCustomizerError("Artifacts:InjectFilesImageConnection", "failed to connect to image file to inject files") ErrArtifactInjectFilesPartitionMount = NewImageCustomizerError("Artifacts:InjectFilesPartitionMount", "failed to mount partition for file injection") ErrArtifactPartitionUnmount = NewImageCustomizerError("Artifacts:PartitionUnmount", "failed to cleanly unmount partition") ErrArtifactCosiImageConversion = NewImageCustomizerError("Artifacts:CosiImageConversion", "failed to convert customized raw image to cosi output format") ErrArtifactOutputImageConversion = NewImageCustomizerError("Artifacts:OutputImageConversion", "failed to convert customized raw image to output format") ErrArtifactImageConnectionForExtraction = NewImageCustomizerError("Artifacts:ImageConnectionForExtraction", "failed to connect to image") ErrArtifactImageConnectionClose = NewImageCustomizerError("Artifacts:ImageConnectionClose", "failed to cleanly close image connection") ErrArtifactReleaseFileRead = NewImageCustomizerError("Artifacts:ReleaseFileRead", "failed to read release file") ErrArtifactImageUuidNotFound = NewImageCustomizerError("Artifacts:ImageUuidNotFound", "IMAGE_UUID not found in release file") ErrArtifactImageUuidParse = NewImageCustomizerError("Artifacts:ImageUuidParse", "failed to parse IMAGE_UUID") )
var ( // Filesystem check errors ErrFilesystemE2fsckCheck = NewImageCustomizerError("FilesystemCheck:E2fsck", "failed to check filesystem with e2fsck") ErrFilesystemXfsRepairCheck = NewImageCustomizerError("FilesystemCheck:XfsRepair", "failed to check filesystem with xfs_repair") ErrFilesystemFsckCheck = NewImageCustomizerError("FilesystemCheck:Fsck", "failed to check filesystem with fsck") )
var ( // COSI-related errors ErrCosiDirectoryCreate = NewImageCustomizerError("COSI:DirectoryCreate", "failed to create COSI directory") ErrCosiBuildFile = NewImageCustomizerError("COSI:BuildFile", "failed to build COSI file") ErrCosiMetadataPopulate = NewImageCustomizerError("COSI:MetadataPopulate", "failed to populate COSI metadata") ErrCosiMetadataMarshal = NewImageCustomizerError("COSI:MetadataMarshal", "failed to marshal COSI metadata") ErrCosiFileCreate = NewImageCustomizerError("COSI:FileCreate", "failed to create COSI file") )
var ( // Bootloader-related errors ErrBootloaderHardReset = NewImageCustomizerError("Bootloader:HardReset", "failed to hard reset bootloader") ErrBootloaderKernelCommandLineAdd = NewImageCustomizerError("Bootloader:KernelCommandLineAdd", "failed to add kernel command line") ErrBootloaderSelinuxModeGet = NewImageCustomizerError("Bootloader:SelinuxModeGet", "failed to get existing SELinux mode") ErrBootloaderRootFilesystemFind = NewImageCustomizerError("Bootloader:RootFilesystemFind", "failed to find root filesystem (i.e. mount equal to '/')") ErrBootloaderRootMountIdTypeGet = NewImageCustomizerError("Bootloader:RootMountIdTypeGet", "failed to get image's root mount ID type") ErrBootloaderImageBootTypeGet = NewImageCustomizerError("Bootloader:ImageBootTypeGet", "failed to get image's boot type") ErrBootloaderDiskConfigure = NewImageCustomizerError("Bootloader:DiskConfigure", "failed to configure bootloader") ErrBootloaderRootMountFind = NewImageCustomizerError("Bootloader:RootMountFind", "failed to find root mount (/)") ErrBootloaderRootMountSourceParse = NewImageCustomizerError("Bootloader:RootMountSourceParse", "failed to parse root (/) mount source") ErrBootloaderUnsupportedRootMountId = NewImageCustomizerError("Bootloader:UnsupportedRootMountId", "unsupported root mount identifier") )
var ( // File operation errors ErrFileCopy = NewImageCustomizerError("Files:Copy", "failed to copy file") ErrDirectoryCopy = NewImageCustomizerError("Files:DirectoryCopy", "failed to copy directory") )
var ( // Group-related errors ErrGroupExistsCheck = NewImageCustomizerError("Groups:ExistsCheck", "failed to check if group exists") ErrCannotSetGidOnExistingGroup = NewImageCustomizerError("Groups:SetGidOnExistingGroup", "cannot set GID on a group that already exists") ErrGroupAdd = NewImageCustomizerError("Groups:Add", "failed to add group") )
var ( // Overlay-related errors ErrAddDracutDriver = NewImageCustomizerError("Overlays:AddDracutDriver", "failed to add dracut driver") ErrOverlayFstabUpdate = NewImageCustomizerError("Overlays:FstabUpdate", "failed to update fstab for overlay") ErrOverlayDirectoriesCreate = NewImageCustomizerError("Overlays:DirectoriesCreate", "failed to create overlay directories") )
var ( // Package-related errors ErrPackageRepoMetadataRefresh = NewImageCustomizerError("Packages:RepoMetadataRefresh", "failed to refresh tdnf repo metadata") ErrInvalidPackageListFile = NewImageCustomizerError("Packages:InvalidPackageListFile", "failed to read package list file") ErrPackageRemove = NewImageCustomizerError("Packages:Remove", "failed to remove packages") ErrPackageUpdate = NewImageCustomizerError("Packages:Update", "failed to update packages") ErrPackagesUpdateInstalled = NewImageCustomizerError("Packages:UpdateInstalled", "failed to update installed packages") ErrPackageInstall = NewImageCustomizerError("Packages:Install", "failed to install packages") ErrPackageCacheClean = NewImageCustomizerError("Packages:CacheClean", "failed to clean tdnf cache") ErrMountRpmSources = NewImageCustomizerError("Packages:MountRpmSources", "failed to mount RPM sources") ErrSnapshotTimeNotSupported = NewImageCustomizerError("Packages:SnapshotTimeNotSupported", "snapshot time is not supported") )
var ( ErrPartitionsCustomize = NewImageCustomizerError("Partitions:Customize", "failed to customize partitions") ErrPartitionsResetUuids = NewImageCustomizerError("Partitions:ResetUuids", "failed to reset partition UUIDs") )
var ( // Partition copy errors ErrPartitionCopyTargetOsDetermination = NewImageCustomizerError("PartitionCopy:TargetOsDetermination", "failed to determine target OS of base image") ErrPartitionCopyFilesToNewLayout = NewImageCustomizerError("PartitionCopy:FilesToNewLayout", "failed to copy files to new partition layout") ErrPartitionCopyFiles = NewImageCustomizerError("PartitionCopy:Files", "failed to copy partition files") )
var ( // Partition UUID errors ErrPartitionUuidResetFilesystem = NewImageCustomizerError("PartitionUUID:ResetFilesystem", "failed to reset filesystem UUID") ErrPartitionUuidUpdate = NewImageCustomizerError("PartitionUUID:Update", "failed to update partition UUID") ErrPartitionE2fsckCheck = NewImageCustomizerError("PartitionUUID:E2fsckCheck", "e2fsck check failed for partition") ErrPartitionVfatIdGenerate = NewImageCustomizerError("PartitionUUID:VfatIdGenerate", "failed to generate VFAT ID") ErrResetPartitionIdOnVerityImage = NewImageCustomizerError("PartitionUUID:ResetPartitionIdOnVerityImage", "resetting partition IDs on a verity-enabled image is not implemented") ErrPartitionUnsupportedFilesystem = NewImageCustomizerError("PartitionUUID:UnsupportedFilesystem", "unsupported filesystem for UUID reset") )
var ( // SELinux-related errors ErrSELinuxGetCurrentMode = NewImageCustomizerError("SELinux:GetCurrentMode", "failed to get current SELinux mode") ErrSELinuxConfigFileCheck = NewImageCustomizerError("SELinux:ConfigFileCheck", "failed to check if SELinux config file exists") ErrSELinuxPolicyMissing = NewImageCustomizerError("SELinux:PolicyMissing", "SELinux is enabled but policy file is missing") ErrSELinuxConfigUpdate = NewImageCustomizerError("SELinux:ConfigUpdate", "failed to set SELinux mode in config file") ErrSELinuxRelabelFiles = NewImageCustomizerError("SELinux:RelabelFiles", "failed to set SELinux file labels") )
var ( // Service-related errors ErrServiceEnable = NewImageCustomizerError("Services:Enable", "failed to enable service") ErrServiceDisable = NewImageCustomizerError("Services:Disable", "failed to disable service") )
var ( // TDNF snapshot errors ErrTdnfSnapshotTimeParse = NewImageCustomizerError("TdnfSnapshot:TimeParse", "failed to parse TDNF snapshot time") ErrTdnfConfigParse = NewImageCustomizerError("TdnfSnapshot:ConfigParse", "failed to parse TDNF config") ErrTdnfTempConfigDirectoryCreate = NewImageCustomizerError("TdnfSnapshot:TempConfigDirectoryCreate", "failed to create directory for custom tdnf.conf") ErrTdnfConfigWrite = NewImageCustomizerError("TdnfSnapshot:ConfigWrite", "failed to write TDNF config") ErrTdnfConfigCleanup = NewImageCustomizerError("TdnfSnapshot:ConfigCleanup", "failed to clean up TDNF config") )
var ( // UKI-related errors ErrUKIPackageDependencyValidation = NewImageCustomizerError("UKI:PackageDependencyValidation", "failed to validate package dependencies for uki") ErrUKIDirectoryCreate = NewImageCustomizerError("UKI:DirectoryCreate", "failed to create UKI directories") ErrUKIShimFileCopyToTemp = NewImageCustomizerError("UKI:ShimFileCopyToTemp", "failed to copy shim file to temporary location") ErrUKIShimFileCopyFromTemp = NewImageCustomizerError("UKI:ShimFileCopyFromTemp", "failed to copy shim file from temporary location") ErrUKISystemdBootInstall = NewImageCustomizerError("UKI:SystemdBootInstall", "failed to install systemd-boot") ErrUKIRandomSeedRemove = NewImageCustomizerError("UKI:RandomSeedRemove", "failed to remove random-seed file") ErrUKIKernelInitramfsMap = NewImageCustomizerError("UKI:KernelInitramfsMap", "failed to get kernel to initramfs map") ErrUKIFileCopy = NewImageCustomizerError("UKI:FileCopy", "failed to copy UKI files") ErrUKIKernelCmdlineExtract = NewImageCustomizerError("UKI:KernelCmdlineExtract", "failed to extract kernel command-line arguments") ErrUKICmdlineFileWrite = NewImageCustomizerError("UKI:CmdlineFileWrite", "failed to write kernel cmdline args JSON") )
var ( // User management errors ErrUserExistsCheck = NewImageCustomizerError("Users:ExistsCheck", "failed to check if user exists") ErrUserPasswordFileRead = NewImageCustomizerError("Users:PasswordFileRead", "failed to read password file") ErrUserPasswordHash = NewImageCustomizerError("Users:PasswordHash", "failed to hash password") ErrUserCannotSetUidOnExisting = NewImageCustomizerError("Users:CannotSetUidOnExisting", "cannot set UID on a user that already exists") ErrUserCannotSetHomeDirOnExisting = NewImageCustomizerError("Users:CannotSetHomeDirOnExisting", "cannot set home directory on a user that already exists") ErrUserUpdate = NewImageCustomizerError("Users:Update", "failed to update user") ErrUserAdd = NewImageCustomizerError("Users:Add", "failed to add user") )
var ( // Verity operation errors ErrVerityPackageDependencyValidation = NewImageCustomizerError("Verity:PackageDependencyValidation", "failed to validate verity package dependencies") ErrVerityDracutModuleAdd = NewImageCustomizerError("Verity:DracutModuleAdd", "failed to add verity dracut module") ErrVerityFstabUpdate = NewImageCustomizerError("Verity:FstabUpdate", "failed to update fstab for verity") ErrVerityGrubConfigPrepare = NewImageCustomizerError("Verity:GrubConfigPrepare", "failed to prepare grub config for verity") ErrVerityHashSignatureSupport = NewImageCustomizerError("Verity:HashSignatureSupport", "failed to add verity hash signature support") ErrVerityFstabRead = NewImageCustomizerError("Verity:FstabRead", "failed to read fstab") )
var ( // Dracut operation errors ErrDracutConfigWrite = NewImageCustomizerError("Dracut:ConfigWrite", "failed to write dracut config file") ErrDracutConfigRead = NewImageCustomizerError("Dracut:ConfigRead", "failed to read dracut config file") ErrDracutConfigAppend = NewImageCustomizerError("Dracut:ConfigAppend", "failed to append to dracut config file") )
var ( // Partition extraction errors ErrPartitionExtractAbsolutePath = NewImageCustomizerError("PartitionExtract:AbsolutePath", "failed to get absolute path") ErrPartitionExtractIntegrityCheck = NewImageCustomizerError("PartitionExtract:IntegrityCheck", "failed to check file system integrity") ErrPartitionExtractStatFile = NewImageCustomizerError("PartitionExtract:StatFile", "failed to stat file") ErrPartitionExtractUnsupportedFormat = NewImageCustomizerError("PartitionExtract:UnsupportedFormat", "unsupported partition format") ErrPartitionExtractMetadataConstruct = NewImageCustomizerError("PartitionExtract:MetadataConstruct", "failed to construct partition metadata") ErrPartitionExtractRemoveRawFile = NewImageCustomizerError("PartitionExtract:RemoveRawFile", "failed to remove raw file") ErrPartitionExtractRemoveTempFile = NewImageCustomizerError("PartitionExtract:RemoveTempFile", "failed to remove temp file") ErrPartitionExtractCopyBlockDevice = NewImageCustomizerError("PartitionExtract:CopyBlockDevice", "failed to copy block device") ErrPartitionExtractCompress = NewImageCustomizerError("PartitionExtract:Compress", "failed to compress partition") ErrPartitionExtractOpenFile = NewImageCustomizerError("PartitionExtract:OpenFile", "failed to open partition file") )
var ( // Validation errors ErrInvalidOutputFormat = NewImageCustomizerError("Validation:InvalidOutputFormat", "invalid output image format") ErrCannotGenerateOutputFormat = NewImageCustomizerError("Validation:CannotGenerateOutputFormat", "cannot generate output format from input format") ErrCannotCustomizePartitionsOnIso = NewImageCustomizerError("Validation:CannotCustomizePartitionsOnIso", "cannot customize partitions when input is ISO") ErrInvalidImageConfig = NewImageCustomizerError("Validation:InvalidImageConfig", "invalid image config") ErrInvalidParameters = NewImageCustomizerError("Validation:InvalidParameters", "invalid parameters") ErrInputImageFileRequired = NewImageCustomizerError("Validation:InputImageFileRequired", "input image file must be specified") ErrInvalidInputImageFileArg = NewImageCustomizerError("Validation:InvalidInputImageFileArg", "invalid command-line option '--image-file'") ErrInputImageFileNotFile = NewImageCustomizerError("Validation:InputImageFileNotFile", "input image file is not a file") ErrInvalidInputImageFileConfig = NewImageCustomizerError("Validation:InvalidInputImageFileConfig", "invalid config file property 'input.image.path'") ErrInvalidAdditionalFilesSource = NewImageCustomizerError("Validation:InvalidAdditionalFilesSource", "invalid additionalFiles source file") ErrAdditionalFilesSourceNotFile = NewImageCustomizerError("Validation:AdditionalFilesSourceNotFile", "additionalFiles source file is not a file") ErrInvalidPostCustomizationScript = NewImageCustomizerError("Validation:InvalidPostCustomizationScript", "invalid postCustomization script") ErrInvalidFinalizeScript = NewImageCustomizerError("Validation:InvalidFinalizeScript", "invalid finalizeCustomization script") ErrScriptNotUnderConfigDir = NewImageCustomizerError("Validation:ScriptNotUnderConfigDir", "script file is not under config directory") ErrScriptFileNotReadable = NewImageCustomizerError("Validation:ScriptFileNotReadable", "couldn't read script file") ErrNoRpmSourcesSpecified = NewImageCustomizerError("Validation:NoRpmSourcesSpecified", "have packages to install or update but no RPM sources were specified") ErrOutputImageFileRequired = NewImageCustomizerError("Validation:OutputImageFileRequired", "output image file must be specified") ErrInvalidOutputImageFileArg = NewImageCustomizerError("Validation:InvalidOutputImageFileArg", "invalid command-line option '--output-image-file'") ErrOutputImageFileIsDirectory = NewImageCustomizerError("Validation:OutputImageFileIsDirectory", "output image file is a directory") ErrInvalidOutputImageFileConfig = NewImageCustomizerError("Validation:InvalidOutputImageFileConfig", "invalid config file property 'output.image.path'") ErrOutputImageFormatRequired = NewImageCustomizerError("Validation:OutputImageFormatRequired", "output image format must be specified") ErrInvalidUser = NewImageCustomizerError("Validation:InvalidUser", "invalid user") ErrInvalidSSHPublicKeyFile = NewImageCustomizerError("Validation:InvalidSSHPublicKeyFile", "failed to find SSH public key file") ErrSSHPublicKeyNotFile = NewImageCustomizerError("Validation:SSHPublicKeyNotFile", "SSH public key path is not a file") ErrVerityValidation = NewImageCustomizerError("Validation:VerityValidation", "verity validation failed") ErrUnsupportedQemuImageFormat = NewImageCustomizerError("Validation:UnsupportedQemuImageFormat", "unsupported qemu-img format") ErrToolNotRunAsRoot = NewImageCustomizerError("Validation:ToolNotRunAsRoot", "tool should be run as root (e.g. by using sudo)") ErrPackageSnapshotPreviewRequired = NewImageCustomizerError("Validation:PackageSnapshotPreviewRequired", fmt.Sprintf("preview feature '%s' required to specify package snapshot time", imagecustomizerapi.PreviewFeaturePackageSnapshotTime)) ErrVerityPreviewFeatureRequired = NewImageCustomizerError("Validation:VerityPreviewFeatureRequired", fmt.Sprintf("preview feature '%s' required to customize verity enabled base image", imagecustomizerapi.PreviewFeatureReinitializeVerity)) ErrInvalidPackageSnapshotTime = NewImageCustomizerError("Validation:InvalidPackageSnapshotTime", "invalid command-line option '--package-snapshot-time'") // Generic customization errors ErrGetAbsoluteConfigPath = NewImageCustomizerError("Customizer:GetAbsoluteConfigPath", "failed to get absolute path of config file directory") ErrCustomizeOs = NewImageCustomizerError("Customizer:CustomizeOs", "failed to customize OS") ErrCustomizeProvisionVerity = NewImageCustomizerError("Customizer:ProvisionVerity", "failed to provision verity") ErrCustomizeCreateUkis = NewImageCustomizerError("Customizer:CreateUkis", "failed to create UKIs") ErrCustomizeOutputArtifacts = NewImageCustomizerError("Customizer:OutputArtifacts", "failed to output artifacts") // Image conversion errors ErrConvertInputImage = NewImageCustomizerError("ImageConversion:ConvertInput", "failed to convert input image to a raw image") ErrConvertToOutputFormat = NewImageCustomizerError("ImageConversion:ConvertToOutput", "failed to convert customized raw image to output format") ErrDetectImageFormat = NewImageCustomizerError("ImageConversion:DetectFormat", "failed to detect input image format") ErrConvertImageToRawFormat = NewImageCustomizerError("ImageConversion:ConvertToRawFormat", "failed to convert image file to raw format") ErrConvertImageToFormat = NewImageCustomizerError("ImageConversion:ConvertToFormat", "failed to convert image file to format") // Artifacts errors ErrExtractPackages = NewImageCustomizerError("Artifacts:ExtractPackages", "failed to extract installed packages") ErrExtractBootloaderMetadata = NewImageCustomizerError("Artifacts:ExtractBootloaderMetadata", "failed to extract bootloader metadata") ErrCollectOSInfo = NewImageCustomizerError("Artifacts:CollectOSInfo", "failed to collect OS information") // LiveOS errors ErrCreateArtifactsStore = NewImageCustomizerError("LiveOS:CreateArtifactsStore", "failed to create artifacts store") ErrBuildLiveOSConfig = NewImageCustomizerError("LiveOS:BuildConfig", "failed to build Live OS configuration") ErrCreateWriteableImage = NewImageCustomizerError("LiveOS:CreateWriteableImage", "failed to create writeable image") ErrCreateLiveOSArtifacts = NewImageCustomizerError("LiveOS:CreateArtifacts", "failed to create Live OS artifacts") // Filesystem errors ErrShrinkFilesystems = NewImageCustomizerError("Filesystem:Shrink", "failed to shrink filesystems") ErrCheckFilesystems = NewImageCustomizerError("Filesystem:Check", "failed to check filesystems") ErrStatFile = NewImageCustomizerError("Filesystem:StatFile", "failed to stat file") // Verity errors ErrVerityImageConnection = NewImageCustomizerError("Verity:ConnectToImage", "failed to connect to image file to provision verity") ErrGetDiskSectorSize = NewImageCustomizerError("Verity:GetSectorSize", "failed to get disk sector size") ErrMountPartition = NewImageCustomizerError("Verity:MountPartition", "failed to mount partition") ErrUpdateDisk = NewImageCustomizerError("Verity:UpdateDisk", "failed to wait for disk to update") ErrFindVerityDataPartition = NewImageCustomizerError("Verity:FindDataPartition", "failed to find verity data partition") ErrFindVerityHashPartition = NewImageCustomizerError("Verity:FindHashPartition", "failed to find verity hash partition") ErrCalculateRootHash = NewImageCustomizerError("Verity:CalculateRootHash", "failed to calculate root hash") ErrCompileRootHashRegex = NewImageCustomizerError("Verity:CompileRootHashRegex", "failed to compile root hash regex") ErrParseRootHash = NewImageCustomizerError("Verity:ParseRootHash", "failed to parse root hash from veritysetup output") ErrCalculateHashSize = NewImageCustomizerError("Verity:CalculateHashSize", "failed to calculate hash partition size") ErrShrinkHashPartition = NewImageCustomizerError("Verity:ShrinkHashPartition", "failed to shrink hash partition") ErrVerifyVerity = NewImageCustomizerError("Verity:Verify", "failed to verify verity") ErrUpdateKernelArgs = NewImageCustomizerError("Verity:UpdateKernelArgs", "failed to update kernel cmdline arguments for verity") ErrUpdateGrubConfig = NewImageCustomizerError("Verity:UpdateGrubConfig", "failed to update grub config for verity") )
var ( // Image file info errors ErrImageFormatCheck = NewImageCustomizerError("ImageInfo:FormatCheck", "failed to check image file's disk format") ErrQemuImgInfo = NewImageCustomizerError("ImageInfo:QemuImgInfo", "failed to parse qemu-img info JSON") )
var ( // Image history errors ErrImageHistoryDeepCopy = NewImageCustomizerError("ImageHistory:DeepCopy", "failed to deep copy config") ErrImageHistoryModify = NewImageCustomizerError("ImageHistory:Modify", "failed to modify config") ErrImageHistoryDirectoryCreate = NewImageCustomizerError("ImageHistory:DirectoryCreate", "failed to create logging directory") ErrImageHistoryRead = NewImageCustomizerError("ImageHistory:Read", "failed to read image history") ErrImageHistoryWrite = NewImageCustomizerError("ImageHistory:Write", "failed to write image history") ErrImageHistoryFileCheck = NewImageCustomizerError("ImageHistory:FileCheck", "failed to check if file exists") ErrImageHistoryFileRead = NewImageCustomizerError("ImageHistory:FileRead", "failed to read image history file") ErrImageHistoryUnmarshal = NewImageCustomizerError("ImageHistory:Unmarshal", "failed to unmarshal image history file") ErrImageHistoryMarshal = NewImageCustomizerError("ImageHistory:Marshal", "failed to marshal image history") ErrImageHistoryFileWrite = NewImageCustomizerError("ImageHistory:FileWrite", "failed to write image history to file") )
var ( // Kernel check-related errors ErrKernelListRead = NewImageCustomizerError("Kernel:ListRead", "failed to read installed kernels list") ErrKernelModuleDirRead = NewImageCustomizerError("Kernel:ModuleDirRead", "failed to read installed kernel module directory") ErrNoInstalledKernel = NewImageCustomizerError("Kernel:NoInstalled", "no installed kernel found") )
var ( // Kernel module-related errors ErrModuleRemoveFromDisableList = NewImageCustomizerError("Modules:RemoveFromDisableList", "failed to remove module from the disabled list") ErrModuleOptionsOnDisabled = NewImageCustomizerError("Modules:OptionsOnDisabled", "cannot add options for disabled module") ErrModuleDisabledCheck = NewImageCustomizerError("Modules:DisabledCheck", "failed to check if module is disabled") ErrModuleLoadDirCreate = NewImageCustomizerError("Modules:LoadDirCreate", "failed to create directory for module load configuration") ErrModuleLoadConfigRead = NewImageCustomizerError("Modules:LoadConfigRead", "failed to read module load configuration") ErrModuleLoadConfigUpdate = NewImageCustomizerError("Modules:LoadConfigUpdate", "failed to update module load configuration") ErrModuleDisableDirCreate = NewImageCustomizerError("Modules:DisableDirCreate", "failed to create directory for module disable configuration") ErrModuleDisableConfigRead = NewImageCustomizerError("Modules:DisableConfigRead", "failed to read module disable configuration") ErrModuleDisableConfigUpdate = NewImageCustomizerError("Modules:DisableConfigUpdate", "failed to update disable configuration") ErrModuleDisableConfigWrite = NewImageCustomizerError("Modules:DisableConfigWrite", "failed to write module disable configuration") ErrModuleOptionsDirCreate = NewImageCustomizerError("Modules:OptionsDirCreate", "failed to create directory for module options configuration") ErrModuleOptionsConfigRead = NewImageCustomizerError("Modules:OptionsConfigRead", "failed to read module options configuration") ErrModuleOptionsConfigUpdate = NewImageCustomizerError("Modules:OptionsConfigUpdate", "failed to update module options configuration") )
var ( // Resolv.conf-related errors ErrResolvConfStat = NewImageCustomizerError("ResolvConf:Stat", "failed to stat resolv.conf file") ErrResolvConfSymlinkRead = NewImageCustomizerError("ResolvConf:SymlinkRead", "failed to read resolv.conf symlink's path") ErrResolvConfFileRead = NewImageCustomizerError("ResolvConf:FileRead", "failed to read resolv.conf file") ErrResolvConfDelete = NewImageCustomizerError("ResolvConf:Delete", "failed to delete resolv.conf file") ErrResolvConfOverride = NewImageCustomizerError("ResolvConf:Override", "failed to override resolv.conf file with host's resolv.conf") ErrResolvConfSymlinkCreate = NewImageCustomizerError("ResolvConf:SymlinkCreate", "failed to create resolv.conf symlink") ErrResolvConfRestore = NewImageCustomizerError("ResolvConf:Restore", "failed to restore resolv.conf file") ErrResolvConfUnknownType = NewImageCustomizerError("ResolvConf:UnknownType", "unknown resolvConfType value") )
var ( // RPM source mount errors ErrRpmSourceFileTypeDetection = NewImageCustomizerError("RpmSources:FileTypeDetection", "failed to get type of RPM source") ErrRpmSourceTypeUnknown = NewImageCustomizerError("RpmSources:TypeUnknown", "unknown RPM source type") )
var ( // Script execution errors ErrScriptExecution = NewImageCustomizerError("Scripts:Execution", "script execution failed") ErrScriptPathResolution = NewImageCustomizerError("Scripts:PathResolution", "failed to get relative path for temp script file") ErrScriptTempFileRemoval = NewImageCustomizerError("Scripts:TempFileRemoval", "failed to remove temp script file") ErrScriptTempFileCreation = NewImageCustomizerError("Scripts:TempFileCreation", "failed to create temp file for script") ErrScriptTempFileWrite = NewImageCustomizerError("Scripts:TempFileWrite", "failed to write temp file for script") ErrScriptTempFileClose = NewImageCustomizerError("Scripts:TempFileClose", "failed to close temp file for script") )
var ( // IsoConfig validation errors ErrIsoConfigInvalidKdumpBootFiles = NewImageCustomizerError("IsoConfig:InvalidKdumpBootFiles", "invalid kdumpBootFiles") ErrIsoConfigInvalidKernelCommandLine = NewImageCustomizerError("IsoConfig:InvalidKernelCommandLine", "invalid kernelCommandLine") ErrIsoConfigBootstrapUrl = NewImageCustomizerError("IsoConfig:BootstrapUrl", "cannot specify both 'bootstrapBaseUrl' and 'bootstrapFileUrl'") ErrIsoConfigInvalidIsoField = NewImageCustomizerError("IsoConfig:InvalidIsoField", "invalid 'iso' field") ErrIsoConfigInvalidPxeField = NewImageCustomizerError("IsoConfig:InvalidPxeField", "invalid 'pxe' field") ErrIsoConfigInvalidOsField = NewImageCustomizerError("IsoConfig:InvalidOsField", "invalid 'os' field") ErrIsoConfigDirectoryCreate = NewImageCustomizerError("IsoConfig:DirectoryCreate", "failed to create directory") ErrIsoConfigFilePersist = NewImageCustomizerError("IsoConfig:FilePersist", "failed to persist saved configs file") ErrIsoConfigFileExists = NewImageCustomizerError("IsoConfig:FileExists", "failed to check if file exists") ErrIsoConfigFileLoad = NewImageCustomizerError("IsoConfig:FileLoad", "failed to load saved configs file") )
var ( // Filesystem operation errors ErrFilesystemSectorSizeGet = NewImageCustomizerError("Filesystem:SectorSizeGet", "failed to get disk sector size") ErrFilesystemShrink = NewImageCustomizerError("Filesystem:Shrink", "failed to shrink filesystem") ErrFilesystemE2fsckResize = NewImageCustomizerError("Filesystem:E2fsckResize", "failed to check filesystem with e2fsck") ErrFilesystemResize2fs = NewImageCustomizerError("Filesystem:Resize2fs", "failed to resize filesystem with resize2fs") )
var ( // Type conversion errors ErrBootTypeInvalid = NewImageCustomizerError("TypeConversion:BootTypeInvalid", "invalid BootType value") ErrDiskSizeInvalid = NewImageCustomizerError("TypeConversion:DiskSizeInvalid", "disk size must be multiple of 1 MiB") ErrPartitionTableTypeUnknown = NewImageCustomizerError("TypeConversion:PartitionTableTypeUnknown", "unknown partition table type") ErrPartitionStartInvalid = NewImageCustomizerError("TypeConversion:PartitionStartInvalid", "partition start must be multiple of 1 MiB") ErrPartitionEndInvalid = NewImageCustomizerError("TypeConversion:PartitionEndInvalid", "partition end must be multiple of 1 MiB") ErrMountIdentifierTypeUnknown = NewImageCustomizerError("TypeConversion:MountIdentifierTypeUnknown", "unknown MountIdentifierType value") ErrSelinuxModeUnknown = NewImageCustomizerError("TypeConversion:SelinuxModeUnknown", "unknown SELinuxMode value") )
var ( // Boot customization errors ErrBootGrubMkconfigGeneration = NewImageCustomizerError("Boot:GrubMkconfigGeneration", "failed to generate grub.cfg via grub2-mkconfig") )
var ( // Hostname-related errors ErrHostnameWrite = NewImageCustomizerError("Hostname:Write", "failed to write hostname file") )
var ( // Release file errors ErrReleaseFileWrite = NewImageCustomizerError("ReleaseFile:Write", "failed to write customizer release file") )
var ToolVersion = ""
Version specifies the version of the Azure Linux Image Customizer tool. The value of this string is inserted during compilation via a linker flag.
Functions ¶
func AddKernelCommandLine ¶
func AddKernelCommandLine(ctx context.Context, extraCommandLine []string, imageChroot safechroot.ChrootInterface, ) error
Inserts new kernel command-line args into the grub config file.
func AddOrUpdateGroups ¶
func AddOrUpdateGroups(ctx context.Context, groups []imagecustomizerapi.Group, imageChroot safechroot.ChrootInterface, ) error
func AddOrUpdateUsers ¶
func AddOrUpdateUsers(ctx context.Context, users []imagecustomizerapi.User, baseConfigPath string, imageChroot safechroot.ChrootInterface) error
func CheckEnvironmentVars ¶
func CheckEnvironmentVars() error
func ConvertImageFile ¶
func ConvertImageFile(inputPath string, outputPath string, format imagecustomizerapi.ImageFormatType) error
func CreateNewImage ¶
func CreateNewImage(targetOs targetos.TargetOs, filename string, diskConfig imagecustomizerapi.Disk, fileSystems []imagecustomizerapi.FileSystem, buildDir string, chrootDirName string, installOS installOSFunc, ) (map[string]string, error)
func CustomizeImage ¶
func CustomizeImageHelperImageCreator ¶
func CustomizeImageHelperImageCreator(ctx context.Context, buildDir string, baseConfigPath string, config *imagecustomizerapi.Config, rawImageFile string, rpmsSources []string, useBaseImageRpmRepos bool, imageUuidStr string, packageSnapshotTime string, tarFile string, distroHandler distroHandler, ) (map[string]diskutils.FstabEntry, string, error)
func EnableOrDisableServices ¶
func EnableOrDisableServices(ctx context.Context, services imagecustomizerapi.Services, imageChroot safechroot.ChrootInterface) error
func FindLinuxLine ¶
Find the linux command within the grub config file.
func FindNonRecoveryLinuxLine ¶
Find the linux command within non-recovery mode menuentry block in the grub config file.
func GetDefaultGrubFileLinuxArgs ¶
func GetDefaultGrubFileLinuxArgs(defaultGrubFileContent string, varName defaultGrubFileVarName, ) (defaultGrubFileVarAssign, []grubConfigLinuxArg, int, error)
Takes the string contents of a /etc/default/grub file and the name of the command-line args variable (either "GRUB_CMDLINE_LINUX" or "GRUB_CMDLINE_LINUX_DEFAULT") and returns a list of kernel command-line args.
Params:
- defaultGrubFileContent: The string contents of the /etc/default/grub file.
- varName: The name of variable that contains kernel command-line args. Either "GRUB_CMDLINE_LINUX" or "GRUB_CMDLINE_LINUX_DEFAULT".
Returns:
- cmdLineVarAssign: The variable assignment that matches 'varName'.
- args: The list of kernel command-line args.
- insertAt: An index that new kernel command-line args can be inserted at.
func GrubArgsToString ¶
Takes a list of unescaped and unquoted kernel command-line args and combines them into a single string with appropriate quoting for a grub.cfg file.
func InjectFiles ¶
func InjectFiles(ctx context.Context, buildDir string, baseConfigPath string, inputImageFile string, metadata []imagecustomizerapi.InjectArtifactMetadata, outputImageFile string, outputImageFormat string, ) error
func LoadOrDisableModules ¶
func LoadOrDisableModules(ctx context.Context, modules imagecustomizerapi.ModuleList, rootDir string) error
func LogVersionsOfToolDeps ¶
func LogVersionsOfToolDeps()
func NewDistroHandler ¶
NewDistroHandler creates the appropriate distro handler with version support (legacy)
func NewDistroHandlerFromImageConnection ¶
func NewDistroHandlerFromImageConnection(imageConnection *imageconnection.ImageConnection) (distroHandler, error)
NewDistroHandlerFromImageConnection detects the OS from the image and creates the appropriate handler
func NewDistroHandlerFromTargetOs ¶
NewDistroHandlerFromTargetOs creates a distro handler directly from TargetOs
func ParseCommandLineArgs ¶
Takes a tokenized grub.cfg file and makes a best effort to extract the kernel command-line args.
func ReadGrub2ConfigFile ¶
func ReadGrub2ConfigFile(imageChroot safechroot.ChrootInterface) (string, error)
Reads the /boot/grub2/grub.cfg file.
func SystemdFormatCorruptionOption ¶
func SystemdFormatCorruptionOption(corruptionOption imagecustomizerapi.CorruptionOption) (string, error)
func UpdateDefaultGrubFileVariable ¶
func UpdateDefaultGrubFileVariable(defaultGrubFileContent string, varName string, newValue string) (string, error)
Sets the value of a variable in the /etc/default/grub file, either replacing the existing variable value (if one exists) or adding a new one.
func UpdateHostname ¶
func UpdateHostname(ctx context.Context, hostname string, imageChroot safechroot.ChrootInterface) error
func UpdateSELinuxModeInConfigFile ¶
func UpdateSELinuxModeInConfigFile(selinuxMode imagecustomizerapi.SELinuxMode, imageChroot safechroot.ChrootInterface) error
func ValidateConfig ¶
func ValidateRpmSources ¶
func WriteDefaultGrubFile ¶
func WriteDefaultGrubFile(grub2Config string, imageChroot safechroot.ChrootInterface) error
Writes the string contents of the /etc/default/grub file.
Types ¶
type BootCustomizer ¶
type BootCustomizer struct {
// contains filtered or unexported fields
}
func NewBootCustomizer ¶
func NewBootCustomizer(imageChroot safechroot.ChrootInterface) (*BootCustomizer, error)
func (*BootCustomizer) AddKernelCommandLine ¶
func (b *BootCustomizer) AddKernelCommandLine(extraCommandLine []string) error
Inserts new kernel command-line args into the grub config file.
func (*BootCustomizer) GetSELinuxMode ¶
func (b *BootCustomizer) GetSELinuxMode(imageChroot safechroot.ChrootInterface) (imagecustomizerapi.SELinuxMode, error)
func (*BootCustomizer) IsGrubMkconfigImage ¶
func (b *BootCustomizer) IsGrubMkconfigImage() bool
Returns whether or not the OS uses grub-mkconfig.
func (*BootCustomizer) PrepareForVerity ¶
func (b *BootCustomizer) PrepareForVerity() error
Makes changes to the /etc/default/grub file that are needed/useful for enabling verity.
func (*BootCustomizer) SetRootDevice ¶
func (b *BootCustomizer) SetRootDevice(rootDevice string) error
func (*BootCustomizer) UpdateKernelCommandLineArgs ¶
func (b *BootCustomizer) UpdateKernelCommandLineArgs(defaultGrubFileVarName defaultGrubFileVarName, argsToRemove []string, newArgs []string, ) error
func (*BootCustomizer) UpdateSELinuxCommandLine ¶
func (b *BootCustomizer) UpdateSELinuxCommandLine(selinuxMode imagecustomizerapi.SELinuxMode) error
Update the image's SELinux kernel command-line args.
func (*BootCustomizer) UpdateSELinuxCommandLineForEMU ¶
func (b *BootCustomizer) UpdateSELinuxCommandLineForEMU(selinuxMode imagecustomizerapi.SELinuxMode) error
Update the image's SELinux kernel command-line args for OSModifier.
func (*BootCustomizer) WriteToFile ¶
func (b *BootCustomizer) WriteToFile(imageChroot safechroot.ChrootInterface) error
type BootFilesArchConfig ¶
type BootFilesArchConfig struct {
// contains filtered or unexported fields
}
type BootloaderType ¶
type BootloaderType string
const ( BootloaderTypeGrub BootloaderType = "grub" BootloaderTypeSystemdBoot BootloaderType = "systemd-boot" )
func DetectBootloaderType ¶
func DetectBootloaderType(imageChroot safechroot.ChrootInterface) (BootloaderType, error)
type CosiBootloader ¶
type CosiBootloader struct {
Type BootloaderType `json:"type"`
SystemdBoot *SystemDBoot `json:"systemdBoot,omitempty"`
}
type ExtendedMountIdentifierType ¶
type ExtendedMountIdentifierType string
ExtendedMountIdentifierType indicates how a partition should be identified in the fstab file. This type was introduced to extend the functionality of MountIdentifierType while preserving the original public API structure. MountIdentifierType is part of a public API and cannot be modified to include new identifiers without breaking backward compatibility. ExtendedMountIdentifierType provides additional flexibility for internal use without affecting the public API.
const ( // ExtendedMountIdentifierTypeUuid mounts this partition via the filesystem UUID. ExtendedMountIdentifierTypeUuid ExtendedMountIdentifierType = "uuid" // ExtendedMountIdentifierTypePartUuid mounts this partition via the GPT/MBR PARTUUID. ExtendedMountIdentifierTypePartUuid ExtendedMountIdentifierType = "part-uuid" // ExtendedMountIdentifierTypePartLabel mounts this partition via the GPT PARTLABEL. ExtendedMountIdentifierTypePartLabel ExtendedMountIdentifierType = "part-label" // ExtendedMountIdentifierTypeDev mounts this partition via a device. ExtendedMountIdentifierTypeDev ExtendedMountIdentifierType = "dev" // ExtendedMountIdentifierTypeDefault uses the default type, which is PARTUUID. ExtendedMountIdentifierTypeDefault ExtendedMountIdentifierType = "" )
type FileSystem ¶
type ImageBuildData ¶
type ImageBuildData struct {
Source string
KnownInfo outputPartitionMetadata
Metadata *FileSystem
VeritySource string
}
type ImageCustomizerError ¶
type ImageCustomizerError struct {
// contains filtered or unexported fields
}
ImageCustomizerError represents a structured error with a descriptive name
func GetAllImageCustomizerErrors ¶
func GetAllImageCustomizerErrors(err error) []*ImageCustomizerError
func NewImageCustomizerError ¶
func NewImageCustomizerError(name, message string) *ImageCustomizerError
NewImageCustomizerError creates a new named ImageCustomizerError
func (*ImageCustomizerError) Error ¶
func (e *ImageCustomizerError) Error() string
func (*ImageCustomizerError) Name ¶
func (e *ImageCustomizerError) Name() string
Name returns the error name for telemetry purposes
type ImageCustomizerParameters ¶
type ImageCustomizerParameters struct {
// contains filtered or unexported fields
}
type ImageFileInfo ¶
func GetImageFileInfo ¶
func GetImageFileInfo(inputImageFile string) (ImageFileInfo, error)
type ImageHistory ¶
type ImageHistory struct {
BuildTime string `yaml:"timestamp" json:"timestamp"`
ToolVersion string `yaml:"toolVersion" json:"toolVersion"`
ImageUuid string `yaml:"imageUuid" json:"imageUuid"`
Config imagecustomizerapi.Config `yaml:"config" json:"config"`
}
type IsoArtifactsStore ¶
type IsoArtifactsStore struct {
// contains filtered or unexported fields
}
`IsoArtifacts` holds the extracted/generated artifacts necessary to build a LiveOS ISO image.
type IsoFilesStore ¶
type IsoFilesStore struct {
// contains filtered or unexported fields
}
type IsoInfoStore ¶
type IsoInfoStore struct {
// contains filtered or unexported fields
}
type KdumpBootFiles ¶
type KdumpBootFiles struct {
// contains filtered or unexported fields
}
type KernelBootFiles ¶
type KernelBootFiles struct {
// contains filtered or unexported fields
}
type LiveOSConfig ¶
type LiveOSConfig struct {
// contains filtered or unexported fields
}
type LiveOSSavedConfigs ¶
type LiveOSSavedConfigs struct {
KdumpBootFiles *imagecustomizerapi.KdumpBootFilesType `yaml:"kdumpBootFiles"`
KernelCommandLine imagecustomizerapi.KernelCommandLine `yaml:"kernelCommandLine"`
}
func (*LiveOSSavedConfigs) IsValid ¶
func (i *LiveOSSavedConfigs) IsValid() error
type MetadataJson ¶
type MetadataJson struct {
Version string `json:"version"`
OsArch string `json:"osArch"`
Images []FileSystem `json:"images"`
OsRelease string `json:"osRelease"`
Id string `json:"id,omitempty"`
Bootloader CosiBootloader `json:"bootloader"`
OsPackages []OsPackage `json:"osPackages"`
}
type OSSavedConfigs ¶
type OSSavedConfigs struct {
DracutPackageInfo *PackageVersionInformation `yaml:"dracutPackage"`
RequestedSELinuxMode imagecustomizerapi.SELinuxMode `yaml:"selinuxRequestedMode"`
SELinuxPolicyPackageInfo *PackageVersionInformation `yaml:"selinuxPolicyPackage"`
}
func (*OSSavedConfigs) IsValid ¶
func (i *OSSavedConfigs) IsValid() error
type PackageManagerType ¶
type PackageManagerType string
PackageManagerType represents the type of package manager
type PxeSavedConfigs ¶
type PxeSavedConfigs struct {
// contains filtered or unexported fields
}
func (*PxeSavedConfigs) IsValid ¶
func (p *PxeSavedConfigs) IsValid() error
type SavedConfigs ¶
type SavedConfigs struct {
LiveOS LiveOSSavedConfigs `yaml:"liveos"`
Pxe PxeSavedConfigs `yaml:"pxe"`
OS OSSavedConfigs `yaml:"os"`
}
func (*SavedConfigs) IsValid ¶
func (c *SavedConfigs) IsValid() (err error)
type SystemDBoot ¶
type SystemDBoot struct {
Entries []SystemDBootEntry `json:"entries"`
}
type SystemDBootEntry ¶
type SystemDBootEntry struct {
Type SystemDBootEntryType `json:"type"`
Path string `json:"path"`
Cmdline string `json:"cmdline"`
Kernel string `json:"kernel"`
}
type SystemDBootEntryType ¶
type SystemDBootEntryType string
const ( SystemDBootEntryTypeUKIStandalone SystemDBootEntryType = "uki-standalone" SystemDBootEntryTypeUKIConfig SystemDBootEntryType = "uki-config" SystemDBootEntryTypeConfig SystemDBootEntryType = "config" )
type UkiKernelInfo ¶
UkiKernelInfo holds both command line arguments and initramfs name for a UKI kernel
type VerityConfig ¶
Source Files
¶
- artifactsinputoutput.go
- bootcustomizer.go
- checkfilesystem.go
- cosicommon.go
- cosimetadata.go
- customizebootloader.go
- customizefiles.go
- customizegroups.go
- customizehostname.go
- customizeos.go
- customizeoverlays.go
- customizepackages.go
- customizepackages_rpm.go
- customizepartitions.go
- customizepartitionsfilecopy.go
- customizepartitionsuuids.go
- customizeselinux.go
- customizeservices.go
- customizetdnfsnapshot.go
- customizeuki.go
- customizeusers.go
- customizeverity.go
- defaultgrubutils.go
- distrohandler.go
- distrohandler_azurelinux.go
- distrohandler_fedora.go
- dracututils.go
- errors.go
- extendedmountidentifiertype.go
- extractpartitions.go
- grubcfgutils.go
- imagecreator.go
- imagecustomizer.go
- imagefileinfo.go
- imagehistory.go
- imageutils.go
- installedkernelcheck.go
- kernelmoduleutils.go
- liveosisoartifactstore.go
- liveosisobuilder.go
- liveosisogrub.go
- liveosisoimages.go
- liveosisoutils.go
- liveospxe.go
- packageinformation.go
- packagemanager_dnf.go
- packagemanager_rpm.go
- packagemanager_tdnf.go
- partitionutils.go
- readonlymounts.go
- releasefile.go
- resolvconf.go
- rpmsourcesmounts.go
- runscripts.go
- savedconfigs.go
- shrinkfilesystems.go
- typeConversion.go
- verityutils.go
- versionsOfToolDependencies.go