-
Notifications
You must be signed in to change notification settings - Fork 49
/
vmdk.go
80 lines (70 loc) · 1.62 KB
/
vmdk.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package rhel9
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distro/rhel"
"github.com/osbuild/images/pkg/rpmmd"
)
const vmdkKernelOptions = "ro net.ifnames=0"
func mkVMDKImgType() *rhel.ImageType {
it := rhel.NewImageType(
"vmdk",
"disk.vmdk",
"application/x-vmdk",
map[string]rhel.PackageSetFunc{
rhel.OSPkgsKey: vmdkCommonPackageSet,
},
rhel.DiskImage,
[]string{"build"},
[]string{"os", "image", "vmdk"},
[]string{"vmdk"},
)
it.DefaultImageConfig = &distro.ImageConfig{
Locale: common.ToPtr("en_US.UTF-8"),
}
it.KernelOptions = vmdkKernelOptions
it.Bootable = true
it.DefaultSize = 4 * common.GibiByte
it.BasePartitionTables = defaultBasePartitionTables
return it
}
func mkOVAImgType() *rhel.ImageType {
it := rhel.NewImageType(
"ova",
"image.ova",
"application/ovf",
map[string]rhel.PackageSetFunc{
rhel.OSPkgsKey: vmdkCommonPackageSet,
},
rhel.DiskImage,
[]string{"build"},
[]string{"os", "image", "vmdk", "ovf", "archive"},
[]string{"archive"},
)
it.DefaultImageConfig = &distro.ImageConfig{
Locale: common.ToPtr("en_US.UTF-8"),
}
it.KernelOptions = vmdkKernelOptions
it.Bootable = true
it.DefaultSize = 4 * common.GibiByte
it.BasePartitionTables = defaultBasePartitionTables
return it
}
func vmdkCommonPackageSet(t *rhel.ImageType) rpmmd.PackageSet {
ps := rpmmd.PackageSet{
Include: []string{
"@core",
"chrony",
"cloud-init",
"firewalld",
"langpacks-en",
"open-vm-tools",
"tuned",
},
Exclude: []string{
"dracut-config-rescue",
"rng-tools",
},
}
return ps
}