| name | initramfs-investigation |
| description | Investigate initramfs issues - extraction, module analysis, and comparing working vs failing builds |
Initramfs Investigation
Knowledge for investigating initramfs-related boot failures by comparing working and failing builds in FCOS and RHCOS.
Related: pipeline-failures (CI failures), rhcos-cosa (cosa builds), rhcos-artifacts (build artifacts)
Initramfs Extraction
Identify Compression Format
head -c 6 initramfs.img | od -A x -t x1z
| Magic Bytes | Format | Tool |
|---|
28 b5 2f fd | zstd | zstdcat |
1f 8b | gzip | zcat |
fd 37 7a 58 | xz | xzcat |
30 37 30 37 | CPIO (uncompressed) | Direct cpio |
Extract Initramfs
mkdir extracted && cd extracted
zstdcat ../initramfs.img | cpio -idm
zcat ../initramfs.img | cpio -idm
skipcpio initramfs.img | zstdcat | cpio -idm
List Contents Without Extraction
lsinitrd initramfs.img
zstdcat initramfs.img | cpio -t | head -50
Kernel Module Analysis
Find Modules in Initramfs
find extracted -name "*.ko*" | head -20
find extracted -name "scsi_transport_iscsi*"
Examine Module
xz -d extracted/usr/lib/modules/*/kernel/drivers/scsi/module.ko.xz
readelf -S module.ko
readelf -h module.ko | grep -E "Data|Machine|Class"
FCOS Build Artifacts
Download Initramfs
curl -s "https://builds.coreos.fedoraproject.org/prod/streams/<stream>/builds/builds.json" | jq -r '.builds[].id' | head -10
curl -s "https://builds.coreos.fedoraproject.org/prod/streams/<stream>/builds/<version>/<arch>/meta.json" | jq .
curl -LO "https://builds.coreos.fedoraproject.org/prod/streams/<stream>/builds/<version>/<arch>/fedora-coreos-<version>-live-initramfs.<arch>.img"
Streams: stable, testing, next, rawhide
Compare Package Versions Between Builds
curl -s ".../meta.json" | jq '.pkgdiff'
curl -s ".../meta.json" | jq '.pkgdiff[] | select(.[0] | test("kernel"))'
RHCOS Build Artifacts
From RHCOS Release Browser (Internal)
Base URL: https://releases-rhcos--prod-pipeline.apps.int.prod-stable-spoke1-dc-iad2.itup.redhat.com
curl -s "https://releases-rhcos--prod-pipeline.apps.int.prod-stable-spoke1-dc-iad2.itup.redhat.com/storage/prod/streams/<stream>/builds/builds.json" | jq -r '.builds[].id' | head -10
curl -s "https://releases-rhcos--prod-pipeline.apps.int.prod-stable-spoke1-dc-iad2.itup.redhat.com/storage/prod/streams/<stream>/builds/<buildid>/<arch>/meta.json" | jq .
curl -s ".../meta.json" | jq -r '.images["live-initramfs"].path'
curl -LO "https://releases-rhcos--prod-pipeline.apps.int.prod-stable-spoke1-dc-iad2.itup.redhat.com/storage/prod/streams/<stream>/builds/<buildid>/<arch>/<initramfs-filename>"
Streams: rhel-9.4, rhel-9.6, rhel-10.0, rhel-10.2, etc.
Comparing Working vs Failing Initramfs
1. Identify Working and Failing Builds
From CI failure logs or build history, identify:
- Last working build (e.g.,
45.20260323.91.1)
- First failing build (e.g.,
45.20260324.91.1)
2. Download Both Initramfs
curl -LO ".../45.20260323.91.1/<arch>/fedora-coreos-45.20260323.91.1-live-initramfs.<arch>.img"
curl -LO ".../45.20260324.91.1/<arch>/fedora-coreos-45.20260324.91.1-live-initramfs.<arch>.img"
mv *323* initramfs-working.img
mv *324* initramfs-failing.img
3. Extract Both
mkdir working failing
cd working && zstdcat ../initramfs-working.img | cpio -idm 2>/dev/null && cd ..
cd failing && zstdcat ../initramfs-failing.img | cpio -idm 2>/dev/null && cd ..
4. Compare Kernel Versions
ls working/usr/lib/modules/
ls failing/usr/lib/modules/
5. Compare Specific Files
diff <(ls working/usr/lib/dracut/modules.d/) <(ls failing/usr/lib/dracut/modules.d/)
diff <(readelf -S working/usr/lib/modules/*/kernel/path/to/module.ko) \
<(readelf -S failing/usr/lib/modules/*/kernel/path/to/module.ko)
find working -type f -name "*.ko*" -exec ls -la {} \; | sort > /tmp/working-modules.txt
find failing -type f -name "*.ko*" -exec ls -la {} \; | sort > /tmp/failing-modules.txt
diff /tmp/working-modules.txt /tmp/failing-modules.txt
6. Check dracut Configuration
diff working/usr/lib/dracut/dracut.conf.d/ failing/usr/lib/dracut/dracut.conf.d/
diff working/usr/lib/dracut/modules.d/95iscsi/parse-iscsiroot.sh \
failing/usr/lib/dracut/modules.d/95iscsi/parse-iscsiroot.sh
Analyzing Console Logs
When investigating boot failures from kola tests:
tar -xf kola-upgrade-<arch>.tar.xz
find . -name "console.txt"
grep -n -E "FATAL|failed to|Failed to|error:" console.txt | head -10
grep -E "modprobe|insmod|systemd-modules-load" console.txt
Reference