Skip to content

Commit

Permalink
Ignore flags when installing onto physical media
Browse files Browse the repository at this point in the history
Ignore the --iso and --keep-image flags for the massinstaller
when installing onto physical media as they do not logically apply.

Signed-off-by: Mark D Horn <[email protected]>
  • Loading branch information
mdhorn committed Nov 26, 2019
1 parent a9befd5 commit f2e376e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro
detachMe := []string{}
removeMe := []string{}
aliasMap := map[string]string{}
usingPhysicalMedia := true

// prepare image file, case the user has declared image alias then create
// the image, setup the loop device, prepare the variable expansion
Expand All @@ -135,6 +136,7 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro
}

expandMe = append(expandMe, tm)
usingPhysicalMedia = false
}
}

Expand Down Expand Up @@ -202,6 +204,21 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro

mountPoints := []*storage.BlockDevice{}

if usingPhysicalMedia {
if model.MakeISO {
msg := "Flag --iso not valid for physical media; disabling"
fmt.Println(msg)
log.Warning(msg)
model.MakeISO = false
}
if model.KeepImage {
msg := "Flag --keep-image not valid for physical media; disabling"
fmt.Println(msg)
log.Warning(msg)
model.KeepImage = false
}
}

// prepare all the target block devices
for _, curr := range model.TargetMedias {
var wholeDisk bool
Expand Down

0 comments on commit f2e376e

Please sign in to comment.