grub-mkconfig가 /etc/grub.d/10_linux 메뉴 항목을 채우지 않습니다(Void Linux)

grub-mkconfig가 /etc/grub.d/10_linux 메뉴 항목을 채우지 않습니다(Void Linux)

나는 Void Linux를 설치하기 위한 스크립트를 작성해 왔습니다(void-installer보다 더 세부적인 것이 필요합니다). UEFI에서는 문제 없이 Grub을 설치할 수 있지만 BIOS 설치가 작동하지 않습니다.

나는 grub-install /dev/sda잘 작동하지만 실행하면 grub-mkconfig -o /boot/grub/grub.cfgVoid 누락에 대한 메뉴 항목이 있는 구성이 생성됩니다(예: 다음에서 생성되어야 하는 블록)./etc/grub.d/10_linux(내가 확인한 것은 존재합니다)).

grub-mkconfig아마도 이것은 chroot 내부에서 실행 중이기 때문일 수 있지만 grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id="Void"잘 작동합니다. 그러나 이는 UEFI가 다르게 작동하기 때문일 수 있습니다.

이것은 부트로더 설치를 처리하는 스크립트의 함수입니다.

install_bootloader() {
    display_logo
    echo "------------------------------------"
    echo "(8) Install bootloader"
    echo "------------------------------------"
    read -p "Enter system architecture (x86_64|aarch64): " arch
    exit_if_0 $arch
    read -p "Enter system disk (e.g. /dev/sda): " disk
    exit_if_0 $disk
    read -p "Enter boot partition (e.g. /dev/sda1: " boot_partition
    exit_if_0 $boot_partition
    read -p "Enter boot partition scheme (boot|efi): " boot_scheme
    exit_if_0 $boot_scheme
    read -p "Enter root partition (e.g. /dev/sda2): " root_partition
    exit_if_0 $root_partition
    if [[ $boot_scheme == "efi" ]]; then
        if [[ $arch == "x86_64" ]]; then
            xbps-install grub-$arch-efi
        elif [[ $arch == "aarch64" ]]; then
            xbbps-install grub-arm64-efi
        fi
    fi
    if [[ $boot_scheme == "efi" ]]; then
        mkdir -p /efi
        mount -o rw,noatime $boot_partition /efi
        if [[ $arch == "x86_64" ]]; then
            grub-install --target=$arch-efi --efi-directory=/efi --bootloader-id="Void"
        elif [[ $arch == "aarch64" ]]; then
            grub-install --target=arm64-efi --efi-directory=/efi --bootloader-id="Void"
        fi
    elif [[ $boot_scheme == "boot" ]]; then
        mount -o rw,noatime $boot_partition /boot
        mkdir -p /boot/grub
        grub-install $disk
        sleep 3
        grub-mkconfig -o /boot/grub/grub.cfg
        sleep 3
    fi
    clear
}

이것은 내가 얻는 /boot/grub/grub.cfg입니다:

#
# 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
  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 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  446e6032-9198-4f85-aa98-252abfadbecb
else
  search --no-floppy --fs-uuid --set=root 446e6032-9198-4f85-aa98-252abfadbecb
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 [ 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/10_linux ###

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

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

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### 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 ###

어떤 아이디어가 있나요?

미리 감사드립니다.

답변1

grub-install 및 grub-mkconfig를 호출하기 직전에 /boot 파티션을 마운트하려고 시도했기 때문에 이는 필요하지 않은 것으로 나타났습니다. 마운트 호출을 제거하고 나중에 작동했습니다. 나는 공식 void-installer 스크립트를 보고 "chroot grub-install..." 및 "chroot grub-mkconfig..."를 호출해야 한다고 가정했지만 이는 사실이 아니고 단지 마운트일 뿐입니다.

관련 정보