[Merge] ~jefferyto/ubuntu/+source/initramfs-tools:ubuntu-core-dev-fix-resume-device-type-check into ~ubuntu-core-dev/ubuntu/+source/initramfs-tools:ubuntu/devel
Jeffery To
mp+468643 at code.launchpad.net
Wed Jul 3 19:28:34 UTC 2024
Adding a comment here to save the diff comment below.
Diff comments:
> diff --git a/hooks/resume b/hooks/resume
> index 8ff84dd..a13e5a2 100755
> --- a/hooks/resume
> +++ b/hooks/resume
> @@ -23,8 +23,9 @@ if [ -n "$RESUME" ] && [ "$RESUME" != auto ]; then
> if [ "$RESUME" = none ]; then
> exit 0
> fi
> - if resume_dev_node="$(resolve_device "$RESUME")" && \
> - blkid -p -n swap "$resume_dev_node" >/dev/null 2>&1; then
> + resume_dev_node=$(resolve_device "$RESUME")
My understanding is if resolve_device fails, it does not print/output anything, so:
* resume_dev_node is set to the empty string
* blkid exits with an error and does not print/output anything as well
* resume_dev_type is set to the empty string
And the string comparison test would fail.
> + resume_dev_type=$(blkid -p -s TYPE -o value "$resume_dev_node")
> + if [ "$resume_dev_type" = swap ]; then
> exit 0
> fi
>
--
https://code.launchpad.net/~jefferyto/ubuntu/+source/initramfs-tools/+git/initramfs-tools/+merge/468643
Your team Ubuntu Core Development Team is subscribed to branch ~ubuntu-core-dev/ubuntu/+source/initramfs-tools:ubuntu/devel.
More information about the Ubuntu-reviews
mailing list