mirror of
https://github.com/linka-cloud/d2vm.git
synced 2025-12-14 15:03:12 +00:00
add "append-to-cmdline" option
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ import (
|
||||
"go.linka.cloud/d2vm/pkg/docker"
|
||||
)
|
||||
|
||||
func Convert(ctx context.Context, img string, size int64, password string, output string) error {
|
||||
func Convert(ctx context.Context, img string, size int64, password string, output string, cmdLineExtra string) error {
|
||||
imgUUID := uuid.New().String()
|
||||
tmpPath := filepath.Join(os.TempDir(), "d2vm", imgUUID)
|
||||
if err := os.MkdirAll(tmpPath, os.ModePerm); err != nil {
|
||||
@@ -67,7 +67,7 @@ func Convert(ctx context.Context, img string, size int64, password string, outpu
|
||||
if format == "" {
|
||||
format = "raw"
|
||||
}
|
||||
b, err := NewBuilder(ctx, tmpPath, imgUUID, "", size, r, format)
|
||||
b, err := NewBuilder(ctx, tmpPath, imgUUID, "", size, r, format, cmdLineExtra)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user