Skip to content

Update image configs#284

Merged
srmungar merged 28 commits intomainfrom
dev_feiyu
Nov 12, 2025
Merged

Update image configs#284
srmungar merged 28 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 November 5, 2025 05:51
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 standardizes image configurations across multiple OS variants by introducing a fixed ISO label, consolidating bootloader settings, and adding installer script support. The changes ensure consistent ISO creation, streamline configuration files by removing version specifications, and enable attended installation workflows.

Key changes:

  • Hardcoded ISO volume label to "OIC_CDROM" and removed dynamic label sanitization
  • Switched ISO configurations from systemd-boot to grub bootloader
  • Added support for user startup scripts and attended installer functionality

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/image/isomaker/isomaker.go Introduces constant ISO label and removes dynamic label generation
internal/image/imageos/imageos.go Adds user startup script configuration functionality
internal/image/imageboot/imageboot.go Updates file copy operations to use force flag
config/osv/wind-river-elxr/elxr12/imageconfigs/defaultconfigs/default-raw-x86_64.yml Removes kernel version specification
config/osv/wind-river-elxr/elxr12/imageconfigs/defaultconfigs/default-iso-x86_64.yml Changes bootloader to grub and adds kernel cmdline
config/osv/wind-river-elxr/elxr12/imageconfigs/defaultconfigs/default-initrd-x86_64.yml Adds installer script, startup script config, and removes kernel version
config/osv/edge-microvisor-toolkit/emt3/imageconfigs/defaultconfigs/default-raw-x86_64.yml Removes kernel version and adds kernel package
config/osv/edge-microvisor-toolkit/emt3/imageconfigs/defaultconfigs/default-iso-x86_64.yml Changes bootloader to grub and adds kernel configuration
config/osv/edge-microvisor-toolkit/emt3/imageconfigs/defaultconfigs/default-initrd-x86_64.yml Consolidates packages and adds installer script support
config/osv/azure-linux/azl3/imageconfigs/defaultconfigs/default-raw-x86_64.yml Removes kernel version and adds kernel package
config/osv/azure-linux/azl3/imageconfigs/defaultconfigs/default-iso-x86_64.yml Expands package list, changes bootloader, and adds kernel config
config/osv/azure-linux/azl3/imageconfigs/defaultconfigs/default-initrd-x86_64.yml Consolidates packages and adds installer script support
config/general/isolinux/unattendedinstaller New unattended installer script using fixed ISO label
config/general/isolinux/attendedinstaller New attended installer script using fixed ISO label

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

Comment thread internal/image/imageos/imageos.go Outdated
Comment thread internal/image/imageos/imageos.go Outdated
Comment thread internal/image/imageos/imageos.go Outdated
Changed file.CopyFile calls to use '-f' flag to force overwrite when copying
GRUB and systemd-boot configuration files. This ensures consistent
configuration state even if destination files exist.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Added logic to configure a startup script for users during image creation.
The script modifies the user's entry in etc/passwd when a StartupScript
is specified in the user configuration. This enables users to have custom
commands run at login.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Replace dynamic ISO label sanitization with a constant 'OIC_CDROM' label.
Removes the now-unused sanitizeIsoLabel function. This ensures consistent
ISO labeling and simplifies the code by removing dynamic label generation.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
This commit introduces two new Bash scripts for handling ISO installation:
1. attendedinstaller - Allows interactive installation with rebooting option
2. unattendedinstaller - Performs automated installation process

Signed-off-by: Yu, Fei <fei.yu@intel.com>
- Consolidate package lists to use core-packages-base-image
- Add attendedinstaller script and startup configuration
- Switch bootloader provider from systemd-boot to grub
- Standardize kernel configuration with packages section
- Add SELinux, virtualization and development packages for ISO images
- Update kernel command line parameters across all configs

The changes streamline package management and ensure consistent
boot behavior across different image types while expanding
functionality for development and virtualization scenarios.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Escaped user input values in the configUserStartupScript function to prevent
potential regex injection. Added a new ReplaceRegexInFile utility function
to handle regex replacements using sed safely. The changes ensure special
characters in usernames and startup scripts won't break the pattern matching.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
The command map and related path verification functionality was
overly complex and not providing sufficient value. Simplified
the shell command execution by removing:
- The entire commandMap with hardcoded paths
- Path verification in GetFullCmdStr
- Pattern extraction for sed/echo commands

This makes the code more maintainable while keeping the core
functionality intact. The change means commands will now rely on
the system PATH rather than hardcoded locations, which is a more
common and flexible approach.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
This commit introduces a new live installer tool that supports both
attended (interactive UI) and unattended (automated) installation modes.
The installer creates disk partitions, installs OS packages,
and configures the system according to a provided image template.

Key features:
- Interactive TUI installer with multiple configuration views
- Unattended installation mode for automated deployments
- Support for custom disk partitioning (auto and manual)
- Dependency checking and validation
- Progress tracking with status updates
- Secure boot support and bootloader configuration
- Comprehensive input validation and error handling

The implementation includes a modular UI framework using tview/tcell,
custom UI primitives, and integration with existing OS image
composition components.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Included build steps for live-installer in Earthfile and Go commands.
Added live-installer as a required component in default initrd configs
for Azure Linux (azl3), Edge Microvisor Toolkit (emt3), and Wind River
ELxR (elxr12). Updated README to document build requirements for
ISO image creation.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
- Retrieve essential package list in ChrootEnv's UpdateSystemPkgs
- Add EssentialPkgList field to ImageTemplate struct
- Include EssentialPkgList in GetPackages result for full package listing

The change enables tracking of essential packages separately and ensures
they're included in the final package installation list. This provides
better control over core system components.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
- Introduced `getGrubVersion()` to detect GRUB version (grub2 vs grub)
- Updated EFI installation to handle different GRUB versions and paths
- Added package type parameter to support Debian-specific EFI requirements
- Modified all related functions to pass through the GRUB version
- Updated tests to include new package type parameter

These changes improve compatibility with different GRUB versions and distributions.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Added stty echo toggling in both attended and unattended installer scripts
to prevent sensitive information from being displayed in the TTY session
during installation. The change ensures better security while maintaining
TTY usability after installation completes.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
- Add 'eject' package to default-initrd-x86_64 config
- Remove 'systemd-boot' from both initrd and ISO configs
- Replace 'grub-pc-bin' with 'grub2-common' in ISO config
- Maintain consistent bootloader packages across configs

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Include mock command patterns for grub2-mkconfig in test scenarios to ensure
this cmd will not be realy executed.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
feiyu11859661 and others added 12 commits November 11, 2025 14:31
Removed temporary stderr redirection in favor of direct status updates. Added
detailed progress tracking in monitorStatus with specific percentage increments
for key installation milestones. Now writes status updates directly to logText.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Verify that the specified startup script exists in the image before
proceeding with configuration. If the script is missing, log an error
and return early to prevent further processing with an invalid path.

This ensures we fail fast when startup scripts are misconfigured rather
than encountering issues during later execution stages.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
The 'Sudo: true' setting alone isn't implemented for user permissions. Added
the user to the 'sudo' group explicitly to ensure proper sudo access.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
- Changed commandMap from map[string]string to map[string][]string to support
  multiple executable paths for commands
- Added new commands: efibootmgr, eject, grub-mkconfig, grub-install
- Updated path verification logic to check multiple locations
- Improved sed pattern extraction regex to handle more cases
- Modified command verification to properly handle shell builtins
- Updated IsBashAvailable to work with new commandMap structure

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Add dmesg -D to disable kernel messages before running the installer and
dmesg -E to re-enable them after completion. This prevents distracting
kernel messages from appearing in the TTY session during installation,
similar to how we handle echoing of sensitive data.

Signed-off-by: Yu, Fei <fei.yu@intel.com>
Address multiple issues for live-installer
srmungar and others added 2 commits November 12, 2025 09:42
- Remove unused chrootbuild import and helper function from install_test.go
- Add mock shell executor setup for lsblk output in multiple test files
- Fix progress monitor test to include progress channel
- Remove validation for domain ending with dash in hostname tests
- Clean up whitespace in test files

Signed-off-by: Yu, Fei <fei.yu@intel.com>
@srmungar srmungar merged commit 9e6904b into main Nov 12, 2025
7 of 9 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.

3 participants