Boot

GRUB 錯誤 - 找不到合適的影片模式

  • February 4, 2022

我最近做了一個 LFS,並對 GRUB 做了一些改動。我添加了 update-grub 命令。我可以設置背景顏色和突出顯示顏色。但是當我添加一個自定義
update-grub主題時 - 給 -

正在生成 grub 配置文件…

找到主題:/boot/grub/theme/dark_squares/theme.txt

找到 linux 映像:/boot/vmlinuz

找到 initrd 映像:/boot/initrd.img-no-kmods

done

看起來挺好的。不是嗎?

但是,當我重新啟動時,一些錯誤閃爍得太快,但它可以正常啟動。但是,我設法(不要問如何)閱讀錯誤-

錯誤:/boot/grub/fonts/unicode.pf2找不到文件。

錯誤:找不到合適的影片模式

這是我的/etc/default/grub——

# If you change this file, run grub-mkconfig -o /boot/grub/grub.cfg
# afterwards to update /boot/grub/grub.cfg.
GRUB_DEFAULT="0"
GRUB_SAVE_DEFAULT="true"
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET="false"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Papiya`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
GRUB_THEME=/boot/grub/theme/dark_squares/theme.txt
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# Select the terminal output device. You may select multiple devices                 here,
# separated by spaces.
# Valid terminal output names depend on the platform, but may include ‘console’
# (PC BIOS and EFI consoles), ‘serial’ (serial terminal), ‘gfxterm’     (graphics-mode
# output), ‘ofconsole’ (Open Firmware console), or ‘vga_text’ (VGA text output,
# mainly useful with Coreboot).
# The default is to use the platform's native terminal output. 
GRUB_TERMINAL_OUTPUT="gfxterm"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="1024x768x32"
# If graphical video support is required, either because the ‘gfxterm’ graphical
# terminal is in use or because ‘GRUB_GFXPAYLOAD_LINUX’ is set, then grub-mkconfig
# will normally load all available GRUB video drivers and use the one most
# appropriate for your hardware. If you need to override this for some reason,
# then you can set this option. After grub-install has been run, the available
# video drivers are listed in /boot/grub/video.lst. 
GRUB_VIDEO_BACKEND="vbe"
# Uncomment to select a font to use
#GRUB_FONT_PATH="/boot/grub/DejaVuSansMono.pf2"
# Set a background image for use with the ‘gfxterm’ graphical terminal. The value
# of this option must be a file readable by GRUB at boot time, and it must end
# with .png, .tga, .jpg, or .jpeg. The image will be scaled if necessary to fit
# the screen.
#GRUB_BACKGROUND="/usr/share/grub_backgrounds/magnetar_1024x768.jpg"
# Set to ‘text’ to force the Linux kernel to boot in normal text mode, ‘keep’ to
# preserve the graphics mode set using ‘GRUB_GFXMODE’, ‘widthxheight’[‘xdepth’] to
# set a particular graphics mode, or a sequence of these separated by commas or
# semicolons to try several modes in sequence. See gfxpayload.
#
# Depending on your kernel, your distribution, your graphics card, and the phase of
# the moon, note that using this option may cause GNU/Linux to suffer from various 
# display problems, particularly during the early part of the boot sequence. If you
# have problems, set this option to ‘text’ and GRUB will tell Linux to boot in
# normal text mode. 
GRUB_GFXPAYLOAD_LINUX="keep"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entrys
#GRUB_DISABLE_LINUX_RECOVERY="true"
# Uncomment to get a beep at grub start
GRUB_INIT_TUNE="480 440 1"

通過將unicode.pf2文件複製到/boot/grub/fonts.

來源

在我的情況下,我試圖使用 GRUB 命令行(沒有grub.cfg文件)啟動,所以我必須載入影片模組才能讓我的 TinyCore 啟動:

insmod all_video

沒有這個,我得到與 OP 相同的錯誤。

但是,正如Aniket Bhattacharyea回答的那樣,我還必須手動複製unicode.pf2文件/boot/grub/fonts才能terminal_output gfxterm輸出有效字元。

引用自:https://unix.stackexchange.com/questions/271101