音樂播放器之 CD 轉成 mp3 之《補充》 Bootsplash??

220px-Fedora10_plymouth
二零零八年五月三十日
Plymouth DRM & KMS

220px-Inkscape046splash.svg
Splash Screen

Plymouth 』是 Linux 『開機動畫』Bootsplash 中比較先進的一種。它使用 DRM Direct Rendering Manager 以及基於核心的顯示模式設定 KMS Kernel mode setting 等技術,需要 kernel 支持『 INITRD 』 檔案系統,也就是說 kernel 編譯時 『 CONFIG_BLK_DEV_INITRD=y 』。它除了開機過程漂亮好看以外,還能在開機階段與使用者互動。最早是由『 Fedora 10 』 ── Cambridge ── 率先使用,取代行之多年的『 RHGB 』Red Hat Graphical Boot ,之後開始在 Linux 世界風行。事實是打從出現以來,就彷彿『神秘』無比,缺少『使用文件』??

由於之前『樹莓派』的 kernel 並不支持開機時之『 INITRD 』 檔案系統,於是有人提出啟動後『壁紙』 wallpaper 的辦法︰

安裝 fbi

sudo apt-get install fbi

因為『壁紙』是『圖片』,又是在『 FrameBuffer 』上,所以需要此 『圖片顯示』的程式,又因為開機前後『次序性』問題,因此也不能『太晚』或者說『過早』,也就只能如那作者所講的︰

Copy your custom splash image to /etc/ and name it “splash.png”.
Next, create an init.d script calledasplashscreen” in ” /etc/init.d/ .
I chose “asplashscreen” with an “a” at the beginning to be sure it starts first.

#! /bin/sh
### BEGIN INIT INFO
# Provides:          asplashscreen
# Required-Start:
# Required-Stop:
# Should-Start:      
# Default-Start:     S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description:       Show custom splashscreen
### END INIT INFO


do_start () {

    /usr/bin/fbi -T 1 -noverbose -a /etc/splash.png    
    exit 0
}

case "$1" in
  start|"")
    do_start
    ;;
  restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
  stop)
    # No-op
    ;;
  status)
    exit 0
    ;;
  *)
    echo "Usage: asplashscreen [start|stop]" >&2
    exit 3
    ;;
esac

假使想知道『那作者』之所言是否正確,請讀︰

more /etc/init.d/README

Configuration of System V init under Debian GNU/Linux

Most Unix versions have a file here that describes how the scripts
in this directory work, and how the links in the /etc/rc?.d/ directories
influence system startup/shutdown.

For Debian, this information is contained in the policy manual, chapter ” System run levels and init.d scripts “. The Debian Policy Manual is available at:

http://www.debian.org/doc/debian-policy/#contents

The Debian Policy Manual is also available in the Debian package “debian-policy”. When this package is installed, the policy manual can be found in directory /usr/share/doc/debian-policy. If you have a browser installed you can probably read it at file://localhost/usr/share/doc/debian-policy/ Some more detailed information can also be found in the files in the /usr/share/doc/sysv-rc directory. Debian Policy dictates that /etc/init.d/*.sh scripts must work properly
when sourced. The following additional rules apply:

* /etc/init.d/*.sh scripts must not rely for their correct functioning
on their being sourced rather than executed. That is, they must work
properly when executed too. They must include “#!/bin/sh” at the top.
This is useful when running scripts in parallel.

* /etc/init.d/*.sh scripts must conform to the rules for sh scripts as
spelled out in the Debian policy section entitled “Scripts” (§10.4).

Use the update-rc.d command to create symbolic links in the /etc/rc?.d as appropriate. See that man page for more details.

All init.d scripts are expected to have a LSB style header documenting
dependencies and default runlevel settings. The header look like this
(not all fields are required):

### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $portmap
# Should-Stop: $portmap
# X-Start-Before: nis
# X-Stop-After: nis
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO

More information on the format is available from insserv(8). This
information is used to dynamicaly assign sequence numbers to the
boot scripts and to run the scripts in parallel during the boot.
See also /usr/share/doc/insserv/README.Debian.

你將會發現『排序』的『重要性』,可以如此『登記』啟動程式︰

sudo chmod a+x /etc/init.d/asplashscreen
sudo insserv /etc/init.d/asplashscreen

至於夠不夠好,也許只能由人的吧!

sudo reboot

其後又有人將之改成影片播放︰

#! /bin/sh
### BEGIN INIT INFO
# Provides:          asplashscreen
# Required-Start:
# Required-Stop:
# Should-Start:      
# Default-Start:     S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description:       Show custom splashscreen
### END INIT INFO

do_start () {

    omxplayer /home/pi/video.mov &  
    exit 0
}

case "$1" in
  start|"")
    do_start
    ;;
  restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
  stop)
    # No-op
    ;;
  status)
    exit 0
    ;;
  *)
    echo "Usage: asplashscreen [start|stop]" >&2
    exit 3
    ;;
esac

 

 

─── 聽聞說『黑傑克』即將再現?? 或許… ───