====== A new enhanced bootsplash ====== * Student: [[/SeiyaNuta|SeiyaNuta]] (seiya@) * Mentor: [[/KrisMoore|KrisMoore]] (kmoore@) ===== Testing this bootsplash ===== ==== 1. build kernel ==== $ cd /tmp $ svn co https://socsvn.freebsd.org/socsvn/soc2014/seiya/bootsplash bsplash $ cd bsplash/sys/amd64/conf $ cp GENERIC BSPLASH $ echo 'device bsplash' >> BSPLASH $ config -d /tmp/build BSPLASH $ cd /tmp/build $ MAKESYSPATH=/tmp/bsplash/share/mk make -j2 KERNCONF=BSPLASH ==== 2. install the kernel ==== # cd /boot # cp -r kernel kernel.old # cd /tmp/bsplash # MAKESYSPATH=/tmp/bsplash/share/mk make -j2 install ==== 3. add a theme for testing ==== # cd /tmp # pkg install ImageMagick python py27-pillow # git clone https://github.com/nuta/bsplash-utils.git utils # cd utils/test # make enable ==== 4. replace /etc/rc ==== # cp /etc/rc /etc/rc.old # cp /tmp/bsplash/etc/rc /etc/rc ==== 5. replace /boot/defaults/loader.conf ==== # cd /boot/defaults # cp loader.conf loader.conf.old # cp /tmp/bsplash/sys/boot/forth/loader.conf loader.conf ==== 5. run bsplash-fix-grub-cfg (only for GRUB users) ==== # cd /tmp/utils # bsplash-fix-grub-cfg /boot/loader.conf /boot/grub/grub.cfg > tmp # mv tmp /boot/grub/grub.cfg ==== 6. reboot and enjoy bootsplash ==== ===== Project description ===== I propose a new bootsplash mechanism. Currently, we can enable bootsplash by adding few options such as splash_bmp_load to /boot/loader.conf but it only displays an image file so I cannot reassure that the system works well. Therefore, I want to develop a new bootsplash mechanism which enables enhancements of attractiveness, such as progress bar. I think this will greatly improve user experience. I’m planning to implement this using src/sys/dev/fb, SYSINIT and kernel module system. ===== Approach to solving the problem ===== ==== kernel ==== A bootsplash system follows configurations in /boot/splash/foo/loader.conf like this: bsplash_image_name="/boot/splash/foo/image.bmp" bsplash_image_load="YES" bsplash_background_y_origin="0" bsplash_progress_bar_y_origin="800" bsplash_progress_bar_height="30" bsplash_progress_bar_width="500" bsplash_animation_y_origin="1100" bsplash_animation_height="300" bsplash_animation_width="300" bsplash_animation_repeat="YES" ==== userland utilities ==== * ''%%bsplash-create%%'' loads theme.conf and generates configuration for /boot/loader.conf and generates an image just like CSS sprites. * ''%%bsplash-install%%'' copies files generated by ''%%bsplash-create%%'' into /boot/splash. * ''%%bsplash-change%%'' overwrites bsplash configuration in /boot/loader.conf with /boot/splash/''%%theme-name%%''/loader.conf. # # example: create a theme named "foobar" and then change bootsplash to this # $ cat /boot/loader.conf if_em_load="YES" autoboot_delay="1" ### bsplash start ### bsplash_image_name="/boot/splash/foo/image.bmp" bsplash_image_load="YES" # configuration continues... ### bsplash end ### $ ls background.bmp background.bmp $ ls animation*.bmp animation0.bmp animation10.bmp animation12.bmp animation14.bmp animation2.bmp animation4.bmp animation6.bmp animation8.bmp animation1.bmp animation11.bmp animation13.bmp animation3.bmp animation5.bmp animation7.bmp animation9.bmp $ ls progressbar*.bmp progressbar0.bmp progressbar20.bmp progressbar40.bmp progressbar60.bmp progressbar80.bmp progressbar10.bmp progressbar30.bmp progressbar50.bmp progressbar70.bmp progressbar90.bmp # create $ bsplash-create --background=background.bmp \ --progress-bar='progressbar*.bmp' \ --animation='animation*.bmp' \ --repeat-animation \ image.bmp loader.conf # install $ sudo bsplash-install foobar image.bmp loader.conf # change to foobar $ sudo bsplash-change foobar $ cat /boot/loader.conf if_em_load="YES" autoboot_delay="1" ### bsplash start ### bsplash_image_name="/boot/splash/foobar/image.bmp" bsplash_image_load="YES" # configuration continues... ### bsplash end ### ===== Deliverables ===== * Implementation of a new bootsplash mechanism in the kernel * scripts for creating bootsplash themes * Example themes ===== Milestones ===== ^ period ^ milestone ^ status ^ | May 19 - May 25 | implement direct drawing | done | | May 26 - June 8 | add changes to src/sys | done | | June 9 - June 15 | write Makefile and scripts for creating themes | done | | June 16 - June 22 | create and enjoy a flip book in bootsplash using direct drawing | done | | June 23 - June 29 | work on unimplemented features (e.g. support RLE4) | done | | June 28 | Mid-term evaluation deadline || | June 30 - July 6 | develop userland utilities | done | | July 7 - July 20 | support drawing animation in a part of screen | done | | July 21 - July 27 | support progress bar | done | | July 28 - 'pencils down' date | create themes and refactoring | done | | August 18 | End of coding (hard) || ===== Test Plan ===== ==== #1 ==== * Write code in VM on [[/VirtualBox|VirtualBox]] * ''%%make%%'' and copy generated kernel and modules to /boot * Launch .vdi of the VM with QEMU on host OS * Check output and dmesg ==== #2 ==== * ''%%make buildinstall%%'' on a real machine. * boot it * check output and dmesg ===== The Code ===== * https://svnweb.freebsd.org/socsvn/soc2014/seiya * https://github.com/nuta/bsplash-utils