target/x86: support custom grub hook

This commit is contained in:
Liangbin Lian 2024-02-20 11:52:20 +08:00
parent 74213075fb
commit c956349da7
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,2 @@
/boot/grub/grub.ext.cfg
/boot/grub/grubenv

View File

@ -0,0 +1,20 @@
#!/bin/sh
GRUB_CFG=/boot/grub/grub.ext.cfg
merge_cfg() {
local cfgfile
echo "# Merged /etc/grub.cfg.d/*.cfg"
echo "# WARNING: Do not edit this file by tools other than update-grub!!!"
ls /etc/grub.cfg.d/*.cfg | while read; do
cfgfile="$REPLY"
echo "# $cfgfile"
cat "$cfgfile"
echo
done
}
exec 512>/var/lock/update-grub.lock
flock 512 || exit 1
merge_cfg >$GRUB_CFG