if test "x${grub_cfg}" != "x" ; then
if ! ${grub_script_check} ${grub_cfg}.new; then
# TRANSLATORS: %s is replaced by filename
gettext_printf "Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
%s file attached." "${grub_cfg}.new" >&2
echo >&2
exit 1
else
# none of the children aborted with error, install the new grub.cfg
mv -f ${grub_cfg}.new ${grub_cfg}
fi
fi
你可以
grub-mkconfig -o /boot/grub2/grub.cfg
改用。我
grub-mkconfig -o /boot/grub/grub.cfg
使用 Ansible 运行,它创建了相同的 .new 扩展。但是当我使用时
grub-mkconfig > /boot/grub/grub.cfg
,它运行成功并创建了grub.cfg
.-o
可能不一样>
。在@oldfred 的评论之后查看源代码,发现扩展是在一个或多个文件
.new
中出现错误时创建的。见这里:/etc/default/grub
/etc/grub.d/*