*GUIDE* Use custom boot screens

Hello all, first real post here, so I hope I do everything correctly.   First off, kudos to the RasPlex team!  This is amazing work, and has benefited many. 

 

I am developing a solution for a custom boombox I am making, and I wanted to have a custom bootup screen to better match the aesthetic of my 80's style boombox. (it has a TV... it's that cool)  I found many solutions for modifying the first bootup image, but nothing for modifying the second boot image.  After much searching, and finding different topics, I finally found the solution for modifying both of them.  Unfortunately, there were too many sources, and I didn't do a good job of keeping track of them.  But thank you for everybody who has posted information that I was able to use in order to scrape together a solution. 

 

If the devs don't want this info out here, feel free to delete it.  But I figure we're all geeks here, and geeks love to share.

 

First, to accomplish this, you will need a linux system, or a linux virtual machine.  This is necessary for a couple of the tools necessary for getting at the filesystem.  I personally am using a Ubuntu virtual machine on my mac mini.  Insert the SD card in to your computer, if this is a virtual machine, make sure to pass the SD reader to the virtual machine so that it can access the SD card.  Linux should auto-mount it, each distribution is different for where it places mounts.  But I'll assume a level of knowledge for anybody attempting this to be above average, so most of this will be old hat.  

 

On my system it mounted as:

/dev/sdb1 on /media/parallels/System type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)

Within the mount point is the location of the first boot screen:

parallels@ubuntu:/media/parallels/System$ ls -l
total 226304
-rw-r--r-- 1 parallels parallels      4379 Feb 10 10:42 bcm2708-rpi-b.dtb
-rw-r--r-- 1 parallels parallels      4658 Feb 10 10:42 bcm2708-rpi-b-plus.dtb
-rw-r--r-- 1 parallels parallels     17856 Feb 10 10:42 bootcode.bin
-rw-r--r-- 1 parallels parallels        58 Feb 10 10:42 cmdline.txt
-rw-r--r-- 1 parallels parallels      4971 Apr 30 15:35 config.txt
-rw-r--r-- 1 parallels parallels      9191 Feb 10 10:42 fixup.dat
-rw-r--r-- 1 parallels parallels   4799852 Feb 10 10:42 kernel.img
-rw-r--r-- 1 parallels parallels      1447 Feb 10 10:42 LICENCE.broadcom
-rw-r--r-- 1 parallels parallels    173222 Apr 29 04:19 oemsplash.png
-rw-r--r-- 1 parallels parallels     32511 Feb 10 10:42 openelec.ico
drwx------ 2 parallels parallels      4096 Feb 10 10:42 overlays
-rw-r--r-- 1 parallels parallels      3832 Feb 10 10:42 README.md
-rw-r--r-- 1 parallels parallels   3598952 Feb 10 10:42 start.elf
-rw-r--r-- 1 parallels parallels 111525888 Apr 29 18:21 SYSTEM

It will not be on a system with the original boot logo, but you will need to add your logo with the name 'oemsplash.png' (make sure it's actually a png file, not just named that).  I am not aware what file formats it will accept, but the instructions I found used a png and that works, so I didn't question it too much further.  

 

Here are the relevant file details:

parallels@ubuntu:/media/parallels/System$ file oemsplash.png 
oemsplash.png: PNG image data, 1280 x 720, 8-bit/color RGB, non-interlaced

Now that that is done, you can unmount the SD card, put it back in the Pi and marvel at your new boot logo! Have a beer, celebrate, then frown in defeat as you see the boot logo change to not-your-image on the second half of boot.  Fret not, put the SD card back in the reader, mount it on your linux machine and go back in the root folder of the SYSTEM partition, same as before.

 

This time, we will need the SYSTEM file:

parallels@ubuntu:/media/parallels/System$ ls -l
total 226304
...
-rw-r--r-- 1 parallels parallels 111525888 Apr 29 18:21 SYSTEM

Copy that file to somewhere on your linux drive, into its own directory so that things can be kept clean.  

 

I did this with the following steps:

parallels@ubuntu:/media/parallels/System$ mkdir /home/parallels/Desktop/rasplex
parallels@ubuntu:/media/parallels/System$ cp SYSTEM /home/parallels/Desktop/rasplex
parallels@ubuntu:/media/parallels/System$ cd /home/parallels/Desktop/rasplex/
parallels@ubuntu:~/Desktop/rasplex$ ls -l
total 108912
-rw-r--r-- 1 parallels parallels 111525888 May 18 22:14 SYSTEM
parallels@ubuntu:~/Desktop/rasplex$ file SYSTEM 
SYSTEM: Squashfs filesystem, little endian, version 4.0, 111524392 bytes, 9687 inodes, blocksize: 131072 bytes, created: Wed Apr 29 19:21:46 2015 

You can see by the file type that this is the Squashfs filesystem that RasPlex uses.  There are likely some packages that you will need to install in order to the do the next steps, but it has been quite a while since I first did this so I forget what they are exactly.  Just google "linux unsquashfs apt-get" and you'll find the appropriate commands.

 

So, first step to changing the second boot logo is getting at the filesystem.  We must unsquash the squashfs, do this with super user privileges.

parallels@ubuntu:~/Desktop/rasplex$ sudo unsquashfs SYSTEM
[sudo] password for parallels: 
Parallel unsquashfs: Using 2 processors
7928 inodes (9278 blocks) to write

[=========================================================================================================-] 9278/9278 100%
created 7528 files
created 1761 directories
created 397 symlinks
created 1 devices
created 0 fifos
total 108916
parallels@ubuntu:~/Desktop/rasplex$ ls -l
drwxr-xr-x 15 root root 4096 Feb 10 04:42 squashfs-root
-rw-r–r-- 1 parallels parallels 111525888 May 18 22:14 SYSTEM
parallels@ubuntu:~/Desktop/rasplex$

Now we have a directory that contains the entire RasPlex filesystem called squashfs-root, neat!

 

The second boot image is in squashfs-root/usr/share/xbmc/media/ called Splash.png.  

parallels@ubuntu:~/Desktop/rasplex$ cd squashfs-root/
parallels@ubuntu:~/Desktop/rasplex/squashfs-root$ ls
berryboot-init  bin  dev  etc  flash  lib  media  opt  proc  run  sbin  splash  storage  sys  tmp  usr  var
parallels@ubuntu:~/Desktop/rasplex/squashfs-root$ cd usr
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr$ ls
bin  config  etc  include  lib  libexec  sbin  share  var  www
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr$ cd share
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share$ ls
avahi       connman  doc     fontconfig  locale  misc     systemtap  usb.ids  xml
bootloader  dbus-1   ffmpeg  fonts       man     pci.ids  terminfo   xbmc     zoneinfo
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share$ cd xbmc
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc$ ls
addons  advancedsettings.xml  guisettings.xml  language  media  sounds  system  tools  userdata
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc$ cd media
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc/media$ ls
AppIcon.png  icon32x32.png   icon-flat-256x256.png  weather.zip Fonts        
icon-flat-120x120.png  icon.png      Splash.png       Splash-RPI.png       xbmc.icns
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc/media$ file Splash.png
Splash.png: PNG image data, 1280 x 720, 8-bit/color RGB, non-interlaced 
It has the same file format as previous.  I renamed the original and copied my own image in the directory as Splash.png.
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc/media$ sudo mv Splash.png Splash-orig.png 
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc/media$ sudo cp ../../../boot-logo.png ./Splash.png
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc/media$ ls
AppIcon.png  icon32x32.png   Splash-orig.png icon-flat-256x256.png  weather.zip Fonts        
icon-flat-120x120.png  icon.png      Splash.png       Splash-RPI.png       xbmc.icns
Now that we have added our custom image to this folder, we must go back to the original working directory where we first unsquashed the filesystem.  Then we will backup the original SYSTEM image and then create a new squashfs SYSTEM image.  
parallels@ubuntu:~/Desktop/rasplex/squashfs-root/usr/share/xbmc/media$ cd ../../../../..
parallels@ubuntu:~/Desktop/rasplex$ ls
squashfs-root  SYSTEM
parallels@ubuntu:~/Desktop/rasplex$ mv SYSTEM SYSTEM.old
parallels@ubuntu:~/Desktop/rasplex$ ls
squashfs-root  SYSTEM.old
parallels@ubuntu:~/Desktop/rasplex$ sudo mksquashfs squashfs-root SYSTEM
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on SYSTEM, block size 131072.
[=========================================================================================================/] 8882/8882 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
compressed data, compressed metadata, compressed fragments, compressed xattrs
duplicates are removed
Filesystem size 108910.54 Kbytes (106.36 Mbytes)
42.27% of uncompressed filesystem size (257657.83 Kbytes)
Inode table size 88008 bytes (85.95 Kbytes)
27.54% of uncompressed inode table size (319571 bytes)
Directory table size 93474 bytes (91.28 Kbytes)
41.17% of uncompressed directory table size (227044 bytes)
Number of duplicate files found 544
Number of inodes 9689
Number of files 7530
Number of fragments 576
Number of symbolic links 397
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 1761
Number of ids (unique uids + gids) 2
Number of uids 1
root (0)
Number of gids 2
root (0)
unknown (81)
parallels@ubuntu:~/Desktop/rasplex$ ls
squashfs-root SYSTEM SYSTEM.old

All that is left to do is put the SYSTEM image file on the SD card and then boot the Pi off of it.  Since we have a copy of the SYSTEM file in the directory created to work in the squashfs filesystem, I am simply overwriting the original SYSTEM file on the SD card with the new one. 

parallels@ubuntu:~/Desktop/rasplex$ ls /media/parallels/System
bcm2708-rpi-b.dtb       bootcode.bin  config.txt  kernel.img        oemsplash.png  overlays   start.elf
bcm2708-rpi-b-plus.dtb  cmdline.txt   fixup.dat   LICENCE.broadcom  openelec.ico   README.md  SYSTEM
parallels@ubuntu:~/Desktop/rasplex$ sudo mv SYSTEM /media/parallels/System/
mv: failed to preserve ownership for ‘/media/parallels/System/SYSTEM’: Operation not permitted
parallels@ubuntu:~/Desktop/rasplex$ umount /media/parallels/System
parallels@ubuntu:~/Desktop/rasplex$ umount /media/parallels/Storage
parallels@ubuntu:~/Desktop/rasplex$ 

Don't worry about that error on transfer, we don't need permissions to copy over, it's because it's a vfat filesystem, I believe. In order to safely remove the SD card it must first be unmounted, unless you want a corrupt SD card.  There are actually two partitions mounted System and Storage, unmount both before removing the SD card.  

 

Put the card in your Pi, boot up, and cheer at the sky when both of the boot logos are showing up in all the glory that your Kitten Photoshopping skills could muster.  

 

If anything goes wrong and you're left with an unbootable RasPlex system, curse my name, then put the SD card back to the linux system and put the old SYSTEM file in place of the new one that did not work on the SD card.