mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-28 10:10:29 +00:00
syntax check before overwriting
This commit is contained in:
1 parent
4d69c7863b
commit
75d8c629fc
1 file changed
+9
-2
@@ -314,8 +314,15 @@ for i in ${grub_mkconfig_dir}/* ; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if test "x${grub_cfg}" != "x" ; then
|
if test "x${grub_cfg}" != "x" ; then
|
||||||
# none of the children aborted with error, install the new grub.cfg
|
if ! grub-script-check ${grub_cfg}.new 2>/dev/null; then
|
||||||
mv -f ${grub_cfg}.new ${grub_cfg}
|
echo "Syntax errors are detected in generated GRUB config file." >&2
|
||||||
|
echo "Ensure that there are no errors in /etc/default/grub" >&2
|
||||||
|
echo "and /etc/grub.d/* files or please file a bug report with" >&2
|
||||||
|
echo "${grub_cfg}.new file attached." >&2
|
||||||
|
else
|
||||||
|
# none of the children aborted with error, install the new grub.cfg
|
||||||
|
mv -f ${grub_cfg}.new ${grub_cfg}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "done" >&2
|
echo "done" >&2
|
||||||
Reference in new issue
Block a user