Skip to content

cloud-init: look up helper scripts under /usr/libexec on Photon - #1676

Open
dcasota wants to merge 1 commit into
vmware:5.0from
dcasota:fix/cloud-init-generator-libexecdir
Open

dcasota wants to merge 1 commit into
vmware:5.0from
dcasota:fix/cloud-init-generator-libexecdir

Conversation

@dcasota

@dcasota dcasota commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

cloud-init 26.2 (SPECS/cloud-init, subrelease 92 and later) is built with meson, which installs its helper scripts in libexecdir:

/usr/libexec/cloud-init/write-ssh-key-fingerprints
/usr/libexec/cloud-init/hook-hotplug

cloudinit/distros/photon.py does not override Distro.usr_lib_exec, which defaults to /usr/lib in cloudinit/distros/__init__.py:132 (rhel.py:30 sets /usr/libexec). Two readers resolve to the wrong directory:

  • cloudinit/config/cc_keys_to_console.py:36 looks for write-ssh-key-fingerprints under /usr/lib/cloud-init and does not find it
  • Distro.get_clouddir() (cloudinit/distros/__init__.py:1406) returns /usr/lib/cloud-init/clouddir

SPECS/91/cloud-init and SPECS/90/cloud-init (25.1.3) install the helpers under %{_libdir}/cloud-init, where the default resolves correctly.

Change

  • New 0012-photon-usr-lib-exec-is-libexecdir.patch: usr_lib_exec = "/usr/libexec" in cloudinit/distros/photon.py, as for the other RPM distributions whose meson build installs helpers to libexecdir.
  • SPECS/cloud-init/cloud-init.spec: Patch11, Release 26.2-4 -> 26.2-5, one %changelog entry.

Testing

  • %prep applies all patches of the spec to the checksum-verified 26.2 tarball at --fuzz=0; the prepared photon.py sets usr_lib_exec = "/usr/libexec".
  • rpmspec -P (x86_64 and aarch64) and check_spec.py --mainline 93 pass at subreleases 92 and 93.

🤖 Generated with Claude Code

@dcasota

dcasota commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @prashant1221 , could you please review the PR? Thank you in advance for a short comment. Best wishes, Daniel

dcasota pushed a commit to dcasota/photonos-scripts that referenced this pull request Sep 11, 2026
`fix/cloud-init-generator-libexecdir` (dcasota/photon#32, vmware/photon#1676)
is now part of the branch set both installer variants are built from, so every
ISO the matrix builds carries cloud-init 26.2-3 rather than 26.2-2.

Without it the generator resolves ds-identify under /usr/lib while the meson
install puts it in /usr/libexec, exits 3, and every 26.2 guest reports
"status: not started" where a 25.1.3 guest reports "done".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dcasota
dcasota force-pushed the fix/cloud-init-generator-libexecdir branch from 38bc54e to 68f70a3 Compare September 17, 2026 06:02
dcasota added a commit to dcasota/photonos-scripts that referenced this pull request Sep 26, 2026
minimal Requires cloud-init, and make image does not rebuild an
install-only dependency, so the older cloud-init 26.2-2 RPM kept being
used and the branch's 26.2-3 (vmware/photon#1676) never reached the
ISO. v5 adds cloud-init to the pre-build list next to the STIG set.

Verified on a fresh kickstart install of linux-esx 7.3-rc4 (PVSCSI,
vmxnet3): 0 journal lines for "missing module BTF", "Failed to find
module" and "cloud-init-generator failed"; rdrand_rng loaded;
cloud-init status done; system running.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dcasota
dcasota force-pushed the fix/cloud-init-generator-libexecdir branch from 68f70a3 to 8d58023 Compare September 27, 2026 07:30
@dcasota
dcasota force-pushed the fix/cloud-init-generator-libexecdir branch from 8d58023 to 2f4e974 Compare October 9, 2026 07:24
cloud-init 26.2 is built with meson, which installs its helper scripts
in libexecdir:

    /usr/libexec/cloud-init/write-ssh-key-fingerprints
    /usr/libexec/cloud-init/hook-hotplug

cloudinit/distros/photon.py does not override Distro.usr_lib_exec, which
defaults to /usr/lib in cloudinit/distros/__init__.py:132 (rhel.py:30
sets /usr/libexec). cc_keys_to_console.py:36 therefore looks for
write-ssh-key-fingerprints under /usr/lib/cloud-init and does not find
it, and Distro.get_clouddir() (distros/__init__.py:1406) resolves to the
same wrong directory.

Set usr_lib_exec to /usr/libexec in photon.py, as for the other RPM
distributions whose meson build installs helpers to libexecdir.

Only the mainline spec (subrelease 92 and later) is affected. SPECS/91
(25.1.3) and SPECS/90 (25.1.3) install the helpers under %{_libdir},
where the default resolves correctly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dcasota
dcasota force-pushed the fix/cloud-init-generator-libexecdir branch from 2f4e974 to c797b44 Compare October 22, 2026 18:23
@dcasota dcasota changed the title cloud-init: fix the generator looking for ds-identify at the wrong path cloud-init: look up helper scripts under /usr/libexec on Photon Oct 24, 2026

This branch has not been deployed

No deployments
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.

1 participant