block root: split out resume parsing and udev rules
We have a resume module, and these rules should live in it. Modify the sort order a bit to ensure the resume rules continue to execute first.master
parent
145ca9e5b3
commit
5c123162ed
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
dracut_install echo
|
||||||
inst_hook pre-udev 10 "$moddir/parse-resume.sh"
|
inst_hook pre-udev 10 "$moddir/parse-resume.sh"
|
||||||
|
inst_hook pre-udev 30 "$moddir/resume-genrules.sh"
|
||||||
inst_hook mount 90 "$moddir/resume.sh"
|
inst_hook mount 90 "$moddir/resume.sh"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
resume=$(getarg resume=) && ! getarg noresume && {
|
||||||
|
(
|
||||||
|
/bin/echo -e 'KERNEL=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
|
||||||
|
/bin/echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
|
||||||
|
) >> /etc/udev/rules.d/99-resume.rules
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
if [ "${root#/dev/}" != "$root" ]; then
|
||||||
|
(
|
||||||
|
echo 'KERNEL=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
|
||||||
|
echo 'SYMLINK=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
|
||||||
|
) >> /etc/udev/rules.d/99-mount.rules
|
||||||
|
fi
|
|
@ -1,14 +0,0 @@
|
||||||
if [ "${root#/dev/}" != "$root" ]; then
|
|
||||||
|
|
||||||
resume=$(getarg resume=) && ! getarg noresume && {
|
|
||||||
(
|
|
||||||
/bin/echo -e 'KERNEL=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
|
|
||||||
/bin/echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/echo %M:%m > /sys/power/resume"'
|
|
||||||
) >> /etc/udev/rules.d/99-resume.rules
|
|
||||||
}
|
|
||||||
|
|
||||||
(
|
|
||||||
echo 'KERNEL=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
|
|
||||||
echo 'SYMLINK=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" '
|
|
||||||
) >> /etc/udev/rules.d/99-mount.rules
|
|
||||||
fi
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
dracut_install echo
|
dracut_install echo
|
||||||
inst_hook pre-udev 10 "$moddir/parse-root-opts.sh"
|
inst_hook pre-udev 20 "$moddir/parse-root-opts.sh"
|
||||||
inst_hook pre-udev 20 "$moddir/genrules.sh"
|
inst_hook pre-udev 30 "$moddir/block-genrules.sh"
|
||||||
inst_hook mount 99 "$moddir/mount-root.sh"
|
inst_hook mount 99 "$moddir/mount-root.sh"
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if resume=$(getarg resume=) && ! getarg noresume; then
|
|
||||||
export resume
|
|
||||||
echo "$resume" >/.resume
|
|
||||||
else
|
|
||||||
unset resume
|
|
||||||
fi
|
|
||||||
|
|
||||||
root=$(getarg root=)
|
root=$(getarg root=)
|
||||||
case $root in
|
case $root in
|
||||||
|
|
Loading…
Reference in New Issue