Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve lsinitrd to ease debugging for developers and end users. #2552

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

steffen-maier
Copy link

@steffen-maier steffen-maier commented Nov 10, 2023

Changes to lsinitrd

enable unpacking files from squash-root.img

This is helpful for debugging some kdump mkdumprd that prefer dracut-squash.

print stored dracut cmdline

It's more convenient for debugging than extracting or unpacking the corresponding files.

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Factored out from another PR (#2534 (comment)).

This is helpful for debugging some kdump mkdumprd that prefer dracut-squash.

To not break when unsquashfs upstream would change the default path prefix,
explicitly specify the prefix as argument so users always find files from
squash-root.img by using the same hardcoded prefix, both in the file listing
and when extracting files.

Regarding extract_files (without --unpack):
Unsquashfs cannot seem to extract to stdout, so take a detour via a temp
file.

Regarding --unpack:
Even though cpio for comparison would not overwrite files on extracing,
pass the force flag to unsquashfs on extracing individual files.
Otherwise, unsquashfs complains about its relative top-level directory
"squashfs-root" which already exists after the first file was extracted.
With the force flag, the user can specify multiple files to extract from
squash-root.img, or can invoke lsinitrd multiple times in the same
directory to extract multiple files from squash-root.img.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
It's more convenient for debugging than extracting or unpacking the
corresponding files.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
@steffen-maier
Copy link
Author

I'm not sure how this code change in lsinitrd could affect the few failing integration tests dealing with dracut core and modules.
The test fails look more like infrastructure or maybe other code coming with the used distro, such as qemu.
At least the tests marked as required in the git workflow were successful.

Example fails:

qemu-system-x86_64: ../softmmu/physmem.c:2419: iotlb_to_section: Assertion `section_index < d->map.sections_nb' failed.
./test.sh: line 143: 3724 Aborted (core dumped) "$testdir"/run-qemu "${disk_args[@]}" -append "root=/dev/dracut/root rw rootfstype=ext4 quiet console=ttyS0,115200n81 selinux=0" -initrd "$TESTDIR"/initramfs.makeroot
TEST: root filesystem over multiple iSCSI with network-manager [FAILED]

qemu-system-x86_64: ../hw/pci/msix.c:227: msix_table_mmio_write: Assertion `addr + size <= dev->msix_entries_nr * PCI_MSIX_ENTRY_SIZE' failed.
./test.sh: line 189: 2144 Aborted (core dumped) "$testdir"/run-qemu "${disk_args[@]}" -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" -initrd "$TESTDIR"/initramfs.makeroot
TEST: root filesystem on NBD with network-manager [FAILED]

qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.07H:EDX.spec-ctrl [bit 26]
Error: The operation was canceled.

Some run into an initqueue timeout waiting for the root-fs dependencies.

Some test seems to get I/O errors after the boot and root-fs mount were already successful:

BdsDxe: starting Boot0001 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0)
Starting systemd-udevd version 254.6-1-arch
made it to the rootfs! Powering down.
[ 12.160063] ata1.00: Read log 0x10 page 0x00 failed, Emask 0x1
[ 12.161143] ata1: failed to read log page 10h (errno=-5)
[ 12.162899] ata1.00: exception Emask 0x1 SAct 0x40 SErr 0x0 action 0x0
[ 12.163177] ata1.00: irq_stat 0x40000000
[ 12.163790] ata1.00: failed command: WRITE FPDMA QUEUED
[ 12.164062] ata1.00: cmd 61/08:30:00:00:00/00:00:00:00:00/40 tag 6 ncq dma 4096 out
[ 12.164062] res 41/04:01:00:00:00/00:00:00:00:00/00 Emask 0x1 (device error)
[ 12.164506] ata1.00: status: { DRDY ERR }
[ 12.164691] ata1.00: error: { ABRT }

@LaszloGombos
Copy link
Collaborator

I'm not sure how this code change in lsinitrd could affect the few failing integration tests dealing with dracut core and modules.

Those failures are unrelated to your change - see #2506

Copy link

stale bot commented Apr 22, 2024

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Apr 22, 2024
@steffen-maier
Copy link
Author

I think this is still interesting, so commenting to keep it open after the stale bot added the stale label.

@stale stale bot removed the stale communication is stuck label Apr 22, 2024
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.

2 participants