From 25538141e924f53081f24ea341a1607533083c70 Mon Sep 17 00:00:00 2001 From: Daniel Casota Date: Sat, 6 Jun 2026 04:00:23 +0200 Subject: [PATCH] photon-os-installer: 2.8-3 - fix interactive install + UI output overlay Carry three installer patches for the 5.0 build until they land upstream: - 0003 isoInstaller interactive (no-kickstart) install fix - 0004 add btrfs-progs when a btrfs partition is selected - 0005 tdnf: capture install output (no /etc/os-release overlay on the UI) Change-Id: I273ef29927bc4d05bfa2ca0531144108657c84f1 --- ...aller-fix-interactive-NoneType-crash.patch | 74 +++++++++++++++++++ .../0004-installer-add-btrfs-progs.patch | 15 ++++ .../0005-tdnf-capture-install-output.patch | 44 +++++++++++ .../photon-os-installer.spec | 12 ++- 4 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 SPECS/photon-os-installer/0003-isoInstaller-fix-interactive-NoneType-crash.patch create mode 100644 SPECS/photon-os-installer/0004-installer-add-btrfs-progs.patch create mode 100644 SPECS/photon-os-installer/0005-tdnf-capture-install-output.patch diff --git a/SPECS/photon-os-installer/0003-isoInstaller-fix-interactive-NoneType-crash.patch b/SPECS/photon-os-installer/0003-isoInstaller-fix-interactive-NoneType-crash.patch new file mode 100644 index 0000000000..35b60ca214 --- /dev/null +++ b/SPECS/photon-os-installer/0003-isoInstaller-fix-interactive-NoneType-crash.patch @@ -0,0 +1,74 @@ +From ad38512caefb9525a4d9cde74f7e736887930346 Mon Sep 17 00:00:00 2001 +From: Daniel Casota +Date: Thu, 4 Jun 2026 15:24:46 +0200 +Subject: [PATCH] isoInstaller: fix interactive (no-kickstart) ISO install + +Booting the ISO interactively (no ks= boot param, no -c config, no VMware +guestinfo.kickstart.*) was broken by two coupled regressions: + +1) _load_ks_config_platform()/_load_ks_config_vmware() returned None when + no platform kickstart exists; __init__ then crashed at + 'if "live" not in install_config' with: + TypeError: argument of type 'NoneType' is not a container or iterable + Fix: return an empty {} config instead of None. + +2) The 'live' block unconditionally stamped install_config['live']=True, + making the empty interactive config truthy. installer.configure() only + runs the UI configurator when 'not install_config', so the UI was + skipped and _check_install_config() raised 'No disk configured'. + Fix: only stamp 'live' on a non-empty (kickstart) config; leave the + interactive config empty so the UI runs (live then defaults via + _add_defaults()). + +Regression introduced by 9fc8733 on top of 0a72c3a. + +Co-Authored-By: Daniel Casota +--- + photon_installer/isoInstaller.py | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/photon_installer/isoInstaller.py b/photon_installer/isoInstaller.py +index dd0bed7..f2b3e67 100644 +--- a/photon_installer/isoInstaller.py ++++ b/photon_installer/isoInstaller.py +@@ -79,8 +79,12 @@ class IsoInstaller(object): + else: + install_config = self._load_ks_config_platform(verify=not insecure_installation) + +- # 'live' should be True for iso installs +- if 'live' not in install_config: ++ # 'live' should be True for iso installs. Only stamp it on an actual ++ # (non-empty) kickstart config. For an interactive install the config ++ # is empty here and must stay falsy, otherwise installer.configure() ++ # ('if not install_config and ui_config') skips the UI configurator ++ # and _check_install_config() fails with "No disk configured". ++ if install_config and 'live' not in install_config: + install_config['live'] = True + + if insecure_installation and install_config is not None: +@@ -164,7 +168,10 @@ class IsoInstaller(object): + if CommandUtils.is_vmware_virtualization(): + return self._load_ks_config_vmware(verify=verify) + else: +- return None ++ # No platform-provided kickstart: fall back to an interactive ++ # install with an empty config. Returning None here makes the ++ # caller crash at "if 'live' not in install_config". ++ return {} + + def _load_ks_config_vmware(self, verify=True): + try: +@@ -191,6 +198,10 @@ class IsoInstaller(object): + print( + f"Failed to run vmtoolsd, do you have open-vm-tools installed? Error: {e}" + ) ++ # No guestinfo kickstart (data/url both absent) or vmtoolsd missing: ++ # fall back to an interactive install with an empty config instead of ++ # returning None, which would crash at "if 'live' not in install_config". ++ return {} + + def mount_media(self, photon_media, mount_path=Defaults.MOUNT_PATH): + """Mount the external media""" +-- +2.43.7 + diff --git a/SPECS/photon-os-installer/0004-installer-add-btrfs-progs.patch b/SPECS/photon-os-installer/0004-installer-add-btrfs-progs.patch new file mode 100644 index 0000000000..fb3b8c3dd9 --- /dev/null +++ b/SPECS/photon-os-installer/0004-installer-add-btrfs-progs.patch @@ -0,0 +1,15 @@ +diff --git a/photon_installer/installer.py b/photon_installer/installer.py +index 7c50b29..7b9ab39 100644 +--- a/photon_installer/installer.py ++++ b/photon_installer/installer.py +@@ -2343,6 +2343,10 @@ password_pbkdf2 {grub_user} {grub_password_hash} + # add lvm2 package to install list + self._add_packages_to_install('lvm2') + ++ # add btrfs-progs if any partition uses btrfs ++ if any(p.get('filesystem') == 'btrfs' for p in partitions): ++ self._add_packages_to_install('btrfs-progs') ++ + # Create partitions_data (needed for mk-setup-grub.sh) + for partition in partitions: + if 'mountpoint' in partition and not partition.get('shadow', False): diff --git a/SPECS/photon-os-installer/0005-tdnf-capture-install-output.patch b/SPECS/photon-os-installer/0005-tdnf-capture-install-output.patch new file mode 100644 index 0000000000..e921dffa45 --- /dev/null +++ b/SPECS/photon-os-installer/0005-tdnf-capture-install-output.patch @@ -0,0 +1,44 @@ +From 43ea3a467cfc4c4abb2690e17fe3ab5e619f19cf Mon Sep 17 00:00:00 2001 +From: Daniel Casota +Date: Thu, 4 Jun 2026 22:05:37 +0200 +Subject: [PATCH] tdnf: capture install output so it doesn't overlay the curses + UI + +execute(do_json=False) used subprocess.check_call(), inheriting the +installer's stdout/stderr. During a UI install that overlays the curses +progress bar with tdnf/rpm messages (e.g. file paths like /etc/os-release). +Capture the output and send it to the log instead. + +Co-Authored-By: Daniel Casota +--- + photon_installer/tdnf.py | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/photon_installer/tdnf.py b/photon_installer/tdnf.py +index 8d98b8e..567dd61 100644 +--- a/photon_installer/tdnf.py ++++ b/photon_installer/tdnf.py +@@ -177,7 +177,19 @@ class Tdnf: + + return retval, out_json + else: +- return subprocess.check_call(args) ++ # Capture output and route it to the log instead of inheriting the ++ # parent's stdout/stderr. During a UI (curses) install the latter ++ # overlays the progress bar with tdnf/rpm messages such as file ++ # paths (e.g. /etc/os-release). ++ process = subprocess.Popen( ++ args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ++ ) ++ for line in process.stdout: ++ self.logger.info(line.decode('utf-8', errors='replace').rstrip()) ++ retval = process.wait() ++ if retval != 0: ++ raise subprocess.CalledProcessError(retval, args) ++ return retval + + def run(self, args=None, do_json=True): + # Fix mutable default arguments issue +-- +2.43.7 + diff --git a/SPECS/photon-os-installer/photon-os-installer.spec b/SPECS/photon-os-installer/photon-os-installer.spec index 8113a9e17b..c07ff98fe5 100644 --- a/SPECS/photon-os-installer/photon-os-installer.spec +++ b/SPECS/photon-os-installer/photon-os-installer.spec @@ -5,7 +5,7 @@ Summary: Photon OS Installer Name: photon-os-installer Version: 2.8 -Release: 2%{?dist} +Release: 3%{?dist} Group: System Environment/Base Vendor: VMware, Inc. Distribution: Photon @@ -17,6 +17,9 @@ Source1: license.txt Patch0: 0001-Use-mkpasswd-to-generate-password-hash.patch Patch1: 0002-fix-up-old-public_key-syntax-for-backward-compatibil.patch +Patch2: 0003-isoInstaller-fix-interactive-NoneType-crash.patch +Patch3: 0004-installer-add-btrfs-progs.patch +Patch4: 0005-tdnf-capture-install-output.patch BuildRequires: python3-devel BuildRequires: python3-pyinstaller @@ -71,6 +74,13 @@ rm -rf %{buildroot} %{_bindir}/photon-iso-builder %changelog +* Thu Jun 04 2026 Daniel Casota 2.8-3 +- isoInstaller: fix interactive (no-kickstart) install - no longer crashes + (TypeError on a None config) or skips the disk-selection UI ("No disk + configured"); regression from upstream 9fc8733/0a72c3a +- installer: add btrfs-progs when a btrfs partition is selected +- tdnf: capture install output so it no longer overlays the curses UI + with file paths like /etc/os-release * Fri May 15 2026 Vamsi Krishna Brahmajosyula 2.8-2 - Extended to build for subrelease 91 and above * Tue Apr 28 2026 Oliver Kurth 2.8-1