1
0
mirror of https://github.com/rancher/os.git synced 2025-08-28 11:12:59 +00:00

Merge pull request #1732 from rancher/partition-option-doesnt-need-host-dev-mount

Don't need host dev mount for pre-created partition
This commit is contained in:
Sven Dowideit 2017-03-27 11:00:35 +10:00 committed by GitHub
commit 02a47b2edc
2 changed files with 8 additions and 8 deletions

View File

@ -97,7 +97,8 @@ func installAction(c *cli.Context) error {
log.Fatalf("invalid arguments %v", c.Args()) log.Fatalf("invalid arguments %v", c.Args())
} }
if c.Bool("debug") { debug := c.Bool("debug")
if debug {
originalLevel := log.GetLevel() originalLevel := log.GetLevel()
defer log.SetLevel(originalLevel) defer log.SetLevel(originalLevel)
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
@ -154,7 +155,7 @@ func installAction(c *cli.Context) error {
cloudConfig = uc 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") log.WithFields(log.Fields{"err": err}).Fatal("Failed to run install")
return err return err
} }
@ -167,7 +168,7 @@ func installAction(c *cli.Context) error {
return nil 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) fmt.Printf("Installing from %s\n", image)
if !force { if !force {
@ -278,6 +279,9 @@ func runInstall(image, installType, cloudConfig, device, partition, kappend stri
if kexec { if kexec {
installerCmd = append(installerCmd, "--kexec") installerCmd = append(installerCmd, "--kexec")
} }
if debug {
installerCmd = append(installerCmd, "--debug")
}
// TODO: mount at /mnt for shared mount? // TODO: mount at /mnt for shared mount?
if useIso { if useIso {
@ -300,10 +304,7 @@ func runInstall(image, installType, cloudConfig, device, partition, kappend stri
log.Debugf("running installation") log.Debugf("running installation")
if partition != "" { if partition == "" {
device = "/host" + device
partition = "/host" + partition
} else {
if installType == "generic" || if installType == "generic" ||
installType == "syslinux" || installType == "syslinux" ||
installType == "gptsyslinux" { installType == "gptsyslinux" {

View File

@ -47,7 +47,6 @@ sudo kpartx -a ${DISK}
docker run --privileged -it --rm \ docker run --privileged -it --rm \
-v /dev/mapper:/dev/mapper \ -v /dev/mapper:/dev/mapper \
-v /:/host \
-v ${STATE}:/cluster \ -v ${STATE}:/cluster \
rancher/os:${VERSION} \ rancher/os:${VERSION} \
--isoinstallerloaded=1 \ --isoinstallerloaded=1 \