Skip to content

Combine ubuntu and centos build scripts#13

Merged
metal3-io-bot merged 1 commit into
mainfrom
nuhakala/combine-build-scripts
Dec 11, 2025
Merged

Combine ubuntu and centos build scripts#13
metal3-io-bot merged 1 commit into
mainfrom
nuhakala/combine-build-scripts

Conversation

@nuhakala
Copy link
Copy Markdown
Member

@nuhakala nuhakala commented Dec 1, 2025

This PR combines the two existing build scripts. Also, the build script is updated for CentOS Stream 9: the package names have slightly changed and also creating python venv needed to adjust.

Copy link
Copy Markdown
Contributor

@smoshiur1237 smoshiur1237 left a comment

Choose a reason for hiding this comment

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

Small nit
otherwise LGTM

Comment thread build_ipa_sles.sh
Comment thread build_ipa_sles.sh Outdated
Comment thread build_ipa_sles.sh Outdated
Copy link
Copy Markdown
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

Nits.

Comment thread build_ipa_sles.sh Outdated
Comment thread build_ipa_sles.sh Outdated
Comment thread hack/shellcheck.sh Outdated
@nuhakala nuhakala force-pushed the nuhakala/combine-build-scripts branch 2 times, most recently from b9cac3c to 9cff8c7 Compare December 1, 2025 10:34
Copy link
Copy Markdown
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm
/cc @Rozzii

Copy link
Copy Markdown
Contributor

@Rozzii Rozzii left a comment

Choose a reason for hiding this comment

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

Thanks for improving this script, this usually gets little love. Looks good but a few things need to change.

Comment thread build_ipa_sles.sh
Comment thread build_ipa_sles.sh
@nuhakala nuhakala force-pushed the nuhakala/combine-build-scripts branch from 9cff8c7 to 9666da7 Compare December 2, 2025 13:24
@metal3-io-bot metal3-io-bot removed the lgtm label Dec 2, 2025
@nuhakala nuhakala requested review from Rozzii and tuminoid December 3, 2025 09:32
Comment thread build_ipa_sles.sh Outdated
"sles-ipa-install" "${IPA_BASE_OS}" "sles-zypper-config" "sles-ipa-ramdisk-base" \
"dynamic-login" "journal-to-console" "devuser" "openssh-server" "sles-extra-hardware" \
"ipa-module-autoload" "simple-init" "override-simple-init" -o "${IPA_IMAGE_NAME}"
"ipa-module-autoload" "${SIMPLE_INIT_ELEMENTS}" -o "${IPA_IMAGE_NAME}"
Copy link
Copy Markdown
Contributor

@Rozzii Rozzii Dec 3, 2025

Choose a reason for hiding this comment

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

Have you run this with this "SIMPLE_INIT_ENABLED"?
I had issues in the past extending argument list like this. I would think that disk-image-create would try to handle the subtitution like this "simple-init override-simple-init" as a single argument.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have, it expands correctly on ubuntu and centos.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't know here, but generally array and [@] would be a safer choice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown
Contributor

@Rozzii Rozzii left a comment

Choose a reason for hiding this comment

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

/appove

Copy link
Copy Markdown

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 consolidates the Ubuntu and CentOS build scripts into a single unified script that supports both operating systems. The changes include removing deprecated glean/simple-init configurations, adding OS detection logic, and updating package installation commands for CentOS Stream 9 compatibility.

Key Changes:

  • Unified build script with OS detection supporting both Ubuntu and CentOS
  • Migrated from virtualenv command to python3 -m venv for virtual environment creation
  • Made simple-init elements optional via new INCLUDE_SIMPLE_INIT environment variable

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
build_ipa_sles_on_ubuntu.sh Removed - functionality merged into unified script
build_ipa_sles.sh Enhanced with OS detection, conditional package installation, and optional simple-init support
testenv.sh Added INCLUDE_SIMPLE_INIT environment variable defaulting to false
README.md Documented the new INCLUDE_SIMPLE_INIT configuration option

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

Comment thread build_ipa_sles.sh Outdated
Comment thread build_ipa_sles.sh Outdated
Comment thread build_ipa_sles.sh Outdated
Comment thread build_ipa_sles.sh Outdated
# Build the IPA initramfs and kernel images
#################################################
SIMPLE_INIT_ELEMENTS=""
if [[ "${INCLUDE_SIMPLE_INIT}" == true ]]; then
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The string comparison "${INCLUDE_SIMPLE_INIT}" == true compares against the literal string "true", not a boolean. While this works, it's inconsistent with the usage pattern elsewhere in the script where boolean variables are tested directly (e.g., if $ENABLE_BOOTSTRAP_TEST on line 138).

For consistency with the codebase, consider either:

  1. Using if [[ "${INCLUDE_SIMPLE_INIT}" == "true" ]] (with quotes around "true"), or
  2. Testing directly: if $INCLUDE_SIMPLE_INIT (matching line 138's pattern)

Note: If using option 2, ensure the variable is set to true or false without quotes.

Suggested change
if [[ "${INCLUDE_SIMPLE_INIT}" == true ]]; then
INCLUDE_SIMPLE_INIT=${INCLUDE_SIMPLE_INIT:-false}
if $INCLUDE_SIMPLE_INIT; then

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Keep string test, the binary true/false is very confusing these days.

Copy link
Copy Markdown
Member Author

@nuhakala nuhakala Dec 10, 2025

Choose a reason for hiding this comment

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

Added quotes around "true". I think it does not really matter, but at least it is the same as other if-clauses in the script.

Comment thread build_ipa_sles.sh
Signed-off-by: Nuutti Hakala <nuutti.hakala@est.tech>
@nuhakala nuhakala force-pushed the nuhakala/combine-build-scripts branch from d8d201c to 8eeb16e Compare December 10, 2025 06:53
@Rozzii
Copy link
Copy Markdown
Contributor

Rozzii commented Dec 11, 2025

/approve

@terror96 terror96 self-requested a review December 11, 2025 08:29
Copy link
Copy Markdown

@terror96 terror96 left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot
Copy link
Copy Markdown
Member

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Rozzii, terror96

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot merged commit b497cdd into main Dec 11, 2025
4 checks passed
@metal3-io-bot metal3-io-bot deleted the nuhakala/combine-build-scripts branch December 11, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants