disk: add packages for LUKS containers

Add the packages required for LUKS containers to the build root when
getting the list of packages from the PartitionTable.
This commit is contained in:
Achilleas Koutsou 2022-08-17 19:32:48 +02:00 committed by Tom Gundersen
parent eb731e031d
commit c38c7ad126

View file

@ -613,6 +613,7 @@ func (pt *PartitionTable) GetBuildPackages() []string {
hasXFS := false
hasFAT := false
hasEXT4 := false
hasLUKS := false
introspectPT := func(e Entity, path []Entity) error {
switch ent := e.(type) {
@ -631,6 +632,8 @@ func (pt *PartitionTable) GetBuildPackages() []string {
case "ext4":
hasEXT4 = true
}
case *LUKSContainer:
hasLUKS = true
}
return nil
}
@ -652,6 +655,13 @@ func (pt *PartitionTable) GetBuildPackages() []string {
if hasEXT4 {
packages = append(packages, "e2fsprogs")
}
if hasLUKS {
packages = append(packages,
"clevis",
"clevis-luks",
"cryptsetup",
)
}
return packages
}