30_uefi-firmware.in 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #! /bin/sh
  2. set -e
  3. # grub-mkconfig helper script.
  4. # Copyright (C) 2020 Free Software Foundation, Inc.
  5. #
  6. # GRUB is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # GRUB is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. prefix="@prefix@"
  19. exec_prefix="@exec_prefix@"
  20. datarootdir="@datarootdir@"
  21. export TEXTDOMAIN=@PACKAGE@
  22. export TEXTDOMAINDIR="@localedir@"
  23. . "$pkgdatadir/grub-mkconfig_lib"
  24. LABEL="UEFI Firmware Settings"
  25. gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2
  26. cat << EOF
  27. if [ "\$grub_platform" = "efi" ]; then
  28. fwsetup --is-supported
  29. if [ "\$?" = 0 ]; then
  30. menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
  31. fwsetup
  32. }
  33. fi
  34. fi
  35. EOF