Documentation
¶
Index ¶
- func CalcFileChecksum(fs v1.FS, fileName string) (string, error)
- func ConcatFiles(fs v1.FS, sources []string, target string) (err error)
- func CopyDir(src string, dst string) error
- func CopyFile(fs v1.FS, source string, target string) (err error)
- func CreateDirStructure(fs v1.FS, target string) error
- func CreateSquashFS(runner v1.Runner, logger sdkTypes.KairosLogger, source string, ...) error
- func CreateTar(log sdkTypes.KairosLogger, ...) error
- func DD(inputFile, outputFile string, bs, count, skip, seek int64) error
- func DirSize(fs v1.FS, path string) (int64, error)
- func Exists(fs v1.FS, path string) (bool, error)
- func GetArchFromRootfs(rootfs string, l sdkTypes.KairosLogger) (string, error)
- func GolangArchToArch(arch string) (string, error)
- func IsAmd64(arch string) bool
- func IsArm64(arch string) bool
- func IsDir(fs v1.FS, path string) (bool, error)
- func MkdirAll(fs v1.FS, name string, mode os.FileMode) (err error)
- func NameFromCmdline(basename, cmdline string) string
- func NameFromRootfs(rootfs string) string
- func SafeOCIName(name string) string
- func ServeUkiPXE(isoFile string, log types.KairosLogger) error
- func Tar(src string, writers ...io.Writer) error
- func TempDir(fs v1.FS, dir, prefix string) (name string, err error)
- type BootEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcFileChecksum ¶
CalcFileChecksum opens the given file and returns the sha256 checksum of it.
func ConcatFiles ¶
ConcatFiles Copies source files to target file using Fs interface. Source files are concatenated into target file in the given order. If target is a directory source is copied into that directory using 1st source name file.
func CopyDir ¶ added in v0.4.4
CopyDir copies the contents of the source directory to the destination directory.
func CopyFile ¶
CopyFile Copies source file to target file using Fs interface. If target is directory source is copied into that directory using source name file.
func CreateDirStructure ¶
Copies source file to target file using Fs interface
func CreateSquashFS ¶
func CreateSquashFS(runner v1.Runner, logger sdkTypes.KairosLogger, source string, destination string, options []string) error
CreateSquashFS creates a squash file at destination from a source, with options TODO: Check validity of source maybe?
func CreateTar ¶
func CreateTar(log sdkTypes.KairosLogger, srctar, dstimageTar, imagename, architecture, OS string) error
CreateTar a imagetarball from a standard tarball
func DD ¶ added in v0.4.4
DD copies a file from input file to output file with the given block size, count, skip and seek. Mimics the dd utility
func GetArchFromRootfs ¶ added in v0.5.4
func GetArchFromRootfs(rootfs string, l sdkTypes.KairosLogger) (string, error)
GetArchFromRootfs returns the architecture from the rootfs of a Kairos image
func GolangArchToArch ¶
func NameFromCmdline ¶
NameFromCmdline returns the name of the efi/conf file based on the cmdline we want to have at least 1 efi file that its the default, that is the one we ship with the iso/media/whatever install medium that one has the default cmdline + the install cmdline For that one, we use it as the BASE one, configs will only trigger for that install stanza if we are on install media so we dont have to worry about it, but we want to provide a clean name for it so in that case we dont add anything to the efi name/conf name/cmdline inside the config For the other ones, we add the cmdline to the efi name and the cmdline to the conf file so you get - norole.efi - norole.conf - norole_interactive-install.efi - norole_interactive-install.conf This is mostly for convenience in generating the names as the real data is stored in the config file but it can easily be used to identify the efi file and the conf file.
func NameFromRootfs ¶ added in v0.6.5
NameFromRootfs This generates the artifact name based on the rootfs kairos-release files name of isos for example so we store them equally: kairos-ubuntu-24.04-core-amd64-generic-v3.2.4.iso Raw images kairos-ubuntu-24.04-core-amd64-generic-v3.2.4.raw Containers 24.10-core-amd64-generic-v3.3.1 22.04-core-arm64-rpi4-v3.3.1 UKI containers 24.04-core-amd64-generic-v3.3.1-uki raw images for boards 22.04-core-arm64-rpi4-v3.3.1-img So basically for iso/raw images we append kairos and the distro name for containers we store them under the distro name (ubuntu, opensuse, etc) as the repo name and then the rest is for the tag quay.io/kairos/ubuntu:24.04-core-amd64-generic-v3.2.4 so in here we only return the shared part of the name its the callers responsibility to add the rest of the name if its building an iso or raw image also, no extension is added to the name, so its up to the caller to add it
func SafeOCIName ¶ added in v0.8.2
SafeOCIName returns a string version of the artifact name without + which are invalid in labels
func ServeUkiPXE ¶ added in v0.8.0
func ServeUkiPXE(isoFile string, log types.KairosLogger) error
ServeUkiPXE starts a HTTP+DHCP server that serves the UKI ISO file over HTTP.
Types ¶
type BootEntry ¶
func GetUkiCmdline ¶
func GetUkiCmdline() []BootEntry
GetUkiCmdline returns the cmdline to be used for the kernel. The cmdline can be overridden by the user using the cmdline flag. For each cmdline passed, we generate a uki file with that cmdline extend-cmdline will just extend the default cmdline so we only create one efi file extra-cmdline will create a new efi file for each cmdline passed
func GetUkiSingleCmdlines ¶
func GetUkiSingleCmdlines(logger sdkTypes.KairosLogger) []BootEntry
GetUkiSingleCmdlines returns the single-efi-cmdline as passed by the user.