2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-08-20 14:06:42 +00:00

add split boot partiton support

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2023-02-22 17:26:32 +01:00
committed by Adphi
parent 490f235c6d
commit 532ee3f1a3
11 changed files with 168 additions and 41 deletions

View File

@@ -107,6 +107,8 @@ var (
d2vm.WithCmdLineExtra(cmdLineExtra),
d2vm.WithNetworkManager(d2vm.NetworkManager(networkManager)),
d2vm.WithRaw(raw),
d2vm.WithSplitBoot(splitBoot),
d2vm.WithBootSize(bootSize),
); err != nil {
return err
}

View File

@@ -95,6 +95,8 @@ var (
d2vm.WithCmdLineExtra(cmdLineExtra),
d2vm.WithNetworkManager(d2vm.NetworkManager(networkManager)),
d2vm.WithRaw(raw),
d2vm.WithSplitBoot(splitBoot),
d2vm.WithBootSize(bootSize),
); err != nil {
return err
}
@@ -109,12 +111,12 @@ var (
}
)
func parseSize(s string) (int64, error) {
func parseSize(s string) (uint64, error) {
var v datasize.ByteSize
if err := v.UnmarshalText([]byte(s)); err != nil {
return 0, err
}
return int64(v), nil
return uint64(v), nil
}
func init() {

View File

@@ -33,6 +33,8 @@ var (
containerDiskTag = ""
push bool
networkManager string
splitBoot bool
bootSize uint64
)
func buildFlags() *pflag.FlagSet {
@@ -46,5 +48,7 @@ func buildFlags() *pflag.FlagSet {
flags.BoolVar(&raw, "raw", false, "Just convert the container to virtual machine image without installing anything more")
flags.StringVarP(&containerDiskTag, "tag", "t", "", "Container disk Docker image tag")
flags.BoolVar(&push, "push", false, "Push the container disk image to the registry")
flags.BoolVar(&splitBoot, "split-boot", false, "Split the boot partition from the root partition")
flags.Uint64Var(&bootSize, "boot-size", 100, "Size of the boot partition in MB")
return flags
}