Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Ubuntu 13.04 修改開機畫面 (Plymouth) 完整配置步驟與 CentOS 差異對比

編輯:Linux 系統常見問題解答

安裝 Plymouth

apt-get install plymouth

關鍵差異:Ubuntu vs CentOS 主題路徑

項目UbuntuCentOS
預設主題設定檔/lib/plymouth/themes/default.plymouth/etc/plymouth/plymouthd.conf
主題資源目錄/lib/plymouth/themes/<theme_name>//usr/share/plymouth/themes/<theme_name>/

Ubuntu 配置步驟

  1. 建立/編輯預設主題設定檔:
vim /lib/plymouth/themes/default.plymouth
# 內容如下:
[Plymouth Theme]
Name=Wheat
Description=A theme that features a wheat background with a logo.
ModuleName=script

[script]
ImageDir=/lib/plymouth/themes/wheat
ScriptFile=/lib/plymouth/themes/wheat/wheat.script
  1. 將自訂主題資源 (圖片、script 檔) 放置至 /lib/plymouth/themes/wheat/
  2. 修改 GRUB 開機參數啟用 splash:
vim /etc/default/grub
# 修改:
GRUB_CMDLINE_LINUX_DEFAULT="splash"
  1. 更新 GRUB 並重建 initramfs:
update-grub
update-initramfs -u
  1. 重開機驗證新開機畫面。

常見問題排除

  • 不生效:確認 update-initramfs -u 已執行,initramfs 才會包含新主題模組
  • 顯示亂碼/花屏:檢查主題 script 語法、圖片格式 (建議 PNG)、解析度與桌面環境相容性
  • Server 版無圖形介面:Plymouth 需 KMS (Kernel Mode Setting) 支援,確認核心參數未加 nomodeset

CentOS 7+ 參考配置 (補充)

# 設定預設主題
plymouth-set-default-theme -R solar
# -R 同時重建 initramfs

# 或手動編輯
vim /etc/plymouth/plymouthd.conf
# Theme=solar

# 重建 initramfs
dracut -f

自訂主題開發提示

Plymouth 主題使用 JavaScript-like 腳本 (.script),可參考 /lib/plymouth/themes/script/module-info 了解 API。簡單主題可修改現有 details 或 text 主題的圖片與顏色參數。

Copyright © Windows教程網 All Rights Reserved