target/x86: support custom grub hook
This commit is contained in:
parent
74213075fb
commit
c956349da7
2
target/linux/x86/64/base-files/lib/upgrade/keep.d/grub
Normal file
2
target/linux/x86/64/base-files/lib/upgrade/keep.d/grub
Normal file
@ -0,0 +1,2 @@
|
||||
/boot/grub/grub.ext.cfg
|
||||
/boot/grub/grubenv
|
||||
20
target/linux/x86/64/base-files/usr/sbin/update-grub
Executable file
20
target/linux/x86/64/base-files/usr/sbin/update-grub
Executable 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
|
||||
Loading…
Reference in New Issue
Block a user