Replacing the shutdown screen: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Link to bootanim page.)
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
See also: [[Tweaking the boot animation]].
See also: [[Tweaking the boot animation]] and [[Bootanim]].


The UL warning image displayed during shutdown can be modified by replacing the file
The UL warning image displayed during shutdown can be modified by replacing the file
Line 6: Line 6:


For example, you might wish to try: [http://dev.laptop.org/~cscott/modified-shutdown.565 modified-shutdown.565].
For example, you might wish to try: [http://dev.laptop.org/~cscott/modified-shutdown.565 modified-shutdown.565].

Note that 565-format images seem very large, but we use a compressing filesystem which slims them down nicely.


On a linux system, you can convert 1200x900 PNG images to 565-format images as follows:
On a linux system, you can convert 1200x900 PNG images to 565-format images as follows:


$ yum -y install netpbm-progs
$ yum -y install netpbm-progs
$ pngtopnm myfile.png | ./ppmto565.py > myfile.565
$ pngtopnm myfile.png | ./ppmto565.py -z -o myfile.565
using the following python script named 'ppmto565.py':
<pre><nowiki>
#!/usr/bin/python2.5
"""Convert PPM-format images to 565-format."""
from __future__ import division, with_statement
import sys


Using the <code>ppmto565.py</code> script found at http://dev.laptop.org/~cscott/ppmto565.py
def eat_comment(inf): # just read #, read until next EOL
while True:
c = inf.read(1)
if c == '\n' or c == '\r': break # read to EOL
return c


On core OS versions prior to 8.2, you must omit the -z option. The resulting raw 565-format files seem large, but we use a compressing filesystem on the XO which slims them down nicely.
def read_token(inf):
# eat up leading whitespace
while True:
c = inf.read(1)
if c == '#': eat_comment(inf)
elif not c.isspace(): break
# now read in non-whitespace.
s = c
while True:
c = inf.read(1)
if c == '#': c = eat_comment(inf)
if c.isspace(): break
s += c
# done!
return s


To disable the shutdown screen entirely (for debugging, for instance), use:
def main(inf, outf):
chkconfig ul-warning off
import struct
The shutdown screen will still appear on the next shutdown, but will not appear on subsequent shutdowns.
# read ppm from input
magic = inf.read(2)
assert magic == 'P6'
width = int(read_token(inf))
height = int(read_token(inf))
maxval = int(read_token(inf))
unpackstr = '!3B' if maxval < 256 else '!3H'
unpacklen = struct.calcsize(unpackstr)
# write header
outf.write(struct.pack('@IIP', width, height, 0))
# read pixel data, convert, and write it to output
def scale(x, y): return int((y*x/maxval)+0.5)
for y in xrange(0, height):
for x in xrange(0, width):
red, green, blue = struct.unpack(unpackstr, inf.read(unpacklen))
encoded = (scale(red, 0x1f) << 11) + \
(scale(green, 0x3f) << 5) + \
(scale(blue, 0x1f))
outf.write(struct.pack('@H', encoded))


Our UL certification requires us to display this warning; please do not disable the screen in deployed laptops unless for personal use only.
if __name__ == '__main__':
import sys
main(sys.stdin, sys.stdout)
</nowiki></pre>

Latest revision as of 00:00, 1 May 2009

See also: Tweaking the boot animation and Bootanim.

The UL warning image displayed during shutdown can be modified by replacing the file

/usr/share/boot-anim/ul_warning.565

with an appropriate alternative, in 1200x900 "565" format.

For example, you might wish to try: modified-shutdown.565.

On a linux system, you can convert 1200x900 PNG images to 565-format images as follows:

$ yum -y install netpbm-progs  
$ pngtopnm myfile.png | ./ppmto565.py -z -o myfile.565

Using the ppmto565.py script found at http://dev.laptop.org/~cscott/ppmto565.py

On core OS versions prior to 8.2, you must omit the -z option. The resulting raw 565-format files seem large, but we use a compressing filesystem on the XO which slims them down nicely.

To disable the shutdown screen entirely (for debugging, for instance), use:

chkconfig ul-warning off

The shutdown screen will still appear on the next shutdown, but will not appear on subsequent shutdowns.

Our UL certification requires us to display this warning; please do not disable the screen in deployed laptops unless for personal use only.