diff options
author | Daniel Drake <dsd@laptop.org> | 2012-05-07 22:53:50 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2012-05-07 22:54:02 (GMT) |
commit | 2451409d872e6813404326ff750d5ad068b8c43d (patch) | |
tree | ec54410a86587c0d08e2fb304b9e8ee1d5a17c1f | |
parent | cd7afd34c8ab53f9487d9eb1d04b8d43576640c9 (diff) |
bootanim: update for plymouth-based boot animation
We now offer customisation through supplying a custom image to be
placed in the OLPC boot animation, or you can select your own plymouth
theme.
-rw-r--r-- | modules/bootanim/README | 40 | ||||
-rw-r--r-- | modules/bootanim/kspost.30.nochroot.bootanim.sh | 15 | ||||
-rw-r--r-- | modules/bootanim/prepare.90.bootanim.sh | 70 |
3 files changed, 28 insertions, 97 deletions
diff --git a/modules/bootanim/README b/modules/bootanim/README index 706baf5..9813709 100644 --- a/modules/bootanim/README +++ b/modules/bootanim/README @@ -1,28 +1,28 @@ -This module replaces the default OLPC boot animation images with your own. +This module allows customization of the OLPC boot animation. +There are two modes of customization available. -To use... +Firstly, you can add your own PNG image to the boot animation display. It +will be displayed at the bottom of the screen, center-aligned. Simply specify +the path to the file in the following manner: - - Install netpbm-progs +[bootanim] +custom_image=/path/to/custom/image - - Install the appropriate version of olpc-bootanim-tools from - http://xs-dev.laptop.org/~dsd/repos/ - - Download the relevant olpc-bootanim tarball from - http://dev.laptop.org/pub/source/olpc-bootanim/ - -- extract the images from the "images" subdirectory - - Prepare an images directory with your customized images -- the relevant - files are the frame*.png files and ul_warning.png . You must include them - all in your custom images directory. +Alternatively, if you wish to perform deeper customizations, you can include +your own plymouth theme and use it instead of the OLPC default. Plymouth is the +platform which the boot animation is built upon. It allows creation of boot +themes through a simple scripting language. +See the Plymouth theming guide (http://brej.org/blog/?p=158) for how to get +started. - - Add a section to your ini file: +If going down this route, you will first need to get your theme included +in the build image. You could package it in RPM format and use the +custom_packages module to include it. - [bootanim] - imgdir=/path/to/your/images-directory - - for example, if it is a 'bootanim' directory next to your - ini file, use - - [bootanim] - imgdir=%(oob_config_dir)s/bootanim +Then, simply specify the name of the theme in the configuration of this +module: +[bootanim] +theme=mytheme diff --git a/modules/bootanim/kspost.30.nochroot.bootanim.sh b/modules/bootanim/kspost.30.nochroot.bootanim.sh index 769392c..187eb19 100644 --- a/modules/bootanim/kspost.30.nochroot.bootanim.sh +++ b/modules/bootanim/kspost.30.nochroot.bootanim.sh @@ -3,12 +3,13 @@ . $OOB__shlib -cache=$cachedir/bootanim +custom_image=$(read_config bootanim custom_image) +theme=$(read_config bootanim theme) -STATIC_IMAGES="frame00.565 ul_warning.565" -FILES="$STATIC_IMAGES deltas" +if [ -n "$custom_image" ]; then + echo "cp $custom_image \$INSTALL_ROOT/usr/share/plymouth/themes/olpc/custom.png" +fi -for f in $FILES; do - echo "cp $cache/$f \$INSTALL_ROOT/usr/share/boot-anim/" -done -echo 'chmod 644 $INSTALL_ROOT/usr/share/boot-anim/*' +if [ -n "$theme" ]; then + echo "/usr/sbin/plymouth-set-default-theme $theme" +fi diff --git a/modules/bootanim/prepare.90.bootanim.sh b/modules/bootanim/prepare.90.bootanim.sh deleted file mode 100644 index ae651be..0000000 --- a/modules/bootanim/prepare.90.bootanim.sh +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (C) 2011 One Laptop Per Child -# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details. - -. $OOB__shlib - -imgdir=$(read_config bootanim imgdir) -cache=$cachedir/bootanim -cacheframes=$cachedir/bootanim-frames - -STATIC_IMAGES="frame00.png ul_warning.png" -FRAME_IMAGES="frame00.png frame01.png frame02.png frame03.png - frame04.png frame05.png frame06.png frame07.png frame08.png frame09.png - frame10.png frame11.png frame12.png frame13.png frame14.png frame15.png - frame16.png frame17.png frame18.png frame19.png frame20.png frame21.png - frame22.png frame23.png frame24.png frame25.png ul_warning.png" - -if [ -n "$imgdir" -a -e "$imgdir" ]; then - if [ ! -x '/usr/bin/ppmto565.py' -o ! -x '/usr/bin/calcdelta' ]; then - echo Please install olpc-bootanim-tools >&2 - exit 1 - fi - if [ ! -x '/usr/bin/pngtopnm' ]; then - echo Please install netpbm-progs >&2 - exit 1 - fi - mkdir -p "$cache" - mkdir -p "$cacheframes" - for img in $STATIC_IMAGES; do - src=$imgdir/$img - target=$cache/${img%.*}.565 - - # like make - if [ ! -e "$target" -o "$src" -nt "$target" ];then - echo "Processing $src" - pngtopnm "$src" | ppmto565.py -o "$target.tmp" - mv "$target.tmp" "$target" - fi - done - - rebuilddelta=0 - for img in $FRAME_IMAGES; do - src=$imgdir/$img - target=$cacheframes/${img%.*}.565 - - # like make - if [ ! -e "$target" -o "$src" -nt "$target" ];then - echo "Processing $src" - pngtopnm "$src" | ppmto565.py -o "$target.tmp" - mv "$target.tmp" "$target" - rebuilddelta=1 - fi - done - if [ "$rebuilddelta" == 1 -o ! -e "$cache/deltas" ];then - echo "Creating delta sequence" - # unfortunately, - tmpdir="/tmp/oob_bootanim.$$" - mkdir -p "$tmpdir" - pushd "$tmpdir" - for img in $FRAME_IMAGES; do - echo $cacheframes/${img%.*}.565 >> frames - done - # calcdelta reads a 'frames' file listing - # the files to process - echo calcdelta frames - calcdelta frames - mv deltas $cache/ - popd - rm -fr "$tmpdir" - fi -fi |