-
Notifications
You must be signed in to change notification settings - Fork 679
[mic][iso] Added the ability to customize an existing mic-generated iso. #8785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1ee09de
[mic][iso] Added the ability to customie an existing mic-generated iso.
gmileka 3a02c2f
Update documentation.
gmileka b4e6133
Fix build break after rebasing.
gmileka 88d4654
Make the top-level scripts node optional.
gmileka a3edaef
Code review feedback.
gmileka 18ef6a2
Code review feedback. Round 2.
gmileka 74c3a4c
Fix rebase build error.
gmileka 3d18193
Carry over artifacts from source iso.
gmileka c0145dd
Code review feedback. Round 3.
gmileka 9d040ee
Unit tests green again.
gmileka ff98232
Block exporting/shrinking partitions when the input image is an iso.
gmileka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,7 @@ func doCustomizations(buildDir string, baseConfigPath string, config *imagecusto | |
| return err | ||
| } | ||
|
|
||
| err = addRemoveAndUpdatePackages(buildDir, baseConfigPath, &config.OS, imageChroot, rpmsSources, | ||
| err = addRemoveAndUpdatePackages(buildDir, baseConfigPath, config.OS, imageChroot, rpmsSources, | ||
|
gmileka marked this conversation as resolved.
|
||
| useBaseImageRpmRepos) | ||
| if err != nil { | ||
| return err | ||
|
|
@@ -112,9 +112,11 @@ func doCustomizations(buildDir string, baseConfigPath string, config *imagecusto | |
| } | ||
| } | ||
|
|
||
| err = runScripts(baseConfigPath, config.Scripts.PostCustomization, imageChroot) | ||
| if err != nil { | ||
| return err | ||
| if config.Scripts != nil { | ||
| err = runScripts(baseConfigPath, config.Scripts.PostCustomization, imageChroot) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| } | ||
|
|
||
| err = selinuxSetFiles(selinuxMode, imageChroot) | ||
|
|
@@ -127,9 +129,11 @@ func doCustomizations(buildDir string, baseConfigPath string, config *imagecusto | |
| return err | ||
| } | ||
|
|
||
| err = runScripts(baseConfigPath, config.Scripts.FinalizeCustomization, imageChroot) | ||
| if err != nil { | ||
| return err | ||
| if config.Scripts != nil { | ||
| err = runScripts(baseConfigPath, config.Scripts.FinalizeCustomization, imageChroot) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| } | ||
|
|
||
| return nil | ||
|
|
@@ -440,6 +444,9 @@ func handleBootLoader(baseConfigPath string, config *imagecustomizerapi.Config, | |
| case imagecustomizerapi.ResetBootLoaderTypeHard: | ||
| logger.Log.Infof("Resetting bootloader config") | ||
|
|
||
| if config.Storage == nil { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought storage is not necessary to |
||
| return fmt.Errorf("failed to configure bootloader. Missing 'storage' configuration.") | ||
| } | ||
| // Hard-reset the grub config. | ||
| err := configureDiskBootLoader(imageConnection, config.Storage.FileSystems, | ||
| config.Storage.BootType, config.OS.SELinux, config.OS.KernelCommandLine, currentSelinuxMode) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it have to be
LiveOSiso only? what will happen if a regular iso is used?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, the input iso has to an image previously generated by mic. If the input iso does not have the same exact names and location of bits as the one generated by mic, customization will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[we need to locate bootloaders, kernel, initrd, rootfs, grub.cfg in specific locations and with specific names]