동일한 구성을 사용하고 CentOS 7에서 "grub2-reboot # && restart"를 통해 부팅하는 두 번째 메뉴 항목을 성공적으로 추가했지만 다음에 FreePBX Distro 7 메뉴 항목 선택을 실행할 때 아무 것도 변경되지 않는 것 같습니다.
문제 해결/테스트/수정을 시도하는 방법에 대한 아이디어가 있습니까?
구성:
고양이/etc/기본/grub
[root@freepbx ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="gfxterm"
GRUB_CMDLINE_LINUX="crashkernel=auto biosdevname=0 net.ifnames=0 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_BACKGROUND=/boot/splash.png
고양이/부팅/grub2/grub.cfg
[root@freepbx ~]# cat /boot/grub2/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set pager=1
if [ -s $prefix/grubenv ]; then
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="${saved_entry}"
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 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_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2' 5820774d-3fcf-44fb-86b9-972fab5de985
else
search --no-floppy --fs-uuid --set=root 5820774d-3fcf-44fb-86b9-972fab5de985
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
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 0123444f-dbb6-421e-ad8a-6f6bfb0a0901
else
search --no-floppy --fs-uuid --set=root 0123444f-dbb6-421e-ad8a-6f6bfb0a0901
fi
insmod png
background_image -m stretch /splash.png
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
### END /etc/grub.d/00_tuned ###
### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
source ${prefix}/user.cfg
if [ -n "${GRUB2_PASSWORD}" ]; then
set superusers="root"
export superusers
password_pbkdf2 root ${GRUB2_PASSWORD}
fi
fi
### END /etc/grub.d/01_users ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Sangoma Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)' --class sangoma --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.2.2.el7.x86_64-advanced-5820774d-3fcf-44fb-86b9-972fab5de985' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 0123444f-dbb6-421e-ad8a-6f6bfb0a0901
else
search --no-floppy --fs-uuid --set=root 0123444f-dbb6-421e-ad8a-6f6bfb0a0901
fi
linux16 /vmlinuz-3.10.0-514.2.2.el7.x86_64 root=UUID=5820774d-3fcf-44fb-86b9-972fab5de985 ro crashkernel=auto biosdevname=0 net.ifnames=0 rhgb quiet
initrd16 /initramfs-3.10.0-514.2.2.el7.x86_64.img
}
if [ "x$default" = 'Sangoma Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)' ]; then default='Advanced options for Sangoma Linux>Sangoma Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)'; fi;
### 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_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### 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.
menuentry "Parted Magic 64-bit LiveISO" {
set root=(hd0,msdos2)
set isofile="/home/isos/pmagic.iso"
loopback loop $isofile
linux (loop)/pmagic/bzImage64 iso_filename=$isofile load_ramdisk=1
initrd (loop)/pmagic/initrd.img /pmagic/fu.img /pmagic/m64.img
}
### 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 ###
또한 다음을 시도했지만 동일한 결과를 얻었습니다.
sudo rm /boot/grub2/grub.cfg
sudo rm /etc/grub.d/* -R
sudo rm /etc/sysconfig/grub
yum reinstall -y grub2-tools
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
따라서 FreePBX는 자체 Repo를 사용하므로 위의 코드를 따랐지만 grub2-tools를 수동으로 다운로드했는데 이제 다음 오류가 발생합니다.
[root@freepbx grub]# grub2-install --target=x86_64
grub2-install: error: /usr/lib/grub/x86_64/modinfo.sh doesn't exist. Please specify --target or --directory.
[root@freepbx grub]# grub2-install /dev/sda
grub2-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
답변1
어떤 이유로 FreePBX Distro에는 MBR 설치에도 /boot/efi/ 폴더가 있습니다.
트리: (중복된 내용은 제거했습니다)
[root@freepbx ~]# tree /boot/
/boot/
├── efi
│ └── EFI
│ ├── BOOT
│ │ ├── BOOTX64.EFI
│ │ └── fallback.efi
│ └── centos
│ ├── BOOT.CSV
│ ├── fonts
│ │ └── unicode.pf2
│ ├── gcdx64.efi
│ ├── grubenv
│ ├── grubx64.efi
│ ├── MokManager.efi
│ ├── shim-centos.efi
│ └── shim.efi
├── grub
│ └── splash.xpm.gz
├── grub2
│ ├── grub.cfg
│ ├── grubenv -> /boot/efi/EFI/centos/grubenv
질문:
/boot/grub2/grubenv는 /boot/efi/EFI/centos/grubenv에 대한 소프트 링크입니다.
MBR과 UEFI를 확인하세요.
[root@freepbx ~]# sudo parted -l | grep Table
Partition Table: msdos
sudo rm /boot/efi -R
sudo rm /boot/grub2/grubenv*
sudo rm /boot/grub2/grub.cfg
sudo rm /etc/grub.d/* -R
sudo rm /etc/sysconfig/grub
yum reinstall -y grub2-tools
nano /etc/grub.d/40_custom
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
grub2-reboot 'Parted Magic 64-bit LiveISO'
reboot