summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJybz <j.biernacki@free.fr>2024-04-20 22:43:43 +0200
committerJybz <j.biernacki@free.fr>2024-04-20 22:43:43 +0200
commite42b25fd7c8aab281e11ac3b1f798534ba4885f7 (patch)
treed310e61b3702112d30e2a34ec6c0801453aaefb8
parentecca6a561826c8242c09dd4dfc71e54e769fe6e2 (diff)
downloadmageia-dracut-conf-e42b25fd7c8aab281e11ac3b1f798534ba4885f7.tar
mageia-dracut-conf-e42b25fd7c8aab281e11ac3b1f798534ba4885f7.tar.gz
mageia-dracut-conf-e42b25fd7c8aab281e11ac3b1f798534ba4885f7.tar.bz2
mageia-dracut-conf-e42b25fd7c8aab281e11ac3b1f798534ba4885f7.tar.xz
mageia-dracut-conf-e42b25fd7c8aab281e11ac3b1f798534ba4885f7.zip
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)
-rwxr-xr-xmodules.d/90mgalive/mgalive-root.sh9
1 files changed, 9 insertions, 0 deletions
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