extensions: grub-with-dtb: add UMS menu entry to GRUB if initramfs ums hook is detected

- this allows user to enter UMS mode from GRUB
- for usage with the `initramfs-usb-gadget-ums` extension
- has no effect unless `initramfs-usb-gadget-ums` extension is enabled together with `grub-with-dtb`
This commit is contained in:
Ricardo Pardini
2023-11-12 02:21:51 +01:00
committed by Igor
parent 1e184f14af
commit 205dd11af5

View File

@@ -503,6 +503,10 @@ while [ "x$list" != "x" ]; do
"${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
fi
if [ -f /etc/initramfs-tools/scripts/init-premount/usb-gadget-ums.sh ]; then
linux_entry "${OS}" "${version}" init-ums "initrd=ums ums=yes ${GRUB_CMDLINE_LINUX}"
fi
list=$(echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' ')
done