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

dmsquash-live-root: Run checkisomd5 on correct device #1882

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

bcl
Copy link
Contributor

@bcl bcl commented Jul 25, 2022

When the new grub2 iso is written to a usb drive the disk label points
to a partition that does not include the full iso image. This causes
checkisomd5 to run with the wrong data and it fails.

This patch adds a check that will test to see if there is a parent
device that is a disk, and to run checkisomd5 on it instead of on the
partition pointed to by the label.

When running from an iso this will return the original
/dev/disk/by-label/ path, and when running from a usb drive it will
return the parent device (eg. /dev/sda).

Resolves: rhbz#2107858

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

@github-actions github-actions bot added dmsquash-live Issues related to the dmsquash-live module modules Issue tracker for all modules labels Jul 25, 2022
Copy link
Contributor

@rvykydal rvykydal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you.
But I don't feel strong enough in dracut land so I'd prefer also second eye on the patch.

Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you need to change your commit message from:

dmsquash-live-root: Run checkisomd5 on correct device

to something like:

fix(dmsquash-live): run checkisomd5 on correct device

See https://github.com/dracutdevs/dracut/blob/master/docs/HACKING.md#commit-messages

modules.d/90dmsquash-live/dmsquash-live-root.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@pvalena pvalena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I'd rather rewrite this and parse the entries line-by-line using for and case.

modules.d/90dmsquash-live/dmsquash-live-root.sh Outdated Show resolved Hide resolved
modules.d/90dmsquash-live/dmsquash-live-root.sh Outdated Show resolved Hide resolved
@bcl bcl force-pushed the dmsquash-grub2-iso branch 2 times, most recently from af37a4c to 8270bec Compare July 26, 2022 19:41
When the new grub2 iso is written to a usb drive the disk label points
to a partition that does not include the full iso image. This causes
checkisomd5 to run with the wrong data and it fails.

This patch adds a check that will test to see if there is a parent
device that is a disk, and to run checkisomd5 on it instead of on the
partition pointed to by the label.

When running from an iso this will return the original
/dev/disk/by-label/ path, and when running from a usb drive it will
return the parent device (eg. /dev/sda).

Resolves: rhbz#2107858
@bcl
Copy link
Contributor Author

bcl commented Aug 10, 2022

@LaszloGombos looks like one of the tests timed out. I don't think I have the power to retry, can you?

Copy link
Collaborator

@johannbg johannbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johannbg johannbg merged commit c8f819e into dracutdevs:master Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dmsquash-live Issues related to the dmsquash-live module modules Issue tracker for all modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants