Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package agama-installer for openSUSE:Factory 
checked in at 2026-07-15 16:25:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/agama-installer (Old)
 and      /work/SRC/openSUSE:Factory/.agama-installer.new.1991 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "agama-installer"

Wed Jul 15 16:25:42 2026 rev:37 rq:1365624 version:22.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/agama-installer/agama-installer.changes  
2026-06-27 18:04:30.256764519 +0200
+++ 
/work/SRC/openSUSE:Factory/.agama-installer.new.1991/agama-installer.changes    
    2026-07-15 16:30:49.484423441 +0200
@@ -1,0 +2,20 @@
+Thu Jul  9 10:04:12 UTC 2026 - Knut Anderssen <[email protected]>
+
+- Add support for configuring HNV in the initramfs providing the
+  IP configuration through the kernel cmdline with the rd.hcn.ip
+  and the rd.hcn.route options (jsc#PED-14533).
+
+-------------------------------------------------------------------
+Wed Jul  8 13:19:39 UTC 2026 - Ladislav Slezák <[email protected]>
+
+Fixes related to bsc#1268779:
+- Removed "ignition" from the installer image
+- Do not start "combustion" by default, can be manually enabled
+  with the "rd.systemd.wants=firstboot.target" boot option
+
+-------------------------------------------------------------------
+Tue Jun 30 14:01:30 UTC 2026 - Santiago Zarate <[email protected]>
+
+- Disable firefox's Link Preview feature gh#agama-project/agama#3687
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ agama-installer.kiwi ++++++
--- /var/tmp/diff_new_pack.Qlexp2/_old  2026-07-15 16:30:53.060545084 +0200
+++ /var/tmp/diff_new_pack.Qlexp2/_new  2026-07-15 16:30:53.076545628 +0200
@@ -64,7 +64,6 @@
         <package name="avahi"/>
         <package name="bind-utils"/>
         <package name="systemd"/>
-        <package name="ignition"/>
         <package name="combustion"/>
         <package name="procps"/>
         <package name="iputils"/>

++++++ README.md ++++++
--- /var/tmp/diff_new_pack.Qlexp2/_old  2026-07-15 16:30:53.172548894 +0200
+++ /var/tmp/diff_new_pack.Qlexp2/_new  2026-07-15 16:30:53.176549029 +0200
@@ -13,11 +13,12 @@
 To build the ISO locally run the
 
 ```shell
-osc build -M <build_flavor> images
+osc build -M $BUILD_FLAVOR $REPO
 ```
 
-command. See the [_multibuild](_multibuild) file for the list of configured
-build flavors. To build for example the openSUSE flavor run this command:
+command. See the [`_multibuild`](_multibuild) file for the list of configured
+build flavors. See `osc repos` for the correct repo names.
+To build for example the openSUSE flavor run this command:
 
 ```shell
 osc build -M openSUSE images

++++++ config-cdroot.tar.xz ++++++

++++++ config.sh ++++++
--- /var/tmp/diff_new_pack.Qlexp2/_old  2026-07-15 16:30:53.364555425 +0200
+++ /var/tmp/diff_new_pack.Qlexp2/_new  2026-07-15 16:30:53.368555561 +0200
@@ -145,7 +145,13 @@
 echo "root=live:LABEL=$label" >/etc/cmdline.d/10-liveroot.conf
 echo "root_disk=live:LABEL=$label" >>/etc/cmdline.d/10-liveroot.conf
 echo 'install_items+=" /etc/cmdline.d/10-liveroot.conf "' 
>/etc/dracut.conf.d/10-liveroot-file.conf
-echo 'add_dracutmodules+=" dracut-menu agama-cmdline agama-dud 
live-self-update initrd-nmtui chrony "' 
>>/etc/dracut.conf.d/10-liveroot-file.conf
+echo 'add_dracutmodules+=" dracut-menu agama-cmdline agama-dud 
live-self-update initrd-nmtui chrony"' 
>>/etc/dracut.conf.d/10-liveroot-file.conf
+
+if [ "${arch}" = "ppc64le" ]; then
+  # Added support for configuring HCN in dracut (jsc#PED-14533) only in 
ppc64le.
+  echo 'add_dracutmodules+=" hcn"' >>/etc/dracut.conf.d/10-liveroot-file.conf
+fi
+
 
 # decrease the kernel logging on the console, use a dracut module to do it 
early in the boot process
 echo 'add_dracutmodules+=" agama-logging "' > 
/etc/dracut.conf.d/10-agama-logging.conf
@@ -338,9 +344,9 @@
 
 # Kernel modules (+ firmware) for X13s
 if [ "$(arch)" == "aarch64" ]; then
-       echo 'add_drivers+=" clk-rpmh dispcc-sc8280xp gcc-sc8280xp 
gpucc-sc8280xp nvmem_qcom-spmi-sdam qcom_hwspinlock qcom_q6v5 qcom_q6v5_pas 
qnoc-sc8280xp pmic_glink pmic_glink_altmode smp2p spmi-pmic-arb leds-qcom-lpg 
"'  > /etc/dracut.conf.d/x13s_modules.conf
-       echo 'add_drivers+=" nvme phy_qcom_qmp_pcie pcie-qcom-ep i2c_hid_of 
i2c_qcom_geni leds-qcom-lpg pwm_bl qrtr pmic_glink_altmode gpio_sbu_mux 
phy_qcom_qmp_combo panel-edp msm phy_qcom_edp "' >> 
/etc/dracut.conf.d/x13s_modules.conf
-       echo 'install_items+=" 
/lib/firmware/qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn.xz 
/lib/firmware/qcom/sc8280xp/LENOVO/21BX/qccdsp8280.mbn.xz "' >> 
/etc/dracut.conf.d/x13s_modules.conf
+  echo 'add_drivers+=" clk-rpmh dispcc-sc8280xp gcc-sc8280xp gpucc-sc8280xp 
nvmem_qcom-spmi-sdam qcom_hwspinlock qcom_q6v5 qcom_q6v5_pas qnoc-sc8280xp 
pmic_glink pmic_glink_altmode smp2p spmi-pmic-arb leds-qcom-lpg "' 
>/etc/dracut.conf.d/x13s_modules.conf
+  echo 'add_drivers+=" nvme phy_qcom_qmp_pcie pcie-qcom-ep i2c_hid_of 
i2c_qcom_geni leds-qcom-lpg pwm_bl qrtr pmic_glink_altmode gpio_sbu_mux 
phy_qcom_qmp_combo panel-edp msm phy_qcom_edp "' 
>>/etc/dracut.conf.d/x13s_modules.conf
+  echo 'install_items+=" 
/lib/firmware/qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn.xz 
/lib/firmware/qcom/sc8280xp/LENOVO/21BX/qccdsp8280.mbn.xz "' 
>>/etc/dracut.conf.d/x13s_modules.conf
 fi
 
 # Decompress kernel modules, better for squashfs (boo#1192457)

++++++ live-root.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/root/.mozilla/firefox/profile/user.js.template 
new/root/.mozilla/firefox/profile/user.js.template
--- old/root/.mozilla/firefox/profile/user.js.template  2026-06-24 
17:55:03.000000000 +0200
+++ new/root/.mozilla/firefox/profile/user.js.template  2026-07-14 
10:45:10.000000000 +0200
@@ -71,6 +71,9 @@
 // show time stamps in the console
 user_pref("devtools.webconsole.timestampMessages", true);
 
+// disable "Link Preview" feature
+user_pref("browser.ml.linkPreview.enabled", false);
+
 // start always in the custom homepage
 user_pref("browser.startup.page", 1);
 // custom homepage: the value is expected to be replaced with the login URL by 
the startup script
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/usr/lib/dracut/modules.d/95initrd-firstboot/module-setup.sh 
new/usr/lib/dracut/modules.d/95initrd-firstboot/module-setup.sh
--- old/usr/lib/dracut/modules.d/95initrd-firstboot/module-setup.sh     
2026-06-24 17:55:03.000000000 +0200
+++ new/usr/lib/dracut/modules.d/95initrd-firstboot/module-setup.sh     
2026-07-14 10:45:10.000000000 +0200
@@ -4,11 +4,11 @@
 
 check() {
   # always include this dracut module in the initramfs
-       return 0
+  return 0
 }
 
 depends() {
-       echo bash systemd
+  echo bash systemd
 }
 
 install() {
@@ -19,6 +19,9 @@
   # The problem is that the first boot detection fails because of the
   # complicated Live ISO setup which uses the device mapper for creating
   # writable overlay over the squashfs read-only image.
-       $SYSTEMCTL -q --root "$initdir" disable firstboot-detect.service
-       $SYSTEMCTL -q --root "$initdir" enable firstboot.target
+  $SYSTEMCTL -q --root "$initdir" disable firstboot-detect.service
+
+  # do not enable ignition/combustion by default, they can be explicitly
+  # enabled with the "rd.systemd.wants=firstboot.target" boot option
+  $SYSTEMCTL -q --root "$initdir" disable firstboot.target
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/usr/lib/dracut/modules.d/99agama-cmdline/agama-network.sh 
new/usr/lib/dracut/modules.d/99agama-cmdline/agama-network.sh
--- old/usr/lib/dracut/modules.d/99agama-cmdline/agama-network.sh       
2026-06-24 17:55:03.000000000 +0200
+++ new/usr/lib/dracut/modules.d/99agama-cmdline/agama-network.sh       
2026-07-14 10:45:10.000000000 +0200
@@ -5,7 +5,7 @@
 . /lib/dracut-lib.sh
 . /lib/net-lib.sh
 
-if _val=$(getargs ip=); then
+if getargs ip= >/dev/null || getargs rd.hcn.ip= >/dev/null || getargs 
rd.hcn.route= >/dev/null; then
   mkdir -p /run/agama/
   : >/run/agama/custom_dracut_network
 fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/usr/lib/dracut/modules.d/99agama-cmdline/save-agama-conf.sh 
new/usr/lib/dracut/modules.d/99agama-cmdline/save-agama-conf.sh
--- old/usr/lib/dracut/modules.d/99agama-cmdline/save-agama-conf.sh     
2026-06-24 17:55:03.000000000 +0200
+++ new/usr/lib/dracut/modules.d/99agama-cmdline/save-agama-conf.sh     
2026-07-14 10:45:10.000000000 +0200
@@ -20,12 +20,22 @@
     echo 'ignore-carrier=*' >>/run/NetworkManager/conf.d/00-agama-server.conf
 
     mkdir -p "$NEWROOT/etc/NetworkManager/system-connections/"
+
+    # Copy runtime connections generated by nm-initrd-generator
     for _i in /run/NetworkManager/system-connections/*; do
       [ -f "$_i" ] || continue
       grep -q 'origin=nm-initrd-generator' "$_i" 2>/dev/null || continue
 
       mv "$_i" "$NEWROOT/etc/NetworkManager/system-connections/"
     done
+
+    # Copy persistent connections (e.g., from HCN module that writes to /etc)
+    for _i in /etc/NetworkManager/system-connections/*; do
+      [ -f "$_i" ] || continue
+      grep -q 'origin=nm-initrd-generator' "$_i" 2>/dev/null || continue
+
+      cp "$_i" "$NEWROOT/etc/NetworkManager/system-connections/"
+    done
   fi
 else
   : >/run/agama/not_copy_network
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/usr/lib/dracut/modules.d/99agama-dud/agama-dud-parser.sh 
new/usr/lib/dracut/modules.d/99agama-dud/agama-dud-parser.sh
--- old/usr/lib/dracut/modules.d/99agama-dud/agama-dud-parser.sh        
2026-06-24 17:55:03.000000000 +0200
+++ new/usr/lib/dracut/modules.d/99agama-dud/agama-dud-parser.sh        
2026-07-14 10:45:10.000000000 +0200
@@ -18,7 +18,7 @@
     if grep -q -s -E -e "https?://" -e "ftps?://" -e "smbs?://" -e "scp://" 
/tmp/agamadud.info; then
       echo "rd.neednet=1" > /etc/cmdline.d/agama-generated.conf
       # use DHCP if there is no network configuration provided by user
-      if ! getarg "ip="; then
+      if ! getarg "ip=" >/dev/null && ! getarg "rd.hcn.ip=" >/dev/null; then
         echo "ip=dhcp" >> /etc/cmdline.d/agama-generated.conf
       fi
     fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/usr/lib/dracut/modules.d/99hcn/ARCHITECTURE.md 
new/usr/lib/dracut/modules.d/99hcn/ARCHITECTURE.md
--- old/usr/lib/dracut/modules.d/99hcn/ARCHITECTURE.md  1970-01-01 
01:00:00.000000000 +0100
+++ new/usr/lib/dracut/modules.d/99hcn/ARCHITECTURE.md  2026-07-14 
10:45:10.000000000 +0200
@@ -0,0 +1,451 @@
+# HCN Dracut Module Architecture
+
+This document provides the technical design and architecture for the 99hcn 
dracut module, explaining how it integrates with systemd, NetworkManager, and 
the Agama installer to provide automatic HCN network configuration during boot.
+
+## Table of Contents
+
+1. [Overview](#overview)
+2. [Key Architecture Principles](#key-architecture-principles)
+3. [Boot-Time Integration & Component 
Diagram](#boot-time-integration--component-diagram)
+4. [Sequential Boot Process](#sequential-boot-process)
+5. [HCN-Specific Boot Parameters](#hcn-specific-boot-parameters)
+6. [Parameter Transformation Flow](#parameter-transformation-flow)
+7. [Profile Generation and Adaptation](#profile-generation-and-adaptation)
+8. [Two-Stage Persistence Architecture](#two-stage-persistence-architecture)
+9. [Future Considerations](#future-considerations)
+
+## Overview
+
+The 99hcn dracut module provides automatic network configuration for IBM 
PowerVM Hybrid Cloud Network (HCN) during the initramfs phase of boot. It 
integrates with systemd and NetworkManager to discover HCN devices, create 
bonded interfaces, and generate NetworkManager connection profiles that persist 
to the installed system for runtime management by `hcnmgr`.
+
+**Core Responsibilities:**
+
+1. Parse HCN-specific kernel parameters (`rd.hcn.ip`, `rd.hcn.route`)
+2. Discover HCN device pairs via `/proc/device-tree` properties
+3. Transform HCN parameters into bond-targeted standard dracut parameters
+4. Generate NetworkManager connection profiles via `nm-initrd-generator`
+5. Adapt profiles for `hcnmgr` daemon compatibility
+6. Persist profiles across initramfs and into the installed system
+
+## Key Architecture Principles
+
+1. **Systemd Conditional Activation**: The `hcn-init-initrd.service` uses 
systemd `ConditionKernelCommandLine` directives to activate only when:
+   - `rd.hcn=1` is present, OR
+   - `rd.hcn.ip` is present, OR
+   - `rd.hcn.route` is present
+   - AND `rd.hcn=0` is NOT present (explicit disable)
+
+2. **Two-Stage Persistence**:
+   - **Stage 1 (HCN module)**: Generates and fixes up connections in 
`/run/hcn/system-connections/`, then copies them to 
`/etc/NetworkManager/system-connections/` for initramfs persistence.
+   - **Stage 2 (Agama module)**: Before pivoting to the installed system, 
`save-agama-conf.sh` copies connections from 
`/etc/NetworkManager/system-connections/` (with `origin=nm-initrd-generator`) 
to the target system's `/etc/NetworkManager/system-connections/`.
+
+3. **Isolated Profile Generation**: Uses a custom output directory 
(`/run/hcn/system-connections/`) instead of the standard 
`/run/NetworkManager/system-connections/` to prevent conflicts during profile 
generation and adaptation.
+
+4. **No Cmdline Pollution**: Transformed parameters are passed directly to 
`nm-initrd-generator` as command-line arguments, never written to 
`/etc/cmdline.d/`, preventing other dracut modules from reading them and 
regenerating incompatible profiles.
+
+5. **Timing-Aware Orchestration**: Two-phase execution (cmdline hook + systemd 
service) handles the fact that HCN devices may not be available when kernel 
command line parsing runs.
+
+## Boot-Time Integration & Component Diagram
+
+The following diagram details the control and configuration flow from the 
initial kernel/logging and early cmdline phase down to NetworkManager 
activation. It showcases how the execution path adapts dynamically to both 
standard and HCN boots, highlighting differences between Tumbleweed 
(NetworkManager >= 1.54) and SLES 16.1 (NetworkManager < 1.54).
+
+```text
+                                HARDWARE / HYPERVISOR (PowerVM)
++-------------------------------------------------------------------------------------------------+
+|                                                                              
                   |
+|   +---------------------------------------+           
+-------------------------------------+   |
+|   |          PCI SR-IOV Ethernet          |           |            Virtual 
NIC (vnic)       |   |
+|   |  - Property: ibm,hcn-id = <hcn-id>    |           |   - Property: 
ibm,hcn-id = <hcn-id> |   |
+|   |  - Property: ibm,hcn-mode = "primary" |           |   - Property: 
ibm,hcn-mode = "backup"|  |
+|   |  - local-mac-address = <MAC_A>        |           |   - 
local-mac-address = <MAC_B>     |   |
+|   +-------------------+-------------------+           
+------------------+------------------+   |
++-----------------------|--------------------------------------------------|----------------------+
+                        |                                                  |
+                        v                                                  v
+             /proc/device-tree/pci*/ethernet*                    
/proc/device-tree/vdevice/vnic*
+                        |                                                  |
+===================================================================================================
+                                           INITRD PHASE
+===================================================================================================
+                                                |
+                                                v
++-------------------------------------------------------------------------------------------------+
+|  1. EARLY CMDLINE & LOGGING PHASE (`dracut-cmdline.service`)                 
                   |
+|     - Runs early cmdline hook: `/lib/dracut/hooks/cmdline/99-nm-config.sh`   
                   |
+|     - Standard NetworkManager connection generation proceeds normally.       
                   |
+|                                                                              
                   |
+|     SLES 16.1 (NM < 1.54):                                                   
                   |
+|     - `nm-config.sh` executes `nm_generate_connections` normally.            
                   |
+|                                                                              
                   |
+|     Tumbleweed (NM >= 1.54):                                                 
                   |
+|     - No generation in cmdline hook (delegated to systemd service).          
                   |
++-------------------------------------------------------------------------------------------------+
+                                                |
+                                                v
++-------------------------------------------------------------------------------------------------+
+|  1.5 NETWORK GENERATION SERVICE PHASE (Tumbleweed Only)                      
                   |
+|     Runs `NetworkManager-config-initrd.service` (Before 
`systemd-udevd.service`):               |
+|     - RUNS standard `nm-initrd-generator` normally.                          
                   |
++-------------------------------------------------------------------------------------------------+
+                                                |
+                                                v
++-------------------------------------------------------------------------------------------------+
+|  2. KERNEL & UDEV DISCOVERY (`systemd-udev-trigger.service`)                 
                   |
+|     - Drivers bind to physical/virtual devices.                              
                   |
+|     - Interfaces appear in sysfs: e.g. /sys/class/net/enP32775p1s0 and 
/sys/class/net/env6      |
++-----------------------------------------------+-------------------------------------------------+
+                                                |
+                                                v
++-----------------------------------------------+-------------------------------------------------+
+|  3. HCN BOND CONFIGURATION SERVICE PHASE                                     
                   |
+|     `hcn-init-initrd.service` (Runs `/usr/bin/parse-hcn` after udev 
discovery):                |
+|     - Activates when any of: rd.hcn=1, rd.hcn.ip, or rd.hcn.route is present 
                   |
+|     - If none are present: Exits early (no-op).                              
                   |
+|     - If HCN is enabled:                                                     
                   |
+|       * Discovers HCN devices from /proc/device-tree (PCI SR-IOV and VNIC 
adapters)            |
+|       * Compiles bond mapping: `bond333e80f5 -> [enP32775p1s0, env6]` with 
modes and MACs      |
+|       * Reads `rd.hcn.ip` and `rd.hcn.route` params and transforms them to 
bond-targeted        |
+|         `bond=`, `ip=`, and `rd.route=` options.                             
                   |
+|       * Calls `nm-initrd-generator` DIRECTLY with `-c 
/run/hcn/system-connections` (does NOT   |
+|         write to `/etc/cmdline.d/` to prevent future regeneration).          
                   |
+|       * Performs interface profile fixups for hcnmgr compatibility in 
`/run/hcn/system-         |
+|         connections/` (bond naming, controller references, UUIDs, etc.).     
                   |
+|       * Copies adapted profiles to `/etc/NetworkManager/system-connections/` 
for persistence.   |
++-----------------------------------------------+-------------------------------------------------+
+                                                |
+                                                v
++-----------------------------------------------+-------------------------------------------------+
+|  4. NETWORK MANAGER ACTIVATION                                               
                   |
+|     - Brings up connection profiles (either standard or bond).               
                   |
+|                                                                              
                   |
+|     A. Tumbleweed (NM >= 1.54): `NetworkManager-initrd.service`              
                   |
+|     B. SLES 16.1 (NM < 1.54): `nm-initrd.service`                            
                   |
++-------------------------------------------------------------------------------------------------+
+```
+
+## Sequential Boot Process
+
+1. **Kernel Initialization & Initramfs Mount**:
+   The kernel mounts the initramfs. Systemd starts as PID 1 
(`/usr/lib/systemd/systemd`).
+
+2. **Early Cmdline & Discovery Phase (`dracut-cmdline.service`)**:
+   - `dracut-cmdline` processes all command line hooks, including 
`/lib/dracut/hooks/cmdline/99-nm-config.sh`.
+   - Standard NetworkManager connection generation proceeds normally:
+     - **SLES 16.1 (NetworkManager < 1.54):** `99-nm-config.sh` calls 
`nm_generate_connections` to generate standard connection profiles.
+     - **Tumbleweed (NetworkManager >= 1.54):** `99-nm-config.sh` does not 
call `nm_generate_connections` (which is delegated to a systemd service).
+
+2.5. **Network Generation Service Phase (Tumbleweed with NetworkManager >= 
1.54 Only)**:
+
+- **`NetworkManager-config-initrd.service`** runs (ordered 
`Before=systemd-udevd.service` and `systemd-udev-trigger.service`).
+- It runs standard `nm-initrd-generator` normally to generate connection 
profiles based on kernel arguments.
+
+1. **Udev Device Discovery**:
+   - `systemd-udevd.service` starts and triggers hardware udev events via 
`systemd-udev-trigger.service`.
+   - Network interfaces (physical/virtual) are discovered and matching kernel 
drivers are loaded.
+   - Network device nodes (e.g. `enP32775p1s0`, `env6`) are created under 
`/sys/class/net/`.
+
+2. **Network Generator Orchestration**:
+   - **`hcn-init-initrd.service`** starts (ordered 
`After=systemd-udev-trigger.service` and `Before=dracut-initqueue.service 
nm-initrd.service NetworkManager-initrd.service`). It activates when any of 
these kernel command line parameters are present: `rd.hcn=1`, `rd.hcn.ip`, or 
`rd.hcn.route`.
+     - **If none of these parameters are present:** Service does not start 
(systemd conditions prevent execution).
+     - **If any HCN parameter is present:**
+       - `/usr/bin/parse-hcn` performs discovery in `/proc/device-tree` to 
pair adapters sharing an `ibm,hcn-id`.
+       - For each device, it waits up to 3 minutes for the interface to appear 
after potential migration events.
+       - It reads the HCN-specific kernel command line options `rd.hcn.ip` and 
`rd.hcn.route` and translates them to target the planned bond interface (e.g. 
`bond333e80f5`).
+       - It calls the standard `nm-initrd-generator` **directly** with 
transformed parameters as command-line arguments and custom output directory 
`-c /run/hcn/system-connections`.
+       - It adapts the generated NetworkManager profiles for compatibility 
with `hcnmgr` daemon (bond naming, controller references, UUIDs).
+       - The adapted profiles are copied to 
`/etc/NetworkManager/system-connections/` for persistence across reboots.
+
+3. **Network Interface Activation (NetworkManager)**:
+   - The appropriate activation service starts:
+     - **Tumbleweed (NetworkManager >= 1.54):** 
`NetworkManager-initrd.service` starts.
+     - **SLES 16.1 (NetworkManager < 1.54):** `nm-initrd.service` starts.
+   - It reads from `/etc/NetworkManager/system-connections/` (HCN connections) 
and `/run/NetworkManager/system-connections/` (standard connections).
+   - **HCN Active Path:** Creates the bond interface, binds the port 
interfaces, and applies IP and routing configurations. Connection profiles are 
structured for `hcnmgr` compatibility.
+   - **HCN Inactive / Fallback Path:** Configures and starts standard 
independent interfaces according to standard `ip=` and `rd.route=` parameters.
+
+4. **Agama Module Integration (Before Pivot)**:
+   - Before pivoting to the installed system, the `99agama-cmdline` module's 
`save-agama-conf.sh` script executes.
+   - If `inst.copy_network` is enabled (default) and custom network 
configuration is detected:
+     - Copies runtime connections from 
`/run/NetworkManager/system-connections/` with `origin=nm-initrd-generator` to 
the installed system.
+     - **Copies persistent HCN connections** from 
`/etc/NetworkManager/system-connections/` with `origin=nm-initrd-generator` to 
the installed system.
+     - This ensures HCN bond configurations persist into the installed system 
for `hcnmgr` daemon to manage.
+
+## HCN-Specific Boot Parameters
+
+### Why Not Transform Standard `ip=` Options?
+
+The HCN dracut module introduces dedicated boot parameters `rd.hcn.ip` and 
`rd.hcn.route` instead of transforming standard `ip=` and `rd.route=` kernel 
command line options. This design decision addresses several critical 
architectural concerns:
+
+1. **Kernel Command Line Immutability:**
+   - `/proc/cmdline` is **read-only** and cannot be modified at runtime
+   - We cannot append or transform parameters into `/proc/cmdline` after the 
kernel starts
+   - Even if we could modify it, other dracut modules have already cached its 
contents during early boot
+
+2. **Two-Phase Configuration Process:**
+   - **Phase 1 (Boot-time):** The `parse-hcn.sh` script transforms `rd.hcn.ip` 
and `rd.hcn.route` parameters into a combination of `bond=`, `ip=`, and 
`rd.route=` options with the appropriate bond interface name (e.g., 
`bond333e80f5`).
+   - **Phase 2 (Profile Adaptation):** The generated NetworkManager connection 
profiles must be adapted to ensure compatibility with the `hcnmgr` daemon, 
which manages bond interfaces dynamically during the installed system's 
lifecycle (e.g., during Live Partition Migration).
+3. **Module Regeneration Risk:**
+   If another dracut module or NetworkManager tool regenerates network 
configuration after the initial HCN setup, using standard `ip=` parameters 
would cause those tools to generate incompatible connection profiles that would 
lack proper bond configuration and break HCN functionality.
+
+4. **Compatibility with `hcnmgr`:**
+   The `hcnmgr` daemon expects specific bond naming conventions and connection 
structure:
+   - Bond interfaces follow the `bondXXXXXXXX` naming pattern (where XXXXXXXX 
is derived from the HCN ID)
+   - Connection profiles include proper controller/port relationships with 
correct naming
+   - UUIDs and connection metadata are structured for `hcnmgr` runtime 
management
+   - Bond options (mode, fail_over_mac, miimon, primary) are set according to 
HCN requirements
+
+### Parameter Syntax
+
+- **`rd.hcn.ip=<value>`**: Specifies IP configuration for the HCN bond 
interface. The syntax mirrors the standard `ip=` parameter but **omits the 
interface name** (since the bond name is derived from the HCN ID).
+
+  Format: `rd.hcn.ip=<client-IP>::<gateway>:<netmask>:::<method>`
+
+  Example: `rd.hcn.ip=192.168.1.10::192.168.1.1:255.255.255.0:::none`
+
+- **`rd.hcn.route=<value>`**: Specifies routing configuration for the HCN bond 
interface. The syntax mirrors the standard `rd.route=` parameter but **omits 
the interface name**.
+
+  Format: `rd.hcn.route=<network>/<prefix>:<gateway>`
+
+  Example: `rd.hcn.route=192.168.1.0/24:192.168.1.1`
+
+- **`rd.hcn=1`**: Explicitly enables HCN configuration. **Note:** This 
parameter is optional and redundant when `rd.hcn.ip` or `rd.hcn.route` is 
present.
+
+**Important:** The interface name is intentionally omitted from both 
`rd.hcn.ip` and `rd.hcn.route` parameters because:
+
+- The bond interface name is automatically derived from the HCN ID discovered 
in `/proc/device-tree`
+- This ensures the bond name always matches `hcnmgr` expectations
+- Prevents user error in specifying incorrect bond names
+
+## Parameter Transformation Flow
+
+### Complete Boot Command Line Example
+
+**User provides (on kernel command line or in Grub configuration):**
+
+```
+rd.hcn.ip=192.168.1.10::192.168.1.1:255.255.255.0:::none 
rd.hcn.route=192.168.1.0/24:192.168.1.1
+```
+
+This configuration:
+
+- Configures the HCN bond with static IP 192.168.1.10, gateway 192.168.1.1, 
and netmask 255.255.255.0
+- Adds a route to the 192.168.1.0/24 network via 192.168.1.1
+- **Note:** Interface name is intentionally omitted from `rd.hcn.ip` and 
`rd.hcn.route`
+
+**The `parse-hcn.sh` script transforms this into (example for HCN ID 
`333e80f5`):**
+
+Passed directly as arguments to `nm-initrd-generator`:
+
+```bash
+nm-initrd-generator -- \
+  
bond=bond333e80f5:enP32775p1s0,env6:mode=active-backup,fail_over_mac=2,miimon=100,primary=enP32775p1s0
 \
+  ip=192.168.1.10::192.168.1.1:255.255.255.0::bond333e80f5:none \
+  rd.route=192.168.1.0/24:192.168.1.1:bond333e80f5
+```
+
+Where:
+
+- `bond333e80f5` is derived from HCN ID `333e80f5` discovered in 
`/proc/device-tree`
+- `enP32775p1s0` is the primary SR-IOV interface (discovered via `ibm,hcn-mode 
= "primary"`)
+- `env6` is the backup virtual NIC interface (discovered via `ibm,hcn-mode = 
"backup"`)
+- Both interfaces share the same `ibm,hcn-id = 333e80f5` property
+- Bond options are hardcoded for HCN requirements:
+  - `mode=active-backup`: Only one port is active at a time
+  - `fail_over_mac=2`: Follow the selection of the active port
+  - `miimon=100`: Monitor link status every 100ms
+  - `primary=enP32775p1s0`: Prefer the SR-IOV interface as primary
+
+**These transformed parameters are:**
+
+1. Passed **directly** to `nm-initrd-generator` as command-line arguments (NOT 
written to `/etc/cmdline.d/`)
+2. Output directed to isolated directory: `-c /run/hcn/system-connections`
+3. Used by `nm-initrd-generator` to create initial NetworkManager connection 
profiles
+4. Adapted by `fixup_nm_connections()` to ensure `hcnmgr` daemon compatibility
+5. Copied to `/etc/NetworkManager/system-connections/` for persistence across 
reboots
+6. Activated by NetworkManager which reads from 
`/etc/NetworkManager/system-connections/`
+
+### Three-Layer Protection Strategy
+
+The HCN module employs a comprehensive protection strategy to ensure 
`hcnmgr`-compatible profiles survive across boot stages and prevent 
regeneration by other modules:
+
+1. **Layer 1 - Prevent Regeneration Trigger:**
+   - Only the HCN module understands `rd.hcn.*` parameters
+   - Transformed parameters are **never written to `/etc/cmdline.d/`**
+   - Passed directly to `nm-initrd-generator` as command-line arguments only
+   - Other modules have no transformed parameters to misinterpret
+
+2. **Layer 2 - Isolated Generation:**
+   - Uses custom output directory: `-c /run/hcn/system-connections`
+   - Prevents conflicts with standard `/run/NetworkManager/system-connections/`
+   - Allows safe adaptation before making profiles visible to NetworkManager
+
+3. **Layer 3 - Persistent Storage:**
+   - Copies adapted profiles to `/etc/NetworkManager/system-connections/`
+   - Survives reboots (unlike `/run` which is tmpfs)
+   - Protects against other modules that might `rm 
/run/NetworkManager/system-connections/*`
+   - NetworkManager reads persistent profiles, ensuring HCN configuration 
survives
+
+**Key Insight:** The dedicated parameters (`rd.hcn.ip`, `rd.hcn.route`) aren't 
just about syntax—they're about **protecting the two-phase transformation 
workflow** through isolated generation, persistent storage, and preventing 
regeneration triggers.
+
+## Profile Generation and Adaptation
+
+### High-Level Profile Structure
+
+Generated NetworkManager profiles require modifications for `hcnmgr` 
compatibility:
+
+**Bond Profile Adaptations:**
+
+- Rename from `bond-bond<hcn-id>.nmconnection` to `bond<hcn-id>.nmconnection`
+- Update connection ID to match filename
+- Generate deterministic UUID based on bond name
+- Ensure `origin=nm-initrd-generator` marker for persistence
+
+**Port Profile Adaptations:**
+
+- Update controller references to match new bond profile name
+- Maintain proper controller/port relationships
+- Preserve MAC address bindings
+
+### Bond Configuration Structure
+
+The bond interface is created with the following NetworkManager profile 
structure:
+
+```ini
+[connection]
+id=bond333e80f5
+uuid=<deterministic-uuid>
+type=bond
+interface-name=bond333e80f5
+origin=nm-initrd-generator
+
+[bond]
+mode=active-backup
+fail_over_mac=2
+miimon=100
+primary=enP32775p1s0
+
+[ipv4]
+method=manual
+address1=192.168.1.10/24,192.168.1.1
+route1=192.168.1.0/24,192.168.1.1
+```
+
+Port profiles reference this bond:
+
+```ini
+[connection]
+id=bond333e80f5-enP32775p1s0
+uuid=<generated-uuid>
+type=ethernet
+interface-name=enP32775p1s0
+controller=bond333e80f5
+port-type=bond
+origin=nm-initrd-generator
+
+[ethernet]
+mac-address=<discovered-mac>
+```
+
+## Two-Stage Persistence Architecture
+
+### Stage 1: Initramfs Persistence (HCN Module)
+
+**Location:** `/etc/NetworkManager/system-connections/`
+
+**Purpose:** Make profiles available to NetworkManager during initramfs and 
protect against module regeneration
+
+**Flow:**
+
+1. `parse-hcn.sh` generates profiles in `/run/hcn/system-connections/`
+2. Profiles are adapted for `hcnmgr` compatibility (fixup process)
+3. Adapted profiles are copied to `/etc/NetworkManager/system-connections/`
+4. NetworkManager reads from `/etc/NetworkManager/system-connections/` and 
activates the bond
+
+**Protection mechanisms:**
+
+- `/etc` persists across dracut module execution (unlike `/run` which modules 
may clear)
+- Other dracut modules don't know about `/run/hcn/system-connections/` 
(isolated generation)
+- No transformed parameters in `/etc/cmdline.d/` prevents other modules from 
regenerating
+
+### Stage 2: Installed System Persistence (Agama Module)
+
+**Location:** Target system's `/etc/NetworkManager/system-connections/`
+
+**Purpose:** Make HCN profiles available in the installed system for `hcnmgr` 
daemon
+
+**Flow:**
+
+1. Agama's `save-agama-conf.sh` runs before system pivot
+2. Scans `/etc/NetworkManager/system-connections/` for profiles with 
`origin=nm-initrd-generator`
+3. Copies matching profiles to installed system's 
`/etc/NetworkManager/system-connections/`
+4. After boot into installed system, `hcnmgr` daemon manages the bond profiles
+
+**Integration points:**
+
+- `inst.copy_network` kernel parameter enables copying (default: enabled)
+- `/run/agama/custom_dracut_network` marker file indicates custom network 
configuration
+- Agama copies profiles with proper permissions and SELinux contexts
+
+## Future Considerations
+
+### Potential Enhancements
+
+1. **IPv6 Support:**
+   - IPv6 static addressing should work (same parameter format)
+   - IPv6 autoconfiguration needs testing: `rd.hcn.ip=auto6`
+   - Multiple IPv6 addresses per bond
+
+2. **Configurable Bond Options:**
+   - Currently hardcoded: `mode=active-backup fail_over_mac=2 miimon=100`
+   - Could expose via `rd.hcn.bond_options=...`
+   - Requires validation against `hcnmgr` expectations
+
+3. **DNS Configuration:**
+   - Current `ip=` format supports nameserver (8th field)
+   - Example: 
`rd.hcn.ip=192.168.1.10::192.168.1.1:255.255.255.0:::none:8.8.8.8`
+   - Needs testing and documentation
+
+4. **VLAN Support:**
+   - HCN bonds may carry VLAN-tagged traffic
+   - Requires additional parameter: `rd.hcn.vlan=<vlan-id>`
+   - Profile generation for VLAN interfaces on top of bond
+
+5. **Configurable Timeout:**
+   - Current 180-second timeout may be insufficient on slow hardware or during 
complex LPM
+   - Consider: `rd.hcn.timeout=300`
+
+### Known Limitations
+
+1. **Timing Sensitivity:**
+   - 180-second timeout may be insufficient in rare cases
+   - No retry mechanism for transient device-tree reading errors
+
+2. **Error Reporting:**
+   - Failures may be silent if systemd journal is not checked
+   - Consider using `dracut-emergency` for fatal errors
+   - Could add visual indicators (Plymouth messages)
+
+3. **Profile Compatibility:**
+   - Assumes `hcnmgr` naming conventions remain stable
+   - Breaking changes in `hcnmgr` may require profile fixup updates
+   - No version detection or compatibility checking
+
+4. **Single-Bond Assumption in Simple Cases:**
+   - When no MAC address is specified, first discovered HCN ID is used
+   - May be unexpected on multi-bond systems
+
+### Maintenance Considerations
+
+- **Dracut API Stability:** Module relies on dracut hook conventions (cmdline 
phase, systemd service ordering)
+- **NetworkManager Compatibility:** Profile format changes between 
NetworkManager versions may require fixup updates
+- **hcnmgr Evolution:** Monitor `hcnmgr` for changes to profile format 
expectations, bond naming, or UUID structure
+- **Kernel Parameter Namespace:** `rd.hcn.*` namespace should be coordinated 
with upstream dracut to avoid conflicts
+
+---
+
+## References
+
+- [dracut-ng documentation](https://dracut-ng.github.io/)
+- [NetworkManager 
nm-initrd-generator](https://networkmanager.dev/docs/api/latest/nm-initrd-generator.html)
+- IBM PowerVM HCN documentation
+- `hcnmgr` source code and runtime bond management
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/usr/lib/dracut/modules.d/99hcn/hcn-init-initrd.service 
new/usr/lib/dracut/modules.d/99hcn/hcn-init-initrd.service
--- old/usr/lib/dracut/modules.d/99hcn/hcn-init-initrd.service  1970-01-01 
01:00:00.000000000 +0100
+++ new/usr/lib/dracut/modules.d/99hcn/hcn-init-initrd.service  2026-07-14 
10:45:10.000000000 +0200
@@ -0,0 +1,23 @@
+[Unit]
+Description=Hybrid Cloud Network config for NetworkManager (initrd)
+DefaultDependencies=no
+Wants=systemd-udev-trigger.service
+After=systemd-udev-trigger.service
+Before=dracut-initqueue.service nm-initrd.service NetworkManager-initrd.service
+ConditionPathExists=/etc/initrd-release
+ConditionPathExists=/proc/device-tree
+ConditionKernelCommandLine=!rd.hcn=0
+ConditionKernelCommandLine=|rd.hcn=1
+ConditionKernelCommandLine=|rd.hcn.ip
+ConditionKernelCommandLine=|rd.hcn.route
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/parse-hcn
+SyslogIdentifier=hcn-init-initrd
+StandardOutput=journal+console
+StandardError=journal+console
+RemainAfterExit=yes
+
+[Install]
+WantedBy=initrd.target
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/usr/lib/dracut/modules.d/99hcn/module-setup.sh 
new/usr/lib/dracut/modules.d/99hcn/module-setup.sh
--- old/usr/lib/dracut/modules.d/99hcn/module-setup.sh  1970-01-01 
01:00:00.000000000 +0100
+++ new/usr/lib/dracut/modules.d/99hcn/module-setup.sh  2026-07-14 
10:45:10.000000000 +0200
@@ -0,0 +1,24 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+check() {
+    local _arch=${DRACUT_ARCH:-$(uname -m)}
+    [[ "$_arch" = "ppc64" ]] || [[ "$_arch" = "ppc64le" ]] || return 1
+
+    require_binaries hexdump ofpathname pseries_platform awk mkdir mv sed 
sleep tr || return 1
+
+    return 255
+}
+
+depends() {
+    echo network-manager
+    return 0
+}
+
+install() {
+    inst_multiple hexdump ofpathname pseries_platform awk mkdir mv sed sleep tr
+
+    inst_script "$moddir/parse-hcn.sh" /usr/bin/parse-hcn
+    inst_simple "$moddir/hcn-init-initrd.service" 
"${systemdsystemunitdir}/hcn-init-initrd.service"
+    $SYSTEMCTL -q --root "$initdir" enable hcn-init-initrd.service
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/usr/lib/dracut/modules.d/99hcn/parse-hcn.sh 
new/usr/lib/dracut/modules.d/99hcn/parse-hcn.sh
--- old/usr/lib/dracut/modules.d/99hcn/parse-hcn.sh     1970-01-01 
01:00:00.000000000 +0100
+++ new/usr/lib/dracut/modules.d/99hcn/parse-hcn.sh     2026-07-14 
10:45:10.000000000 +0200
@@ -0,0 +1,520 @@
+#!/bin/sh
+
+# HCN (Hybrid Cloud Network) dracut module
+# Discovers HCN configurations from device-tree and sets up bonding
+#
+# Workflow:
+# 1. Check if HCN is enabled (rd.hcn=1, rd.hcn.ip, or rd.hcn.route), exit 
early if not
+# 2. Discover HCN devices from device-tree (/proc/device-tree)
+#    - Scans PCI devices (SR-IOV ethernet adapters)
+#    - Scans vdevices (VNIC and Virtual Ethernet)
+# 3. Build MAPPINGS: bond names -> slave devices with MACs and modes
+# 4. Process rd.hcn.ip= and rd.hcn.route= parameters and replace slave 
references with bonds
+# 5. Generate NetworkManager connections to a temporary directory via 
nm-initrd-generator
+# 6. Fix up generated connections to use correct bond masters and naming
+# 7. Copy connections to /etc/NetworkManager/system-connections for persistence
+#
+# Usage:
+#   rd.hcn=1              - Create bond connections only (no IP configuration)
+#   rd.hcn.ip=<config>    - Create bonds with HCN-specific IP configuration
+#   rd.hcn.route=<config> - Create bonds with HCN-specific route configuration
+
+command -v getargs >/dev/null || . /lib/dracut-lib.sh
+
+# Helper to read 4 bytes from device-tree and return hex string
+xdump4() {
+  hexdump -n 4 -ve '/1 "%02x"' "$1"
+}
+
+# Helper to get MAC address from device-tree
+get_mac() {
+  local dev=$1
+  if [ -f "$dev/local-mac-address" ]; then
+    hexdump -ve '/1 "%02x:"' "$dev/local-mac-address" | sed 's/:$//'
+  fi
+}
+
+# Function to discover HCN mapping for a device-tree node
+get_dev_hcn() {
+  local dev=$1
+  local hcnid devname mode mac ofpath
+  # Wait up to 3 minutes for device to appear after migration (12 * 15s)
+  local wait=12
+
+  hcnid=$(xdump4 "$dev/ibm,hcn-id")
+  [ -z "$hcnid" ] && return 1
+
+  mode=$(tr -d '\0' <"$dev/ibm,hcn-mode" 2>/dev/null)
+  ofpath=${dev#/proc/device-tree}
+
+  # Wait for device to appear in sysfs. This might take time after migration.
+  while [ $wait -gt 0 ]; do
+    if devname=$(ofpathname -l "$ofpath" 2>/dev/null) && [ -e 
"/sys/class/net/$devname" ]; then
+      info "parse-hcn: device $devname ready for $ofpath"
+      mac=$(get_mac "$dev")
+      break
+    fi
+    info "parse-hcn: waiting for device for $ofpath (retry $wait)"
+    sleep 15
+    wait=$((wait - 1))
+  done
+
+  if [ -z "$devname" ]; then
+    warn "parse-hcn: could not resolve device name for $dev"
+    return 1
+  fi
+
+  # Output the bond mapping: bondname devname mac mode
+  echo "bond$hcnid $devname ${mac:-none} ${mode:-none}"
+  return 0
+}
+
+# Get a value from a keyfile (INI format)
+# Usage: gkeyfile_get <file> <section> <key>
+gkeyfile_get() {
+  awk -v sec="$2" -v key="$3" '
+    $0 ~ "^[[:space:]]*\\[.*\\][[:space:]]*$" {
+      current_sec = $0
+      gsub(/^[[:space:]]+|[[:space:]]+$/, "", current_sec)
+      current_sec = substr(current_sec, 2, length(current_sec) - 2)
+      in_sec = (current_sec == sec)
+    }
+    in_sec {
+      idx = index($0, "=")
+      if (idx > 0) {
+        k = substr($0, 1, idx - 1)
+        gsub(/^[[:space:]]+|[[:space:]]+$/, "", k)
+        if (k == key) {
+          val = substr($0, idx + 1)
+          gsub(/^[[:space:]]+|[[:space:]]+$|"/, "", val)
+          print val
+          exit
+        }
+      }
+    }
+  ' "$1"
+}
+
+# Check if a key exists in a keyfile (INI format)
+# Usage: gkeyfile_has <file> <section> <key>
+gkeyfile_has() {
+  awk -v sec="$2" -v key="$3" '
+    $0 ~ "^[[:space:]]*\\[.*\\][[:space:]]*$" {
+      current_sec = $0
+      gsub(/^[[:space:]]+|[[:space:]]+$/, "", current_sec)
+      current_sec = substr(current_sec, 2, length(current_sec) - 2)
+      in_sec = (current_sec == sec)
+    }
+    in_sec {
+      idx = index($0, "=")
+      if (idx > 0) {
+        k = substr($0, 1, idx - 1)
+        gsub(/^[[:space:]]+|[[:space:]]+$/, "", k)
+        if (k == key) {
+          found = 1
+          exit
+        }
+      }
+    }
+    END { exit !found }
+  ' "$1"
+}
+
+# Set a value in a keyfile (INI format)
+# Usage: gkeyfile_set <file> <section> <key> <val>
+gkeyfile_set() {
+  if gkeyfile_has "$1" "$2" "$3"; then
+    sed -i "/^\[$2\]/,/^\[/ 
s|^\([[:space:]]*$3[[:space:]]*=[[:space:]]*\).*|\1$4|" "$1"
+  else
+    sed -i "/^\[$2\]/a $3=$4" "$1"
+  fi
+}
+
+# Parse a NetworkManager connection file and extract key fields
+# Returns: id|uuid|ifname|master|controller|mac (pipe-separated)
+parse_nm_connection() {
+  awk -F'=' '
+        /^[[:space:]]*id[[:space:]]*=/ {
+            gsub(/^[[:space:]]+|[[:space:]]+$|"/, "", $2)
+            id = $2
+        }
+        /^[[:space:]]*uuid[[:space:]]*=/ {
+            gsub(/^[[:space:]]+|[[:space:]]+$|"/, "", $2)
+            uuid = $2
+        }
+        /^[[:space:]]*interface-name[[:space:]]*=/ {
+            gsub(/^[[:space:]]+|[[:space:]]+$|"/, "", $2)
+            ifname = $2
+        }
+        /^[[:space:]]*master[[:space:]]*=/ {
+            gsub(/^[[:space:]]+|[[:space:]]+$|"/, "", $2)
+            master = $2
+        }
+        /^[[:space:]]*controller[[:space:]]*=/ {
+            gsub(/^[[:space:]]+|[[:space:]]+$|"/, "", $2)
+            controller = $2
+        }
+        /^[[:space:]]*mac-address[[:space:]]*=/ {
+            gsub(/^[[:space:]]+|[[:space:]]+$|:|"/, "", $2)
+            mac = tolower($2)
+        }
+        END {
+            print id "|" uuid "|" ifname "|" master "|" controller "|" mac
+        }
+    ' "$1"
+}
+
+# Function to fix up NetworkManager connection files
+#
+# IMPORTANT: This function should ONLY be called when rd.hcn=1 is set
+#
+# nm-initrd-generator creates connections with:
+#   - Interface names as connection IDs (e.g., "eth0")
+#   - UUIDs as master/controller references instead of bond names
+#   - Generic interface-name settings
+#
+# We need to transform these to:
+#   - Bond-based connection IDs (e.g., "bond0-eth0")
+#   - Bond names as master/controller references (e.g., "bond0")
+#   - Correct slave-type/port-type set to 'bond'
+#   - Match slaves to correct bonds based on MAPPINGS
+#
+# This function only modifies connections that are related to HCN bonds
+# (either bond interfaces themselves or slaves found in MAPPINGS)
+fixup_nm_connections() {
+  local conn_dir="${HCN_RUNTIME_CONN_DIR:-$NM_RUNTIME_CONN_DIR}"
+  [ -d "$conn_dir" ] || return 0
+
+  local con id uuid ifname master controller mac uuid_map map
+  local found_master found_ifname mapping_info new_id
+
+  # First pass: build UUID to ID mapping for resolution
+  for con in "$conn_dir"/*.nmconnection; do
+    [ -e "$con" ] || continue
+    IFS='|' read -r id uuid ifname master controller mac <<EOF
+$(parse_nm_connection "$con")
+EOF
+    [ -n "$uuid" ] && [ -n "$id" ] && uuid_map="$uuid_map $uuid:$id"
+  done
+
+  # Second pass: fixup files (only those related to HCN bonds)
+  for con in "$conn_dir"/*.nmconnection; do
+    [ -e "$con" ] || continue
+
+    # Extract connection details
+    IFS='|' read -r id uuid ifname master controller mac <<EOF
+$(parse_nm_connection "$con")
+EOF
+
+    # Guard: Ensure we have at least id and uuid
+    if [ -z "$id" ] || [ -z "$uuid" ]; then
+      info "parse-hcn: skipping invalid connection file $con"
+      continue
+    fi
+
+    # Resolve UUIDs to names for master/controller
+    for map in $uuid_map; do
+      if [ "$master" = "${map%:*}" ]; then
+        master=${map#*:}
+        gkeyfile_set "$con" connection master "$master"
+      elif [ "$controller" = "${map%:*}" ]; then
+        controller=${map#*:}
+        gkeyfile_set "$con" connection controller "$controller"
+      fi
+    done
+
+    # Fallback if interface-name is missing
+    [ -z "$ifname" ] && ifname="$id"
+
+    # Search MAPPINGS for this connection to find the correct master
+    # Only connections in MAPPINGS or with HCN bond masters will be modified
+    mapping_info=$(echo "$MAPPINGS" | awk -v iface="$ifname" -v mac="$mac" '
+            {
+                for (i=1; i<=NF; i+=4) {
+                    m_bond = $(i)
+                    m_iface = $(i+1)
+                    m_mac = $(i+2)
+                    gsub(/:/, "", m_mac)
+                    m_mac = tolower(m_mac)
+                    if ((iface != "" && m_iface == iface) || (mac != "" && 
m_mac == mac)) {
+                        print m_bond, m_iface
+                        exit
+                    }
+                }
+            }
+        ')
+
+    if [ -n "$mapping_info" ]; then
+      found_master=${mapping_info% *}
+      found_ifname=${mapping_info#* }
+    elif strstr " $BOND_NAMES " " ${master:-$controller} "; then
+      found_master=${master:-$controller}
+      found_ifname=$ifname
+    fi
+
+    # Only modify connections that are HCN-related
+    if [ -n "$found_master" ]; then
+      info "parse-hcn: fixing up connection $id (HCN-related)"
+
+      # Ensure controller/master and port-type/slave-type are correct
+      if gkeyfile_has "$con" connection controller; then
+        gkeyfile_set "$con" connection controller "$found_master"
+      elif gkeyfile_has "$con" connection master; then
+        gkeyfile_set "$con" connection master "$found_master"
+      else
+        gkeyfile_set "$con" connection controller "$found_master"
+      fi
+
+      if gkeyfile_has "$con" connection slave-type; then
+        gkeyfile_set "$con" connection slave-type bond
+      else
+        gkeyfile_set "$con" connection port-type bond
+      fi
+
+      # Rename connection ID and file to match expectations
+      new_id="$found_master-$found_ifname"
+      if [ "$id" != "$new_id" ]; then
+        info "parse-hcn: renaming connection $id to $new_id"
+        gkeyfile_set "$con" connection id "$new_id"
+        mv "$con" "$conn_dir/$new_id.nmconnection"
+      fi
+    fi
+  done
+}
+
+# --- Main Execution ---
+
+info "parse-hcn: starting"
+
+MAPPINGS=""
+if [ -d /proc/device-tree ]; then
+  # Scan PCI devices (SR-IOV)
+  for dev in /proc/device-tree/pci*/ethernet*; do
+    [ -e "$dev/ibm,hcn-id" ] || continue
+    info "parse-hcn: checking PCI device $dev"
+    if res=$(get_dev_hcn "$dev"); then
+      MAPPINGS="$MAPPINGS $res"
+    fi
+  done
+
+  # Scan vdevices (VNIC and Virtual Ethernet)
+  for dev in /proc/device-tree/vdevice/vnic* /proc/device-tree/vdevice/l-lan*; 
do
+    [ -e "$dev/ibm,hcn-id" ] || continue
+    info "parse-hcn: checking vdevice $dev"
+    if res=$(get_dev_hcn "$dev"); then
+      MAPPINGS="$MAPPINGS $res"
+    fi
+  done
+fi
+
+if [ -z "$MAPPINGS" ]; then
+  info "parse-hcn: no HCN devices found"
+  exit 0
+fi
+
+info "parse-hcn: discovered mappings: $MAPPINGS"
+
+# Command line processing
+NM_CONF_DIR="/etc/NetworkManager"
+NM_CONF_CONN_DIR="$NM_CONF_DIR/system-connections"
+NM_RUNTIME_DIR="/run/NetworkManager"
+NM_RUNTIME_CONN_DIR="$NM_RUNTIME_DIR/system-connections"
+HCN_RUNTIME_DIR="/run/hcn"
+HCN_RUNTIME_CONN_DIR="$HCN_RUNTIME_DIR/system-connections"
+NEW_ARGS=""
+
+# Extract unique bond names from discovered mappings
+BOND_NAMES=$(echo "$MAPPINGS" | awk '{for(i=1;i<=NF;i+=4) if (!seen[$i]++) 
print $i}')
+
+for BONDNAME in $BOND_NAMES; do
+  SLAVES="" SLAVE_NAMES="" SLAVE_MACS="" PRIMARY=""
+
+  # Extract slaves for this bond from MAPPINGS
+  set -- $MAPPINGS
+  while [ $# -ge 4 ]; do
+    if [ "$1" = "$BONDNAME" ]; then
+      SLAVE_NAMES="$SLAVE_NAMES $2"
+      [ "$3" != "none" ] && SLAVE_MACS="$SLAVE_MACS $3"
+      [ "$4" = "primary" ] && PRIMARY="$2"
+      SLAVES="${SLAVES:+$SLAVES,}$2"
+    fi
+    shift 4
+  done
+
+  info "parse-hcn: configuring bond $BONDNAME with slaves:$SLAVE_NAMES"
+
+  # Add bond definition to NEW_ARGS
+  BOND_OPTS="mode=1,miimon=100,fail_over_mac=2${PRIMARY:+,primary=$PRIMARY}"
+  NEW_ARGS="$NEW_ARGS bond=$BONDNAME:$SLAVES:$BOND_OPTS"
+
+  # Process rd.hcn.ip= - replace slave names/MACs with bond name
+  for HCN_IP in $(getargs rd.hcn.ip); do
+    matched=0
+    for slave in $SLAVE_NAMES $SLAVE_MACS; do
+      slave_dash=$(str_replace "$slave" ":" "-")
+      # Check if HCN_IP contains the slave (as a whole word/field)
+      if strstr ":$HCN_IP:" ":$slave:" || strstr ":$HCN_IP:" ":$slave_dash:"; 
then
+        matched=1
+        # Replace slave with bond name (handle boundaries)
+        current_hcn_ip=$(echo "$HCN_IP" | sed -E "s#^($slave|$slave_dash)([: 
]|$)#$BONDNAME\2#; s#([: ])($slave|$slave_dash)([: ]|$)#\1$BONDNAME\3#g")
+        NEW_ARGS="$NEW_ARGS ip=$current_hcn_ip"
+        break
+      fi
+    done
+
+    # No slave matched and no bond name present - apply to first bond
+    has_bond_ip=0
+    case "$HCN_IP" in
+    *:bond[0-9]*) has_bond_ip=1 ;;
+    esac
+    if [ $matched -eq 0 ] && [ $has_bond_ip -eq 0 ]; then
+      case "$HCN_IP" in
+      dhcp | on | any | single-dhcp | dhcp6 | auto6 | ibft | either6 | link6)
+        info "parse-hcn: applying $HCN_IP to $BONDNAME"
+        NEW_ARGS="$NEW_ARGS ip=$BONDNAME:$HCN_IP"
+        ;;
+      *:dhcp | *:on | *:any | *:dhcp6 | *:auto6 | *:link6)
+        # Format: 
rd.hcn.ip=<interface>:{dhcp|on|any|dhcp6|auto6|link6}[:[<mtu>]]
+        # Extract optional MTU field (after the method, could be followed by 
more colons)
+        temp_ip=${HCN_IP}
+        # Count colons to determine if there are extra fields
+        colons=0
+        while [ "${temp_ip#*:}" != "$temp_ip" ]; do
+          colons=$((colons + 1))
+          temp_ip=${temp_ip#*:}
+        done
+        # Format: interface:method[:mtu]
+        # We need at least 1 colon (interface:method), optionally 2 for MTU
+        if [ "$colons" -ge 1 ]; then
+          info "parse-hcn: applying DHCP/auto config with optional MTU to 
$BONDNAME"
+          NEW_ARGS="$NEW_ARGS ip=$BONDNAME:${HCN_IP#*:}"
+        fi
+        ;;
+      *)
+        # Static IP configuration - count colons to determine format
+        # Standard format: 
rd.hcn.ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]
+        # Minimum fields: client-IP:gateway:netmask:hostname:interface:method 
(5 colons)
+        # Extended: adds :dns1 and/or :dns2 (up to 7 colons)
+        temp_ip=${HCN_IP}
+        colons=0
+        while [ "${temp_ip#*:}" != "$temp_ip" ]; do
+          colons=$((colons + 1))
+          temp_ip=${temp_ip#*:}
+        done
+
+        if [ "$colons" -ge 5 ]; then
+          # Already has interface field, just need to replace it with bond name
+          # Extract fields: we need to replace the 6th field (interface) with 
BONDNAME
+          # Preserve any DNS fields that may follow
+          # shellcheck disable=SC2034
+          IFS=':' read -r f1 f2 f3 f4 f5 f6 f7 f8 f9 <<EOF
+$HCN_IP
+EOF
+          # Reconstruct with bond name as interface (f6 position)
+          # Note: f7 and beyond might be method:dns1:dns2 or just method
+          if [ -n "$f9" ]; then
+            # Has dns2 field
+            info "parse-hcn: applying static IP config with DNS1 and DNS2 to 
$BONDNAME"
+            NEW_ARGS="$NEW_ARGS ip=$f1:$f2:$f3:$f4:$f5:$BONDNAME:$f7:$f8:$f9"
+          elif [ -n "$f8" ]; then
+            # Has dns1 field
+            info "parse-hcn: applying static IP config with DNS1 to $BONDNAME"
+            NEW_ARGS="$NEW_ARGS ip=$f1:$f2:$f3:$f4:$f5:$BONDNAME:$f7:$f8"
+          elif [ -n "$f7" ]; then
+            # Standard format with method
+            info "parse-hcn: applying static IP config to $BONDNAME"
+            NEW_ARGS="$NEW_ARGS ip=$f1:$f2:$f3:$f4:$f5:$BONDNAME:$f7"
+          else
+            # Fallback - just interface name
+            NEW_ARGS="$NEW_ARGS ip=$f1:$f2:$f3:$f4:$f5:$BONDNAME"
+          fi
+        elif [ "$colons" -lt 5 ]; then
+          # Pad with colons to reach standard ip= format (legacy behavior)
+          case $((5 - colons)) in
+          1) suffix=":" ;;
+          2) suffix="::" ;;
+          3) suffix=":::" ;;
+          4) suffix="::::" ;;
+          5) suffix=":::::" ;;
+          *) suffix="" ;;
+          esac
+          info "parse-hcn: applying static IP config to $BONDNAME (padded)"
+          NEW_ARGS="$NEW_ARGS ip=$HCN_IP${suffix}$BONDNAME:none"
+        fi
+        ;;
+      esac
+    fi
+  done
+
+  # Process rd.hcn.route= - replace slave names/MACs with bond name
+  for HCN_ROUTE in $(getargs rd.hcn.route); do
+    matched=0
+    for slave in $SLAVE_NAMES $SLAVE_MACS; do
+      slave_dash=$(str_replace "$slave" ":" "-")
+      if strstr ":$HCN_ROUTE:" ":$slave:" || strstr ":$HCN_ROUTE:" 
":$slave_dash:"; then
+        matched=1
+        current_hcn_route=$(echo "$HCN_ROUTE" | sed -E 
"s#^($slave|$slave_dash)([: ]|$)#$BONDNAME\2#; s#([: ])($slave|$slave_dash)([: 
]|$)#\1$BONDNAME\3#g")
+        NEW_ARGS="$NEW_ARGS rd.route=$current_hcn_route"
+        break
+      fi
+    done
+
+    # No slave matched and no bond name present - apply to first bond
+    has_bond_route=0
+    case "$HCN_ROUTE" in
+    *:bond[0-9]*) has_bond_route=1 ;;
+    esac
+    if [ $matched -eq 0 ] && [ $has_bond_route -eq 0 ]; then
+      temp_route=${HCN_ROUTE}
+      colons=0
+      while [ "${temp_route#*:}" != "$temp_route" ]; do
+        colons=$((colons + 1))
+        temp_route=${temp_route#*:}
+      done
+      if [ "$colons" -le 1 ]; then
+        info "parse-hcn: applying route to $BONDNAME"
+        NEW_ARGS="$NEW_ARGS rd.route=$HCN_ROUTE$([ "$colons" -eq 0 ] && echo 
"::" || echo ":")$BONDNAME"
+      fi
+    fi
+  done
+done
+
+# Write new configuration and update NetworkManager
+if [ -n "$NEW_ARGS" ]; then
+  # Create runtime directory to store HCN connections
+  mkdir -p "$HCN_RUNTIME_CONN_DIR"
+
+  # Write new cmdline options
+  info "parse-hcn: new cmdline arguments: $NEW_ARGS"
+  echo "$NEW_ARGS" > "$HCN_RUNTIME_DIR"/cmdline
+
+  # Find and execute nm-initrd-generator
+  generator_found=0
+  for gen in /usr/lib/nm-initrd-generator /usr/libexec/nm-initrd-generator; do
+    [ -x "$gen" ] || continue
+    generator_found=1
+    info "parse-hcn: calling $gen"
+    rm -f "$HCN_RUNTIME_CONN_DIR"/*
+    # shellcheck disable=SC2086
+    if "$gen" -c "$HCN_RUNTIME_CONN_DIR" -- $NEW_ARGS; then
+      if [ "$(ls -A "$HCN_RUNTIME_CONN_DIR")" ]; then
+        fixup_nm_connections
+        # Persist these new HCN connections to /etc
+        mkdir -p "$NM_CONF_CONN_DIR"
+        cp -rf "$HCN_RUNTIME_CONN_DIR"/* "$NM_CONF_CONN_DIR"
+        mkdir -p "$NM_RUNTIME_DIR"/initrd
+        : > "$NM_RUNTIME_DIR"/initrd/neednet
+        echo '[ -f /tmp/nm.done ]' > "$hookdir"/initqueue/finished/nm.sh
+      else
+        warn "parse-hcn: nm-initrd-generator did not generate any connections"
+      fi
+    else
+      warn "parse-hcn: nm-initrd-generator failed"
+    fi
+    break
+  done
+
+  if [ $generator_found -eq 0 ]; then
+    warn "parse-hcn: nm-initrd-generator not found"
+  fi
+fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/usr/lib/dracut/modules.d/99live-self-update/live-self-update-parser.sh 
new/usr/lib/dracut/modules.d/99live-self-update/live-self-update-parser.sh
--- old/usr/lib/dracut/modules.d/99live-self-update/live-self-update-parser.sh  
2026-06-24 17:55:03.000000000 +0200
+++ new/usr/lib/dracut/modules.d/99live-self-update/live-self-update-parser.sh  
2026-07-14 10:45:10.000000000 +0200
@@ -21,7 +21,7 @@
     echo "<5>Enabling network configuration"
     echo "rd.neednet=1" > "$FILE"
     # use DHCP if there is no network configuration provided by user
-    if ! getarg "ip="; then
+    if ! getarg "ip=" >/dev/null && ! getarg "rd.hcn.ip=" >/dev/null; then
       echo "Using default DHCP network configuration"
       echo "ip=dhcp" >> "$FILE"
     fi

Reply via email to