Mageia Bugzilla – Attachment 6251 Details for
Bug 12305
dracut fails the boot process when swap (resume) partition UUID not found; installer doesn't help prevent this
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Patch to make dracut treat missing swap partitions as non-fatal error
dracut.patch (text/plain), 2.79 KB, created by
Martin Whitaker
on 2015-04-13 00:50:47 CEST
(
hide
)
Description:
Patch to make dracut treat missing swap partitions as non-fatal error
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2015-04-13 00:50:47 CEST
Size:
2.79 KB
patch
obsolete
>--- a/lib/dracut/modules.d/99base/dracut-lib.sh 2015-04-06 21:30:17.000000000 +0100 >+++ b/lib/dracut/modules.d/99base/dracut-lib.sh 2015-04-12 22:52:24.006522069 +0100 >@@ -927,12 +927,28 @@ > fi > } > >+timeout_wait_for_dev() >+{ >+ local _name >+ _name="$(str_replace "$1" '/' '\x2f')" >+ >+ type mark_hostonly >/dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/timeout/devexists-${_name}.sh" >+ >+ [ -e "${PREFIX}$hookdir/initqueue/timeout/devexists-${_name}.sh" ] && return 0 >+ >+ { >+ printf 'warn "Cancelling wait for %s. Device not found."\n' $1 >+ printf 'cancel_wait_for_dev %s\n' $1 >+ printf 'rm -f -- "$job"\n' >+ } >> "${PREFIX}$hookdir/initqueue/timeout/devexists-${_name}.sh" >+} >+ > cancel_wait_for_dev() > { > local _name >- _name="$(str_replace "$1" '/' '\\x2f')" >- rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh" >- rm -f -- "$hookdir/emergency/80-${_name}.sh" >+ _name="$(str_replace "$1" '/' '\x2f')" >+ rm -f -- "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" >+ rm -f -- "${PREFIX}$hookdir/emergency/80-${_name}.sh" > if [ -n "$DRACUT_SYSTEMD" ]; then > _name=$(dev_unit_name "$1") > rm -f -- ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device > >--- a/lib/dracut/modules.d/99base/module-setup.sh 2014-06-30 11:03:12.000000000 +0100 >+++ b/lib/dracut/modules.d/99base/module-setup.sh 2015-04-12 21:41:49.024705757 +0100 >@@ -114,6 +114,15 @@ > *) ;; > esac > done >+ for _dev in ${swap_devs[@]}; do >+ [[ "$_dev" == "$root_dev" ]] && continue >+ _pdev=$(get_persistent_dev $_dev) >+ >+ case "$_pdev" in >+ /dev/?*) timeout_wait_for_dev $_pdev;; >+ *) ;; >+ esac >+ done > ) > fi > fi > >--- a/bin/dracut 2015-04-12 20:51:35.302765793 +0100 >+++ b/bin/dracut 2015-04-12 21:41:55.593639741 +0100 >@@ -1089,7 +1089,10 @@ > done < /etc/crypttab > fi > >- push host_devs "$(readlink -f "$dev")" >+ swap_dev=$(readlink -f "$dev") >+ push host_devs $swap_dev >+ push swap_devs $swap_dev >+ > break > done < /etc/fstab > done < /proc/swaps >@@ -1190,7 +1193,7 @@ > omit_drivers mdadmconf lvmconf root_dev \ > use_fstab fstab_lines libdirs fscks nofscks ro_mnt \ > stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \ >- debug host_fs_types host_devs sshkey add_fstab \ >+ debug host_fs_types host_devs swap_devs sshkey add_fstab \ > DRACUT_VERSION udevdir prefix filesystems drivers \ > systemdutildir systemdsystemunitdir systemdsystemconfdir \ > host_modalias host_modules hostonly_cmdline
--- a/lib/dracut/modules.d/99base/dracut-lib.sh 2015-04-06 21:30:17.000000000 +0100 +++ b/lib/dracut/modules.d/99base/dracut-lib.sh 2015-04-12 22:52:24.006522069 +0100 @@ -927,12 +927,28 @@ fi } +timeout_wait_for_dev() +{ + local _name + _name="$(str_replace "$1" '/' '\x2f')" + + type mark_hostonly >/dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/timeout/devexists-${_name}.sh" + + [ -e "${PREFIX}$hookdir/initqueue/timeout/devexists-${_name}.sh" ] && return 0 + + { + printf 'warn "Cancelling wait for %s. Device not found."\n' $1 + printf 'cancel_wait_for_dev %s\n' $1 + printf 'rm -f -- "$job"\n' + } >> "${PREFIX}$hookdir/initqueue/timeout/devexists-${_name}.sh" +} + cancel_wait_for_dev() { local _name - _name="$(str_replace "$1" '/' '\\x2f')" - rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh" - rm -f -- "$hookdir/emergency/80-${_name}.sh" + _name="$(str_replace "$1" '/' '\x2f')" + rm -f -- "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" + rm -f -- "${PREFIX}$hookdir/emergency/80-${_name}.sh" if [ -n "$DRACUT_SYSTEMD" ]; then _name=$(dev_unit_name "$1") rm -f -- ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device --- a/lib/dracut/modules.d/99base/module-setup.sh 2014-06-30 11:03:12.000000000 +0100 +++ b/lib/dracut/modules.d/99base/module-setup.sh 2015-04-12 21:41:49.024705757 +0100 @@ -114,6 +114,15 @@ *) ;; esac done + for _dev in ${swap_devs[@]}; do + [[ "$_dev" == "$root_dev" ]] && continue + _pdev=$(get_persistent_dev $_dev) + + case "$_pdev" in + /dev/?*) timeout_wait_for_dev $_pdev;; + *) ;; + esac + done ) fi fi --- a/bin/dracut 2015-04-12 20:51:35.302765793 +0100 +++ b/bin/dracut 2015-04-12 21:41:55.593639741 +0100 @@ -1089,7 +1089,10 @@ done < /etc/crypttab fi - push host_devs "$(readlink -f "$dev")" + swap_dev=$(readlink -f "$dev") + push host_devs $swap_dev + push swap_devs $swap_dev + break done < /etc/fstab done < /proc/swaps @@ -1190,7 +1193,7 @@ omit_drivers mdadmconf lvmconf root_dev \ use_fstab fstab_lines libdirs fscks nofscks ro_mnt \ stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \ - debug host_fs_types host_devs sshkey add_fstab \ + debug host_fs_types host_devs swap_devs sshkey add_fstab \ DRACUT_VERSION udevdir prefix filesystems drivers \ systemdutildir systemdsystemunitdir systemdsystemconfdir \ host_modalias host_modules hostonly_cmdline
View Attachment As Raw
Actions:
View
Attachments on
bug 12305
:
4787
|
6134
| 6251