Làm cách nào để xóa các mục EFI không cần thiết khỏi GRUB?


12

This is how my GRUB menu entry looks like

Làm thế nào tôi có thể thoát khỏi các mục menu GRUB không mong muốn này. Ubuntu và Windows của tôi đang được tải đúng cách nhưng những mục không cần thiết này tôi không cần. Cảm ơn trước. Đây là cách grub.cfg (/boot/grub/grub.cfg) trông giống như trong trường hợp của tôi:

# BEGIN /etc/grub.d/00_header ###
if [-s $ tiền tố / grubenv]; sau đó
  đặt have_grubenv = true
  tải_env
fi
if ["$ {next_entry}"]; sau đó
   đặt mặc định = "$ {next_entry}"
   đặt next_entry =
   save_env next_entry
   đặt boot_once = true
khác
   đặt mặc định = "5"
fi

if [x "$ {Feature_menuentry_id}" = xy]; sau đó
  menuentry_id_option = "- id"
khác
  menuentry_id_option = ""
fi

xuất menuentry_id_option

if ["$ {trước_satted_entry}"]; sau đó
  đặt save_entry = "$ {trước_satted_entry}"
  save_env save_entry
  đặt trước_s_s_ryry =
  save_env trước_satted_entry
  đặt boot_once = true
fi

chức năng đã lưu {
  if [-z "$ {boot_once}"]; sau đó
    yet_entry = "$ {đã chọn}"
    save_env save_entry
  fi
}
chức năng ghi lại {
  thiết lập bản ghi = 1
  if [-n "$ {have_grubenv}"]; sau đó nếu [-z "$ {boot_once}"]; sau đó save_env recordfail; fi; fi
}
chức năng load_video {
  if [x $ Feature_all_video_module = xy]; sau đó
    tất cả các video
  khác
    efi_gop
    efi_uga
    insmod ieee1275_fb
    vod
    vod
    video_bochs
    video_codrus
  fi
}

if [x $ Feature_default_font_path = xy]; sau đó
   font = unicode
khác
insmod part_gpt
insmod ext2
đặt gốc = 'hd0, gpt7'
if [x $ Feature_pl platform_search_hint = xy]; sau đó
  tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
khác
  tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
fi
    font = "/ usr / share / grub / unicode.pf2"
fi

nếu phông chữ loadfont $; sau đó
  đặt gfxmode = tự động
  tải trọng video
  gfxterm
  đặt locale_dir = $ tiền tố / ngôn ngữ
  đặt lang = en_US
  gettext
fi
thiết bị đầu cuối gfxterm
if ["$ {recordfail}" = 1]; sau đó
  đặt thời gian chờ = -1
khác
  if [x $ Feature_timeout_style = xy]; sau đó
    đặt thời gian chờ_style = menu
    đặt thời gian chờ = 30
  # Mã thời gian chờ dự phòng bình thường trong trường hợp tính năng timeout_style là
  # không có sẵn.
  khác
    đặt thời gian chờ = 30
  fi
fi
### HẾT /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
đặt menu_color_n normal = trắng / đen
đặt menu_color_highlight = đen / xám nhạt
nếu nền_color 44,0,30,0; sau đó
  thông thoáng
fi
### HẾT /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
hàm gfxmode {
    đặt gfxpayload = "$ {1}"
    if ["$ {1}" = "giữ"]; sau đó
        đặt vt_handoff = vt.handoff = 7
    khác
        đặt vt_handoff =
    fi
}
if ["$ {recordfail}"! = 1]; sau đó
  if [-e $ {tiền tố} /gfxblacklist.txt]; sau đó
    if hwmatch $ {tiền tố} /gfxblacklist.txt 3; sau đó
      if [$ {khớp} = 0]; sau đó
        đặt linux_gfx_mode = giữ
      khác
        đặt linux_gfx_mode = văn bản
      fi
    khác
      đặt linux_gfx_mode = văn bản
    fi
  khác
    đặt linux_gfx_mode = giữ
  fi
khác
  đặt linux_gfx_mode = văn bản
fi
xuất linux_gfx_mode
menuentry 'Ubuntu' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-simple-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
    hồ sơ
    tải trọng video
    gfxmode $ linux_gfx_mode
    gzio insmod
    insmod part_gpt
    insmod ext2
    đặt gốc = 'hd0, gpt7'
    if [x $ Feature_pl platform_search_hint = xy]; sau đó
      tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
    khác
      tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
    fi
    linux /boot/vmlinuz-3.13.0-49-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro giật gân yên tĩnh $ vt_handoff
    initrd /boot/initrd.img-3.13.0-49-generic
}
menu phụ 'Tùy chọn nâng cao cho Ubuntu' $ menuentry_id_option 'gnulinux-advanced-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
    menuentry 'Ubuntu, với Linux 3.13.0-49-generic' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-49-generic-advanced-0307c8a7-964b -4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gfxmode $ linux_gfx_mode
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-49-generic ...'
        linux /boot/vmlinuz-3.13.0-49-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro giật gân yên tĩnh $ vt_handoff
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-49-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-49-generic (chế độ phục hồi)' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-49-generic-recovery -0307c8a7-964b-4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-49-generic ...'
        linux /boot/vmlinuz-3.13.0-49-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro nomodeset 
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-49-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-48-generic' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-48-generic-advanced-0307c8a7-964b -4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gfxmode $ linux_gfx_mode
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-48-chung ...'
        linux /boot/vmlinuz-3.13.0-48-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro giật gân yên tĩnh $ vt_handoff
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-48-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-48-generic (chế độ phục hồi)' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-48-generic-recovery -0307c8a7-964b-4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-48-chung ...'
        linux /boot/vmlinuz-3.13.0-48-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro nomodeset 
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-48-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-46-generic' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-46-generic-advanced-0307c8a7-964b -4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gfxmode $ linux_gfx_mode
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-46-chung ...'
        linux /boot/vmlinuz-3.13.0-46-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro giật gân yên tĩnh $ vt_handoff
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-46-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-46-generic (chế độ phục hồi)' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-46-generic-recovery -0307c8a7-964b-4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-46-chung ...'
        linux /boot/vmlinuz-3.13.0-46-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro nomodeset 
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-46-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-44-generic' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-44-generic-advanced-0307c8a7-964b -4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gfxmode $ linux_gfx_mode
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-44-generic ...'
        linux /boot/vmlinuz-3.13.0-44-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro giật gân yên tĩnh $ vt_handoff
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-44-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-44-generic (chế độ phục hồi)' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-44-generic-recovery -0307c8a7-964b-4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-44-generic ...'
        linux /boot/vmlinuz-3.13.0-44-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro danh mục phục hồi 
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-44-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-32-generic' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-32-generic-advanced-0307c8a7-964b -4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gfxmode $ linux_gfx_mode
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-32-chung ...'
        linux /boot/vmlinuz-3.13.0-32-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro giật gân yên tĩnh $ vt_handoff
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-32-generic
    }
    menuentry 'Ubuntu, với Linux 3.13.0-32-generic (chế độ phục hồi)' - class ub Ubuntu - class gnu-linux - class gnu - class os $ menuentry_id_option 'gnulinux-3.13.0-32-generic-recovery -0307c8a7-964b-4f91-9eb0-31dddf1eee73 '{
        hồ sơ
        tải trọng video
        gzio insmod
        insmod part_gpt
        insmod ext2
        đặt gốc = 'hd0, gpt7'
        if [x $ Feature_pl platform_search_hint = xy]; sau đó
          tìm kiếm --no-floppy --fs-uuid --set = root --hint-bios = hd0, gpt7 --hint-efi = hd0, gpt7 --hint-baremetal = ahci0, gpt7 0307c8a7-964b-4f91-9eb0 -31dddf1eee73
        khác
          tìm kiếm - không-đĩa mềm --fs-uuid --set = root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo 'Đang tải Linux 3.13.0-32-chung ...'
        linux /boot/vmlinuz-3.13.0-32-generic.efi.sign root = UUID = 0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro nomodeset 
        echo 'Đang tải ramdisk ban đầu ...'
        initrd /boot/initrd.img-3.13.0-32-generic
    }
}

### HẾT /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### HẾT /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### HẾT /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/25_custom ###

thực đơn "Windows UEFI bootmgfw.efi" {
tìm kiếm --fs-uuid --no-floppy --set = root E467-1A3B
trình tải chuỗi ($ {root}) / EFI / Microsoft / Boot / bootmgfw.efi
}

menu "Trình tải Windows Boot UEFI" {
tìm kiếm --fs-uuid --no-floppy --set = root E467-1A3B
trình tải chuỗi ($ {root}) / EFI / Boot / bkpbootx64.efi
}

menuentry "EFI / HP / SystemRecovery / bootmgfw.efi" {
tìm kiếm --fs-uuid --no-floppy --set = root E467-1A3B
trình tải chuỗi ($ {root}) / EFI / HP / SystemRecovery / bootmgfw.efi
}
### HẾT /etc/grub.d/25_custom ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on / dev / sda2)' - windows windows - class os $ menuentry_id_option 'osprober-efi-E467-1A3B' {
    insmod part_gpt
    chất béo không tinh khiết
    đặt gốc = 'hd0, gpt2'
    if [x $ Feature_pl platform_search_hint = xy]; sau đó
      tìm kiếm --no-đĩa mềm
    khác
      tìm kiếm --no-floppy --fs-uuid --set = root E467-1A3B
    fi
    trình tải chuỗi /EFI/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
    fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
else
  search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=10
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=10
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt7'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
    else
      search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
    fi
    linux   /boot/vmlinuz-3.13.0-49-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.13.0-49-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
    menuentry 'Ubuntu, with Linux 3.13.0-49-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-49-generic-advanced-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-49-generic ...'
        linux   /boot/vmlinuz-3.13.0-49-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-49-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-49-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-49-generic-recovery-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-49-generic ...'
        linux   /boot/vmlinuz-3.13.0-49-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro recovery nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-49-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-48-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-48-generic-advanced-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-48-generic ...'
        linux   /boot/vmlinuz-3.13.0-48-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-48-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-48-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-48-generic-recovery-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-48-generic ...'
        linux   /boot/vmlinuz-3.13.0-48-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro recovery nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-48-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-46-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-46-generic-advanced-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-46-generic ...'
        linux   /boot/vmlinuz-3.13.0-46-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-46-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-46-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-46-generic-recovery-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-46-generic ...'
        linux   /boot/vmlinuz-3.13.0-46-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro recovery nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-46-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-44-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-44-generic-advanced-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-44-generic ...'
        linux   /boot/vmlinuz-3.13.0-44-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-44-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-44-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-44-generic-recovery-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-44-generic ...'
        linux   /boot/vmlinuz-3.13.0-44-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro recovery nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-44-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-32-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-32-generic-advanced-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-32-generic ...'
        linux   /boot/vmlinuz-3.13.0-32-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-32-generic
    }
    menuentry 'Ubuntu, with Linux 3.13.0-32-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-32-generic-recovery-0307c8a7-964b-4f91-9eb0-31dddf1eee73' {
        recordfail
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  0307c8a7-964b-4f91-9eb0-31dddf1eee73
        else
          search --no-floppy --fs-uuid --set=root 0307c8a7-964b-4f91-9eb0-31dddf1eee73
        fi
        echo    'Loading Linux 3.13.0-32-generic ...'
        linux   /boot/vmlinuz-3.13.0-32-generic.efi.signed root=UUID=0307c8a7-964b-4f91-9eb0-31dddf1eee73 ro recovery nomodeset 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-3.13.0-32-generic
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/25_custom ###

menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root E467-1A3B
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

menuentry "Windows Boot UEFI loader" {
search --fs-uuid --no-floppy --set=root E467-1A3B
chainloader (${root})/EFI/Boot/bkpbootx64.efi
}


### END /etc/grub.d/25_custom ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-E467-1A3B' {
    insmod part_gpt
    insmod fat
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  E467-1A3B
    else
      search --no-floppy --fs-uuid --set=root E467-1A3B
    fi
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
    fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/backup25_custom ###

menuentry "Windows UEFI bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root E467-1A3B
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/backup25_custom ###

Couldn't follow the link. It gave a 404. You can use the key combination ctrl + G or select the 'img' option in the editor directly above the text field. That way, the image is tied to the post.
Andrew Wallace

Please check your link was broken, so removed, enter your valid link again
Maythux

posted the image now.
Ashu

ubuntuforums.org/showthread.php?t=2275315 - following on that thread also for the same problem
Ashu

Câu trả lời:


5

finally i am able to resolve this issue...went thru each and every file under /etc/grub.d/ directory and got rid of the entries not needed and then ran 'sudo update-grub'. I went into 25_custom and wiped all the entries into which were not needed(to boot into at the time of startup - like all the unnecessary EFI entries).

sudo gedit  /etc/grub.d/25_custom
sudo update-grub

Please make sure to make a backup of the files you are editing. Make sure that you are not storing any of the backup files starting with 25_custom...if you store it with 25_custom_today'sdate etc....EFI boot loader will still read the entries from that....For folks who have HP Laptop - this will definitely work for you.Thanks for all your help.


2

To clean your Grub entry you have to decide which menuentry to remove, First let's edit the custom file script in the /etc/grub.d dir contain same content of your grub.cfg.

gedit /boot/grub/grub.cfg

Copy all contents and go to the file /etc/grub.d/40_custom

sudo gedit  /etc/grub.d/40_custom

Append the copied content to the lines founded in the 40_custom.

Now In this custom file just remove all menuentries that you don't want to appear in your Grub menu. Take sure to remove the node of the menuentry which is enclosed by { }

Now when you finish Save the 40_custom file and exit from gedit

Then run the command:

sudo update-grub

This command will create a new boot menu in the file /boot/grub/grub.cfg that contains the custom menu items that we have specified.

You can check, ahead of rebooting, just to be sure, by using the command: gedit /boot/grub/grub.cfg. This will open the file in read-only mode.

If the file is as you expect then go ahead and reboot else check where you have an error.

you can read some articles for more info such as this and this.


1
Đây là một cách sai cho UEFI.
Pilot6

1
Nó trông giống như menu grub, không phải UEFI. Và bạn đã chạy Boot-Repair chưa? Boot-Repair thêm tất cả các tệp efi mà nó tìm thấy vào 25_custom. Vì vậy, bạn có thể sao lưu 25_custom và chỉnh sửa theo ý muốn. Sau đó chạysudo update-grub
oldfred

Cảm ơn oldfred tôi sẽ thử điều đó ... vui lòng chỉ định các bước chi tiết hơn.
Ashu

@Maythux No that doesn't work...it will in fact make the situation even worse.
Ashu

Read links in the last line they have full details, perfect to learn from
Maythux

1

To remove EFI entries from UEFI efibootmgr is used.

You can list entries by

sudo efibootmgr

And remove entries by

sudo efibootmgr -Bb <entry_number>

Efibootmgr manual


không hữu ích: ashu @ ashu-700-430qe: ~ $ sudo efibootmgr [sudo] mật khẩu cho ashu: BootCản: 0003 Hết giờ: 2 giây BootOrder: 0003,0001.0002.000A, 0007.0008.000B, 000C, 0000 Boot0000 ubfox Boot0001 * USB Floppy / CD Boot0002 * USB Hard Drive Boot0003 * Windows Boot Manager Boot0007 * USB Floppy / CD Boot0008 * Ổ đĩa cứng Boot000A * Ổ đĩa CD-ROM ATAPI Boot000B * Ổ đĩa CD / DVD Boot000C * Realtek PXE B03 D00 700-430qe: ~ $ ashu @ ashu-700-430qe: ~ $
Ashu
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookieChính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.