Skip to content

isoBuilder: put installer-requestable packages on the media - #49

Open
dcasota wants to merge 1 commit into
vmware:masterfrom
dcasota:upstream/isobuilder-installer-pkgs-on-media
Open

dcasota wants to merge 1 commit into
vmware:masterfrom
dcasota:upstream/isobuilder-installer-pkgs-on-media

Conversation

@dcasota

@dcasota dcasota commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

The problem

The installer's STIG menu offers "Apply STIG hardening", which makes the installer request KS_STIG_PACKAGES at install time. Those names were never added to the ISO's own RPMS/.

On a minimal ISO that is fatal, because downloadPkgs() resolves a dependency closure rather than copying every rpm — so the packages are simply not on the media, and the install dies with:

Error(1011) : No matching packages

A second, related gap: packages named via --initrd-pkgs never reached the download list either. Only the list file was parsed, so a package requested on the command line could not be installed into the initrd from the ISO's own RPMS/.

The change

isoBuilder.py extends self.pkg_list with:

  1. stigenable.KS_STIG_PACKAGES — the installer's own declaration of what the STIG option installs.
  2. the packages named by --initrd-pkgs.

Both extend self.pkg_list only, so they land in the ISO's RPMS/ and the initrd does not grow.

The first point is deliberately a reference to the installer's own list rather than a restatement of those names in a package-list file. Restating them is exactly how the media and the installer drifted apart in the first place: the menu kept offering an option the media could not honour.

Verification

A minimal ISO built with this change carries 290 rpms instead of 254, including selinux-policy, libselinux-utils, rsyslog, aide, openssl-fips-provider and ntpsec.

Installed from that media:

  • the UI wizard's STIG option completes — no Error(1011)
  • the installed system comes up SELinux Enforcing
  • 0 failed ansible tasks

Lint, matching what lint-checks.sh runs in CI:

python3 -m py_compile photon_installer/isoBuilder.py   → OK
python3 -m isort --check-only --diff .                 → exit 0, no diff
python3 -m flake8 .                                    → exit 0

stigenable is imported at module level, so isoBuilder now depends on it at import time. That transitively pulls in curses via menu.py/window.py, which matters because the ISO builder runs headless in a container — so it is checked rather than assumed. Importing isoBuilder with no TERM and no tty succeeds, and the resulting package selection is unchanged:

module-level import of isoBuilder succeeded (no tty, no TERM)
isoBuilder.stigenable present: True
KS_STIG_PACKAGES: ['audit', 'rsyslog', 'openssl-fips-provider', 'selinux-policy',
                   'libselinux-utils', 'ntp', 'aide', 'libgcrypt']
MISSING from pkg_list: none
RESULT: PASS

(curses only touches the terminal at initscr(), not at import.)

The RPM ships the whole package — photon-os-installer.spec installs %{python3_sitelib}/*, which includes stigenable.py — and docker/Dockerfile installs that RPM into the final image, so the new import resolves wherever isoBuilder actually runs. There is no import cycle: stigenable imports only actionresult, menu and window, none of which reach back to isoBuilder.

The 290-rpm count above includes ntp, libselinux-utils and libgcrypt, which #47 drops from the STIG set.

🤖 Generated with Claude Code

Comment thread photon_installer/isoBuilder.py Outdated
# UI modules, which need not be a module-level dependency of the ISO
# builder. These go to the ISO's RPMS/ only, not into self.initrd_pkgs,
# so the initrd does not grow.
from stigenable import KS_STIG_PACKAGES

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you please move this to the top of the file, with import stigenable, and refer to it as stigenable.KS_STIG_PACKAGES?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

git apply --check (strict, no fuzz) returns 0 on v2.8, v2.9 and origin/master; after applying, isoBuilder.py compiles, import stigenable works headless, isoBuilder.stigenable.KS_STIG_PACKAGES is stigenable.KS_STIG_PACKAGES holds, and on all three the hunk lands in downloadPkgs() with the import at module level.
Tested on minimal-iso x86_64. Ongoing full-iso build should be the same. aarch64 not tested.

@dcasota
dcasota force-pushed the upstream/isobuilder-installer-pkgs-on-media branch from 5a6fff7 to aefaa84 Compare September 1, 2026 18:16
dcasota added a commit to dcasota/photon that referenced this pull request Sep 1, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Idbc6e7565c915770305eeb22a7198ba649735ca0
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 1, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: I3be44f73d323be4bb243c85be2e88d10a6d8f8a8
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 1, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 16, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 16, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 16, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 16, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: I3be44f73d323be4bb243c85be2e88d10a6d8f8a8
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 17, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Sep 17, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: I3be44f73d323be4bb243c85be2e88d10a6d8f8a8
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota added a commit to dcasota/photon that referenced this pull request Oct 7, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dcasota added a commit to dcasota/photon that referenced this pull request Oct 7, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: I3be44f73d323be4bb243c85be2e88d10a6d8f8a8
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dcasota added a commit to dcasota/photon that referenced this pull request Oct 7, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dcasota added a commit to dcasota/photon that referenced this pull request Oct 7, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: I3be44f73d323be4bb243c85be2e88d10a6d8f8a8
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two gaps in how the download list is built.

1. The STIG menu offers "Apply STIG hardening", which makes the installer
   request KS_STIG_PACKAGES at install time. Those names were never added to
   the ISO's own RPMS/, so on a minimal ISO - where downloadPkgs() resolves a
   closure rather than copying every rpm - the packages simply were not there
   and the install failed with "Error(1011) : No matching packages".
   Use stigenable.KS_STIG_PACKAGES rather than restating the names in a
   package list file; restating them is exactly how the media and the
   installer drifted apart.

2. Packages named via --initrd-pkgs never reached this list either. Only the
   list *file* was parsed, so a package requested on the command line could
   not be installed into the initrd from the ISO's own RPMS/.

Both extend self.pkg_list only, so they land in the ISO's RPMS/ and the
initrd does not grow.

Verified end to end: a minimal ISO built with this carries 290 rpms instead
of 254, including selinux-policy, libselinux-utils, rsyslog, aide,
openssl-fips-provider and ntpsec; the UI wizard's STIG option completes; and
the installed system comes up SELinux Enforcing with 0 failed ansible tasks.

Signed-off-by: Daniel Casota <dcasota@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dcasota
dcasota force-pushed the upstream/isobuilder-installer-pkgs-on-media branch from aefaa84 to b5b1627 Compare October 9, 2026 07:33
dcasota added a commit to dcasota/photon that referenced this pull request Oct 29, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dcasota added a commit to dcasota/photon that referenced this pull request Nov 1, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: Iff902337549b191c714ff4ef8a42564017feb402
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dcasota added a commit to dcasota/photon that referenced this pull request Nov 1, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: I3be44f73d323be4bb243c85be2e88d10a6d8f8a8
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dcasota added a commit to dcasota/photon that referenced this pull request Nov 2, 2026
Regenerated 0008 from github.com/dcasota/photon-os-installer @ 56ae83c, which
carries the form requested in review on vmware/photon-os-installer#49: a
module-level `import stigenable` referenced as `stigenable.KS_STIG_PACKAGES`,
rather than a local `from stigenable import KS_STIG_PACKAGES` inside
downloadPkgs().

Package selection is unchanged; only where the import happens moves.

Change-Id: I3be44f73d323be4bb243c85be2e88d10a6d8f8a8
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

2 participants