Skip to content

Add ISO config and package copying functionality #277

Merged
yockgen merged 4 commits intomainfrom
dev_feiyu
Oct 29, 2025
Merged

Add ISO config and package copying functionality #277
yockgen merged 4 commits intomainfrom
dev_feiyu

Conversation

@feiyu11859661
Copy link
Copy Markdown
Contributor

Merge Checklist

All boxes should be checked before merging the PR

  • The changes in the PR have been built and tested
  • Ready to merge

Description

Any Newly Introduced Dependencies

How Has This Been Tested?

Copilot AI review requested due to automatic review settings October 28, 2025 07:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to copy configuration files and packages to ISO images during the ISO creation process. The changes introduce two new methods for managing ISO contents and refactor an existing configuration saving function to be a method on the ImageTemplate struct.

Key changes:

  • New copyConfigFilesToIso method handles copying general config, OSV config, additional files, and template dumps to the ISO
  • New copyImagePkgsToIso method copies package files from the chroot cache to the ISO's cache-repo directory
  • Refactored SaveUpdatedConfigFile from a standalone function to an ImageTemplate method with proper implementation
  • Updated SBOM copy operation to use the file.CopyFile utility
  • Added essential packages (dosfstools, mmdebstrap, cryptsetup) to the default initrd configuration

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/image/isomaker/isomaker.go Adds two new methods for copying config files and packages to ISO, integrates them into the ISO creation workflow
internal/config/config.go Converts SaveUpdatedConfigFile to an ImageTemplate method with full YAML marshaling and file writing implementation
internal/config/config_test.go Updates test calls to use the new method signature
internal/config/manifest/manifest.go Simplifies SBOM copy operation by using file.CopyFile utility and removes unused security import
config/osv/wind-river-elxr/elxr12/imageconfigs/defaultconfigs/default-initrd-x86_64.yml Adds three new packages to the system configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/config/config.go
Replaced manual file operations in CopySBOMToChroot with file.CopyFile utility,
removing redundant directory creation and security checks. This makes the code
more concise while maintaining functionality through the utility's built-in
safety features, also address the access permission issue when non root user
execute the os-image-composer tool.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
The method now includes proper error handling, directory creation, and
safe file writing with symlink protection, ensuring atomic writes and basic
security checks. Tests have been updated to use the new method signature.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
- Implement copyConfigFilesToIso to copy general and OSV config files
- Handle additional files with path updates in template
- Add copyImagePkgsToIso to copy package files to ISO cache
- Integrate both functions into the main ISO creation flow
- Include error handling and logging for all operations

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Added dosfstools, mmdebstrap, and cryptsetup packages to support
package based iso installer.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Copy link
Copy Markdown
Contributor

@arodage arodage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed config changes. LGTM.

@yockgen yockgen merged commit 24c30fc into main Oct 29, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants