最後更新: 2018-03-13
目錄
設定解像度(gfxmode 與 gfxpayload)
gfxmode
If this variable is set, it sets the resolution used on the ‘gfxterm’ graphical terminal.
This variable is often set by "GRUB_GFXMODE"
# Only the modes supported by the graphics card via VESA BIOS Extensions can be used.
# 查看 VESA BIOS 支援什麼 Mode
# hwinfo --framebuffer
# Output
# Mode 0x0301: 640x480 (+640), 8 bits
# ....
# Mode 0x031a: 1280x1024 (+2560), 16 bits
GRUB_GFXMODE=640x480
/boot/grub/grub.cfg 會生成
if loadfont $font ; then set gfxmode=640x480 load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_HK insmod gettext fi
gfxpayload
If this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ‘vga=’ boot option (see linux).
It may be set to ‘text’ to force the Linux kernel to boot in normal text mode, ‘keep’ to preserve the graphics mode set using ‘gfxmode’,
or any of the permitted values for ‘gfxmode’ to set a particular graphics mode
This variable is often set by "GRUB_GFXPAYLOAD_LINUX"
設定 /etc/default/grub 後
GRUB_GFXPAYLOAD_LINUX=1280x1024
/boot/grub/grub.cfg 會生成
set linux_gfx_mode=1280x1024
export linux_gfx_mode
menuentry 'Ubuntu' ... {
recordfail
load_video
gfxmode $linux_gfx_mode
...
BACKGROUND Image
[方法1: 自定 Image]
/etc/default/grub
GRUB_BACKGROUND=
update-grub
[方法2: 放 Image 入 Folder]
Image Location:
/boot/grub
update-grub
Generating grub configuration file ... Found background image: bg.jpg Found linux image: /boot/vmlinuz-4.4.0-116-generic Found initrd image: /boot/initrd.img-4.4.0-116-generic done
Image Priority
1. GRUB_BACKGROUND setting in /etc/default/grub
2. First image(jpg, JPG, jpeg, JPEG, png, PNG, tga, TGA) found in /boot/grub
3. Wallpaper designated in /usr/share/desktop-base/grub_background.sh
Remark
[1]
make sure that GRUB_TERMINAL=console is commented out.
The graphical mode will not be enabled if this is uncommented.
[2]
# 負責設定 Grub Theme 的 Script
/etc/grub.d/05_debian_theme
... if [ -n "${GRUB_BACKGROUND+x}" ]; then set_background_image "${GRUB_BACKGROUND}" || set_default_theme exit 0 fi ... for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do if set_background_image "${background}"; then exit 0 fi done
Change Color
menu_color_highlight=fg-color/bg-color
The color of the highlighted menu entry and its background within the menu box
menu_color_normal=fg/bg
The color of non-selected menu entry and its background within the menu box
color_normal=fg/bg
The color of text and background outside the menu box
Each color must be a name from the following list:
black
blue
green
cyan
red
magenta
brown
light-gray
dark-gray
light-blue
light-green
light-cyan
light-red
light-magenta
yellow
white
Testing
1. Reboot OS
2. Pass "c" to shell ("grub>")
set color_normal=light-cyan/black
41_custom
/etc/grub.d/41_custom
#!/bin/sh cat <<EOF 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 EOF
/boot/grub/custom.cfg
set color_normal=light-cyan/black set color_highlight=black/light-gray
If you configured /boot/grub/custom.cfg, there is no need to run update-grub;
the file will be automatically loaded by /boot/grub/grub.conf at boot.
Set the resolution in text consoles
echo "FRAMEBUFFER=y" >> /etc/initramfs-tools/conf.d/splash
update-initramfs -u
update-grub
# Change Encoding & CharacterSet & FontSize
dpkg-reconfigure console-setup
Kernel Splash Screen - plymouth-themes
Uses KMS (Kernel Mode Setting) (where possible) and the framebuffer to set the screen resolution.
安裝
apt install plymouth-themes
Comprises 3 components:
A daemon (server) process called plymouthd
The daemon is responsible for the graphical display, animation and logging.
A client application called plymouth
The client sends commands to the daemon
A library libply.so to allow applications to be written to talk to the daemon
(The plymouth command is linked to libply.so for this reason).
ls /usr/share/plymouth/themes
default.plymouth details fade-in glow script solar spinfinity spinner text text.plymouth tribar ubuntu-text
vt.handoff
A kernel boot parameter unique to Ubuntu
telling the kernel to start with this graphical display on VT7 instead of the default of VT1.
cat /proc/cmdline
vt.handoff=7
/boot/grub/grub.cfg
function gfxmode { set gfxpayload="${1}" if [ "${1}" = "keep" ]; then set vt_handoff=vt.handoff=7 else set vt_handoff= fi }
因為 boot 機畫面在 7 Display
更改 Theme
plymouth-theme-ubuntu-text
update-alternatives --config text.plymouth