From 2f28a00e02d35ed2e54cd02cbd84516d06e9f78c Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Mon, 27 Mar 2017 00:59:11 +0000 Subject: [PATCH] Don't need host dev mount for pre-created partition Signed-off-by: Sven Dowideit --- cmd/control/install.go | 15 ++++++++------- scripts/run-install | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/control/install.go b/cmd/control/install.go index f2673ae0..6183947f 100755 --- a/cmd/control/install.go +++ b/cmd/control/install.go @@ -97,7 +97,8 @@ func installAction(c *cli.Context) error { log.Fatalf("invalid arguments %v", c.Args()) } - if c.Bool("debug") { + debug := c.Bool("debug") + if debug { originalLevel := log.GetLevel() defer log.SetLevel(originalLevel) log.SetLevel(log.DebugLevel) @@ -154,7 +155,7 @@ func installAction(c *cli.Context) error { cloudConfig = uc } - if err := runInstall(image, installType, cloudConfig, device, partition, kappend, force, kexec, isoinstallerloaded); err != nil { + if err := runInstall(image, installType, cloudConfig, device, partition, kappend, force, kexec, isoinstallerloaded, debug); err != nil { log.WithFields(log.Fields{"err": err}).Fatal("Failed to run install") return err } @@ -167,7 +168,7 @@ func installAction(c *cli.Context) error { return nil } -func runInstall(image, installType, cloudConfig, device, partition, kappend string, force, kexec, isoinstallerloaded bool) error { +func runInstall(image, installType, cloudConfig, device, partition, kappend string, force, kexec, isoinstallerloaded, debug bool) error { fmt.Printf("Installing from %s\n", image) if !force { @@ -278,6 +279,9 @@ func runInstall(image, installType, cloudConfig, device, partition, kappend stri if kexec { installerCmd = append(installerCmd, "--kexec") } + if debug { + installerCmd = append(installerCmd, "--debug") + } // TODO: mount at /mnt for shared mount? if useIso { @@ -300,10 +304,7 @@ func runInstall(image, installType, cloudConfig, device, partition, kappend stri log.Debugf("running installation") - if partition != "" { - device = "/host" + device - partition = "/host" + partition - } else { + if partition == "" { if installType == "generic" || installType == "syslinux" || installType == "gptsyslinux" { diff --git a/scripts/run-install b/scripts/run-install index 4a6ce940..2b6771d6 100755 --- a/scripts/run-install +++ b/scripts/run-install @@ -47,7 +47,6 @@ sudo kpartx -a ${DISK} docker run --privileged -it --rm \ -v /dev/mapper:/dev/mapper \ - -v /:/host \ -v ${STATE}:/cluster \ rancher/os:${VERSION} \ --isoinstallerloaded=1 \