import OL rust-coreos-installer-0.24.0-5.0.1.el10_1

This commit is contained in:
eabdullin 2025-12-22 06:19:58 +00:00
parent 05c6051330
commit 5e99763a8c
7 changed files with 432 additions and 1 deletions

View File

@ -0,0 +1,67 @@
From dbc41bad9de728f1d42000c5633e3494126f9d6d Mon Sep 17 00:00:00 2001
From: Dusty Mabe <dusty@dustymabe.com>
Date: Thu, 1 May 2025 17:36:39 -0400
Subject: [PATCH] download: format byte unit with 1 decimal place precision
Prior to v0.24.1 the output when processing a stream of disk image
input the output would write with 1 decimal place of precision:
```
Read disk 118.2 MiB/2.6 GiB (4%)
Read disk 157.0 MiB/2.6 GiB (5%)
Read disk 300.1 MiB/2.6 GiB (11%)
Read disk 450.6 MiB/2.6 GiB (16%)
Read disk 515.2 MiB/2.6 GiB (19%)
```
After v0.24.1 it has many decimal places of precision:
```
Read disk 138.2265625 MiB/2.59765625 GiB (5%)
Read disk 265.6722106933594 MiB/2.59765625 GiB (9%)
Read disk 399.67578125 MiB/2.59765625 GiB (15%)
Read disk 519.40625 MiB/2.59765625 GiB (19%)
Read disk 597.5625 MiB/2.59765625 GiB (22%)
```
This is likely due to 68198d0. Let's get back the previous formatting.
---
docs/release-notes.md | 2 +-
src/download.rs | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 42b4974..19b8324 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,9 +8,9 @@ nav_order: 8
Major changes:
-
Minor changes:
+- Restore formatting of progress reporting to pre 0.24.0 behavior.
Internal changes:
diff --git a/src/download.rs b/src/download.rs
index f57fca3..e5b967c 100644
--- a/src/download.rs
+++ b/src/download.rs
@@ -456,9 +456,9 @@ impl<'a, R: Read> ProgressReader<'a, R> {
/// Format a size in bytes.
fn format_bytes(count: u64) -> String {
- Byte::from_u64(count)
- .get_appropriate_unit(byte_unit::UnitType::Binary)
- .to_string()
+ let adjusted_byte = Byte::from_u64(count).get_appropriate_unit(byte_unit::UnitType::Binary);
+ // Get a string trimmed to 1 decimal place of precision
+ format!("{adjusted_byte:.1}")
}
}
--
2.47.0

View File

@ -0,0 +1,100 @@
From 408459f9af84add0c0e5ab0db1657c8bc7d0a6a5 Mon Sep 17 00:00:00 2001
From: Nikita Dubrovskii <nikita@linux.ibm.com>
Date: Wed, 9 Jul 2025 09:02:07 +0200
Subject: [PATCH] rootmap: use full path for 'root=' karg when rootfs is
directly on multipath
Issue: https://github.com/coreos/fedora-coreos-tracker/issues/1980
This was first observed on s390x builders under high system load, where `ext.config.multipath.resilient`
would intermittently fail during subsequent boot:
```
[ 2.781559] multipathd[321]: sdd [8:48]: path added to devmap 0xcadf6fadb3ee446d
[ 2.853163] multipathd[321]: sdb [8:16]: path added to devmap 0x000000000000000b
[ 3.012431] systemd[1]: Reached target coreos-multipath-wait.target - CoreOS Wait For Multipathed Boot.
[ 3.139605] systemd[1]: Mounting sysroot.mount - /sysroot...
[ 3.450666] mount[806]: mount: /sysroot: fsconfig system call failed: /dev/sdd4: Can't open blockdev.
```
It looks like a race condition between multipathd taking ownership of the root device and systemd trying to
mount /sysroot. This might happen because the udev database isn't ready in time.
Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
(cherry picked from commit 33a67caa6fd7291c69c1b502d986707bd0d55e23)
---
docs/release-notes.md | 5 +++++
src/bin/rdcore/rootmap.rs | 28 ++++++++++++++++++++++++----
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 32ee5b8..19e89f3 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -14,6 +14,11 @@ Minor changes:
Internal changes:
+- Add initial TMT tests and a new workflow to execute tests on PRs
+- Use release profile for smaller binaries in CI testing
+- Support cryptsetup-2.8.0's UUIDs naming of dm-integrity devices
+- rootmap: Inject `root=/dev/disk/by-uuid/dm-mpath-$UUID` when on multipath
+
Packaging changes:
diff --git a/src/bin/rdcore/rootmap.rs b/src/bin/rdcore/rootmap.rs
index 43b466c..7aff0bd 100644
--- a/src/bin/rdcore/rootmap.rs
+++ b/src/bin/rdcore/rootmap.rs
@@ -41,6 +41,8 @@ pub fn rootmap(config: RootmapConfig) -> Result<()> {
// and from that we can collect all the parent backing devices too
let mut backing_devices = get_blkdev_deps_recursing(&device)?;
+ // check if device's parent (last in the list) is a mpath device
+ let on_multipath = is_on_multipath(&backing_devices)?;
backing_devices.push(device);
// for each of those, convert them to kargs
@@ -51,13 +53,22 @@ pub fn rootmap(config: RootmapConfig) -> Result<()> {
}
}
+ // use full path when the rootfs is directly on multipath;
+ // this prevents race condition between systemd's autogenerated sysroot.mount and multipathd/udev,
+ // see also: https://github.com/coreos/fedora-coreos-tracker/issues/1980
+ let root = if on_multipath {
+ // https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/udev/rules.d/90-coreos-device-mapper.rules#L25
+ format!(
+ "root=/dev/disk/by-uuid/dm-mpath-{}",
+ physical_mount.get_filesystem_uuid()?
+ )
+ } else {
+ format!("root=UUID={}", physical_mount.get_filesystem_uuid()?)
+ };
// we push the root kargs last, this has the nice property that the final order of kargs goes
// from lowest level to highest; see also
// https://github.com/coreos/fedora-coreos-tracker/issues/465
- kargs.push(format!(
- "root=UUID={}",
- physical_mount.get_filesystem_uuid()?
- ));
+ kargs.push(root);
// we need this because with root= it's systemd that takes care of mounting via
// systemd-fstab-generator, and it defaults to read-only otherwise
@@ -307,3 +318,12 @@ fn write_boot_uuid_grub2_dropin<P: AsRef<Path>>(uuid: &str, p: P) -> Result<()>
std::fs::write(p, format!("set BOOT_UUID=\"{uuid}\"\n"))
.with_context(|| format!("writing {}", p.display()))
}
+
+fn is_on_multipath(backing_devices: &[PathBuf]) -> Result<bool> {
+ let blkinfo = match backing_devices.last() {
+ Some(p) => lsblk_single(p)?,
+ _ => return Ok(false),
+ };
+
+ Ok(blkinfo.get("TYPE").is_some_and(|t| t == "mpath"))
+}
--
2.47.1

View File

@ -0,0 +1,39 @@
From 2ad7b108babe11da86bbce62bd4892b4e25b4211 Mon Sep 17 00:00:00 2001
From: yasminvalim <ydesouza@redhat.com>
Date: Mon, 13 Oct 2025 10:44:55 -0300
Subject: [PATCH 1/2] install: check if firstboot args are defined and add them
manually if necessary
---
src/cmdline/install.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/cmdline/install.rs b/src/cmdline/install.rs
index 885ca73..206d602 100644
--- a/src/cmdline/install.rs
+++ b/src/cmdline/install.rs
@@ -272,7 +272,7 @@ impl InstallConfig {
return Ok(self);
}
- let args = self
+ let mut args = self
.config_file
.iter()
.map(|path| {
@@ -295,6 +295,12 @@ impl InstallConfig {
)
.collect::<Vec<_>>();
+ // If firstboot-args is defined, add it manually
+ if let Some(firstboot_args) = &self.firstboot_args {
+ args.push("--firstboot-args".to_string());
+ args.push(firstboot_args.clone());
+ }
+
println!("Running with arguments: {}", args.join(" "));
Self::from_args(&args)
}
--
2.51.0

View File

@ -0,0 +1,47 @@
From ef0bc1f08a110eac3279f59d9a7defeac0dd31db Mon Sep 17 00:00:00 2001
From: yasminvalim <ydesouza@redhat.com>
Date: Mon, 13 Oct 2025 11:42:48 -0300
Subject: [PATCH 2/2] install: add unit tests
---
src/cmdline/install.rs | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/cmdline/install.rs b/src/cmdline/install.rs
index 206d602..915db59 100644
--- a/src/cmdline/install.rs
+++ b/src/cmdline/install.rs
@@ -584,4 +584,30 @@ dest-device: u
.expand_config_files()
.unwrap_err();
}
+
+ /// Test that firstboot-args is manually added to args list when defined
+ #[test]
+ fn test_firstboot_args_manually_added() {
+ let mut f = NamedTempFile::new().unwrap();
+ f.as_file_mut().write_all(b"dest-device: /dev/sda").unwrap();
+
+ let config = InstallConfig::from_args(&[
+ "--config-file",
+ f.path().to_str().unwrap(),
+ "--firstboot-args",
+ "ip=dhcp",
+ ])
+ .unwrap();
+
+ // Verify firstboot-args is defined
+ assert!(config.firstboot_args.is_some());
+ assert_eq!(config.firstboot_args.as_ref().unwrap(), "ip=dhcp");
+
+ // Test expand_config_files to verify manual addition
+ let expanded = config.expand_config_files().unwrap();
+
+ // Should still have firstboot-args
+ assert!(expanded.firstboot_args.is_some());
+ assert_eq!(expanded.firstboot_args.unwrap(), "ip=dhcp");
+ }
}
--
2.51.0

View File

@ -0,0 +1,92 @@
From e28753c71eefd55142358e88511147d7de3d0975 Mon Sep 17 00:00:00 2001
From: Renata Ravanelli <rravanel@redhat.com>
Date: Mon, 9 Jun 2025 15:48:48 -0300
Subject: [PATCH] OCPBUGS-56597: Fix multipath configuration
- To ensure multipath continues working even if a
path fails, the WWID must be specified both as a
kernel argument and in /etc/multipath/wwids.
Without these, multipath may fail to detect
devices when paths go down, leading to device
mapping issues.
- This PR adds mpath.wwid kernel argument needed
for the installer.
Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
---
docs/release-notes.md | 1 +
src/bin/rdcore/rootmap.rs | 42 ++++++++++++++++++++++++++++++++++++++-
2 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/docs/release-notes.md b/docs/release-notes.md
index a1ba96a..93870d3 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -20,6 +20,7 @@ Internal changes:
- Use release profile for smaller binaries in CI testing
- Support cryptsetup-2.8.0's UUIDs naming of dm-integrity devices
- rootmap: Inject `root=/dev/disk/by-uuid/dm-mpath-$UUID` when on multipath
+- rootmap: Inject `mpath.wwid=$WWID` when on multipath
Packaging changes:
diff --git a/src/bin/rdcore/rootmap.rs b/src/bin/rdcore/rootmap.rs
index 7aff0bd..5d3030b 100644
--- a/src/bin/rdcore/rootmap.rs
+++ b/src/bin/rdcore/rootmap.rs
@@ -135,7 +135,9 @@ fn device_to_kargs(root: &Mount, device: PathBuf) -> Result<Option<Vec<String>>>
} else {
Ok(Some(get_luks_kargs(root, &device)?))
}
- } else if blktype == "part" || blktype == "disk" || blktype == "mpath" {
+ } else if blktype == "mpath" {
+ Ok(Some(get_multipath_kargs(&device)?))
+ } else if blktype == "part" || blktype == "disk" {
Ok(None)
} else {
bail!("unknown block device type {}", blktype)
@@ -327,3 +329,41 @@ fn is_on_multipath(backing_devices: &[PathBuf]) -> Result<bool> {
Ok(blkinfo.get("TYPE").is_some_and(|t| t == "mpath"))
}
+
+fn get_multipath_kargs(device: &Path) -> Result<Vec<String>> {
+ let mut kargs = Vec::new();
+
+ let canonical = std::fs::canonicalize(device)
+ .with_context(|| format!("failed to canonicalize device path: {}", device.display()))?;
+ let device_name = canonical
+ .file_name()
+ .and_then(|s| s.to_str())
+ .with_context(|| {
+ format!(
+ "failed to extract device name from canonical path: {}",
+ canonical.display()
+ )
+ })?;
+
+ let mpathd_output = runcmd_output!("multipathd", "show", "maps", "raw", "format", "%d %w")?;
+ let devices: HashMap<&str, &str> = mpathd_output
+ .lines()
+ .filter_map(|s| {
+ let mut parts = s.trim().split_whitespace();
+ Some((parts.next()?, parts.next()?))
+ })
+ .collect();
+
+ let wwid = devices
+ .get(device_name)
+ .map(|w| w.to_string())
+ .with_context(|| {
+ format!(
+ "failed to find WWID in multipathd output for {}",
+ device_name
+ )
+ })?;
+
+ kargs.push(format!("mpath.wwid={}", wwid));
+ Ok(kargs)
+}
--
2.51.0

View File

@ -0,0 +1,54 @@
From fac38a6c113f89a91e64552937346cdad695ed11 Mon Sep 17 00:00:00 2001
From: Kevin Lyons <kevin.x.lyons@oracle.com>
Date: Fri, 13 Jun 2025 10:03:55 -0700
Subject: [PATCH] Prevent error generating initrd during kernel package
POSTTRANS script
Orabug: 38073419
Signed-off-by: Kevin Lyons <kevin.x.lyons@oracle.com>
Reviewed-by: Alex Burmashev alexander.burmashev@oracle.com
---
.../dracut/51coreos-installer/module-setup.sh | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/coreos-installer-dracut-71817332483aad341ffc666ed69b7869a7a90652/dracut/51coreos-installer/module-setup.sh b/coreos-installer-dracut-71817332483aad341ffc666ed69b7869a7a90652/dracut/51coreos-installer/module-setup.sh
index 6397da3..651d2b9 100755
--- a/coreos-installer-dracut-71817332483aad341ffc666ed69b7869a7a90652/dracut/51coreos-installer/module-setup.sh
+++ b/coreos-installer-dracut-71817332483aad341ffc666ed69b7869a7a90652/dracut/51coreos-installer/module-setup.sh
@@ -45,7 +45,6 @@ install() {
rm \
sed \
sfdisk \
- sgdisk \
find \
gpg-connect-agent \
clevis-luks-unlock
@@ -57,19 +56,19 @@ install() {
"/usr/libexec/coreos-installer-service"
install_and_enable_unit "coreos-installer.service" \
- "default.target"
+ "initrd.target"
install_and_enable_unit "coreos-installer-reboot.service" \
- "default.target"
+ "initrd.target"
install_and_enable_unit "coreos-installer-noreboot.service" \
- "default.target"
+ "initrd.target"
install_and_enable_unit "coreos-installer-poweroff.service" \
- "default.target"
+ "initrd.target"
install_and_enable_unit "coreos-installer-growfs.service" \
- "default.target"
+ "initrd.target"
inst_script "$moddir/coreos-installer-growfs" \
/usr/libexec/coreos-installer-growfs
--
2.43.5

View File

@ -12,7 +12,7 @@
Name: rust-%{crate}
Version: 0.24.0
Release: 1%{?dist}
Release: 5.0.1%{?dist}
Summary: Installer for Fedora CoreOS and RHEL CoreOS
# Upstream license specification: Apache-2.0
@ -22,6 +22,17 @@ Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{
# not used on Fedora
Source1: https://github.com/coreos/%{crate}/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz
Source2: https://github.com/coreos/coreos-installer-dracut/archive/%{dracutcommit}/coreos-installer-dracut-%{dracutshortcommit}.tar.gz
Patch100: bug38073419-Prevent-error-generating-initrd-during-kernel-packag.patch
# https://github.com/coreos/coreos-installer/pull/1654
Patch0: 0001-download-format-byte-unit-with-1-decimal-place-preci.patch
# https://github.com/coreos/coreos-installer/pull/1677
Patch1: 0002-rootmap-use-full-path-for-root-karg-when-rootfs-is-d.patch
# https://github.com/coreos/coreos-installer/pull/1699
Patch2: 0003-install-check-if-firstboot-args-are-defined-and-add-.patch
Patch3: 0004-install-add-unit-tests.patch
# https://github.com/coreos/coreos-installer/pull/1676/commits/a40af0a3ec13c4fd49b34317e80f6c0bc845b46a
Patch4: 0005-OCPBUGS-56597-Fix-multipath-configuration.patch
ExclusiveArch: %{rust_arches}
%if 0%{?rhel} && !0%{?eln}
@ -173,6 +184,27 @@ from the initramfs.
%endif
%changelog
* Thu Dec 18 2025 EL Errata <el-errata_ww@oracle.com> - 0.24.0-5.0.1
- Prevent error generating initrd during kernel package POSTTRANS script
[Orabug: 38073419]
* Wed Nov 19 2025 Huijing Hei <hhei@redhat.com> - 0.24.0-5
- rootmap: Inject `mpath.wwid=$WWID` when on multipath
Backport https://github.com/coreos/coreos-installer/pull/1676/commits/a40af0a3ec13c4fd49b34317e80f6c0bc845b46a
Resolves RHEL-127858
* Mon Nov 3 2025 Yasmin Valim <ydesouza@redhat.com> - 0.24.0-4
- Check if firstboot args are defined and add them manually
Backport https://github.com/coreos/coreos-installer/pull/1699
* Wed Jul 23 2025 Joel Capitao <jcapitao@redhat.com> - 0.24.0-3
- Use the full path for the 'root=' kernel arg when rootfs on mpath
Backport https://github.com/coreos/coreos-installer/pull/1677
* Fri Jul 18 2025 Aashish Radhakrishnan <aaradhak@redhat.com> - 0.24.0-2
- Restore single-decimal precision to stream output
Backport https://github.com/coreos/coreos-installer/pull/1654
* Wed Apr 16 2025 Joel Capitao <jcapitao@redhat.com> - 0.24.0-1
- Update to latest upstream