Skip to content

Commit

Permalink
iso: Pass all options through to ISO generation
Browse files Browse the repository at this point in the history
We need to pass the full suite of options to the ISO
generation code to ensure the call to swupd has all
of the requested options.

Signed-off-by: Mark D Horn <[email protected]>
  • Loading branch information
mdhorn committed May 7, 2019
1 parent f75f9aa commit 27ccfc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
6 changes: 3 additions & 3 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro
msg = "Generating ISO image"
prg = progress.NewLoop(msg)
log.Info(msg)
if err = generateISO(rootDir, model); err != nil {
if err = generateISO(rootDir, model, options); err != nil {
log.ErrorError(err)
}
prg.Success()
Expand Down Expand Up @@ -760,15 +760,15 @@ func saveInstallResults(rootDir string, md *model.SystemInstall) error {
}

// generateISO creates an ISO image from the just created raw image
func generateISO(rootDir string, md *model.SystemInstall) error {
func generateISO(rootDir string, md *model.SystemInstall, options args.Args) error {
var err error
msg := "Building ISO image"
prg := progress.NewLoop(msg)
log.Info(msg)

if !md.LegacyBios {
for _, alias := range md.StorageAlias {
if err = isoutils.MakeIso(rootDir, strings.TrimSuffix(alias.File, filepath.Ext(alias.File)), md); err != nil {
if err = isoutils.MakeIso(rootDir, strings.TrimSuffix(alias.File, filepath.Ext(alias.File)), md, options); err != nil {
return err
}
}
Expand Down
15 changes: 5 additions & 10 deletions isoutils/isoutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,14 @@ func mkRootfs() error {
return err
}

func mkInitrd(version string, model *model.SystemInstall) error {
func mkInitrd(version string, model *model.SystemInstall, options args.Args) error {
msg := "Installing the base system for initrd"
prg := progress.NewLoop(msg)
log.Info(msg)

var err error
options := args.Args{
SwupdMirror: model.SwupdMirror,
SwupdStateDir: tmpPaths[clrInitrd] + "/var/lib/swupd/",
SwupdStateClean: true,
SwupdFormat: "staging",
SwupdSkipDiskSpaceCheck: true,
}
options.SwupdStateDir = tmpPaths[clrInitrd] + "/var/lib/swupd/"
options.SwupdFormat = "staging"
sw := swupd.New(tmpPaths[clrInitrd], options)

/* Should install the overridden CoreBundles above (eg. os-core only) */
Expand Down Expand Up @@ -537,7 +532,7 @@ func cleanup() {
}

/*MakeIso creates an ISO image from a built image in the current directory*/
func MakeIso(rootDir string, imgName string, model *model.SystemInstall) error {
func MakeIso(rootDir string, imgName string, model *model.SystemInstall, options args.Args) error {
tmpPaths[clrRootfs] = rootDir
tmpPaths[clrImgEfi] = rootDir + "/boot"
var err error
Expand All @@ -561,7 +556,7 @@ func MakeIso(rootDir string, imgName string, model *model.SystemInstall) error {
return err
}

if err = mkInitrd(string(version), model); err != nil {
if err = mkInitrd(string(version), model, options); err != nil {
return err
}

Expand Down

0 comments on commit 27ccfc8

Please sign in to comment.