====== How does Splashy work? ====== ===== Booting ===== First of all your PC boots using a bootloader such as grub or lilo. The bootloader then loads and runs a kernel and possibly an initrd. ==== Splashy from initrd ==== - The initrd is uncompressed into a ramdisk (ExamineInitrdContents) and starts to run the init command (a shell script). - This creates directories in the ramdisk and does some temporary RAM filesystem setup. - Then it runs udev (etc/udev/udev.conf) and sets up some script functions (scripts/functions) for the init scripts. - init then looks at the kernel command line options and processes them (eg nfsroot, ro, resume, quiet, panic, break=breakpoint etc) - init has several 'hook' points where it runs externally provided scripts (on Debian): - **init-bottom** **init-premount** **init-top** **local** **local-bottom** **local-premount** **local-top** - init begins to run the first of these; the 'top' ones in **scripts/init-top/...** And that's where Splashy gets in on the act. - There are 2 scripts: framebuffer and splashy - There are no dependencies specified so init runs them in alphabetic order: - framebuffer is provided by initramfs-tools and processes the **video=** and **modprobes** the specified framebuffer device. - There is a slight problem that if it sees 'splash*' on the kernel line then it assumes usplash and sets the framebuffer to use the vga16fb module. For this reason, the **video=** or **vga=** option must come *after* the Splashy option on the kernel command line. - The Splashy script is quite basic and simply looks for '**splash***' and '**single**' on the command line, exiting for single user mode or if Splashy is not wanted. - If it continues than it is hardcoded to **modprobe** both **fbcon** and **vesafb.** (ugh - I use neofb so need to hack this file!) - Finally splashy is started in boot mode where it paints the splash screen and waits for updates. This is very early on in the init process. - init then continues doing it's normal stuff. - At the end of this stage the //initrd// **init** passes control over to **run-init** which deletes the initramfs from memory, mounts the real root filesystem and passes control to the **/sbin/init** program on it. - The boot process then continues as if it were a normal init. ==== Normal init ==== - The normal init scripts use the shell functions defined in **/lib/lsb/init-functions** to do logging etc. That file however sources a Splashy file called: **/etc/lsb-base-logging.sh**. Here the lsb **log_end_msg()** function is changed to call **splashy_update** to update the progress bar. - **init.d/splashy** then gets run as soon as possible by the real **init** (e.g. in **/etc/rcS.d/03splashy**). This script counts the number of **log_end_msg()**'s calls in the current runlevel (so each call progresses the bar the right amount) and starts Splashy in boot mode unless it is already running from [[#splashy_from_initrd|initrd]]. - The **log_end_msg()** function determines when Splashy has reached **100%** and tells Splashy to stop. ===== Shutdown ===== The shutdown process is essentially the same in reverse. - **/etc/init.d/splashy** is called from **/etc/rc6.d/K01splashy** or **/etc/rc0.d/K01splashy** with **stop** as its argument. - This triggers Splashy to run in **shutdown** mode (progressbar in reverse) - On LSB systems, Splashy steps are calculated by **/etc/lsb-base-logging.sh** as before and each time a call to **log_end_msg()** is done, a step is added to the progressbar, which it's painted in reverse