From e42b25fd7c8aab281e11ac3b1f798534ba4885f7 Mon Sep 17 00:00:00 2001 From: Jybz Date: Sat, 20 Apr 2024 22:43:43 +0200 Subject: Updated to ensure udev has re-added the protective partition before trying to mount it (mga#27638). - origin: https://svnweb.mageia.org/packages/cauldron/dracut/current/SOURCES/0511-mgalive-A-module-to-mount-Mageia-Live-media.patch?r1=1649975&r2=1653914 - mgalive: ensure udev has re-added the protective partition before trying to mount it (mga#27638) --- modules.d/90mgalive/mgalive-root.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules.d/90mgalive/mgalive-root.sh b/modules.d/90mgalive/mgalive-root.sh index dd09be7..10f2cdc 100755 --- a/modules.d/90mgalive/mgalive-root.sh +++ b/modules.d/90mgalive/mgalive-root.sh @@ -94,11 +94,20 @@ if [ $ps -ne 0 ] ; then # If we mount the raw device, we can't then also mount a partition # on that device. So to enable persistence, we need to extend the # first partition to claim the full range of the iso9660 filesystem. + # The loops waiting for udev are to ensure we don't try to mount the + # partition in the small window when udev has removed it but not yet + # re-added it (mga#27638). pe=$(partx -go END $livedev) if [ $ps -eq 1 ] ; then info "Extending $livedev to cover sector 0" delpart $basedev 1 + while [ -e $livedev ] ; do + info "Wait for udev to remove $livedev" + done addpart $basedev 1 0 $pe + while [ ! -e $livedev ] ; do + info "Wait for udev to re-add $livedev" + done else info "$livedev is not a valid protective partition" fi -- cgit v1.2.1