1#!/bin/bash
2
3##########################################################################
4# Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
5# All rights reserved.
6#
7# This file is distributed under the terms in the attached LICENSE file.
8# If you do not find this file, copies can be found by writing to:
9# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
10##########################################################################
11
12if [ $# != 1 ] || [ ! -r $1 ]; then
13  echo Usage: $0 talk.pdf
14  exit 1
15fi
16
17set -e
18echo "Deleting and creating ./talk/"
19rm -rf talk && mkdir -p talk
20echo "Converting PDF talk to BMP files using ImageMagick..."
21convert -monitor -density 300 -resize 1024x768 -antialias $1 'talk/talk-%03d.bmp'
22echo "Done!"
23echo "Compressing bitmap files..."
24gzip talk/talk*.bmp
25echo "Creating cpio archive..."
26find talk | cpio -o > talk_ramfs.cpio
27echo "Removing ./talk/"
28rm -rf talk
29echo Done! Now append the line \"module /talk_ramfs.cpio\" to your menu.lst.
30
31# XXX: Old version that uses lots of menu.lst entries
32# npages=`ls -1 talk*.bmp.gz | wc -l`
33# for n in `seq 0 $(($npages - 1))`; do
34#   echo modulenounzip /talk/talk-$n.bmp.gz nospawn
35# done > talk_menu.lst
36
37# echo Done! Now append the contents of talk/talk_menu.lst to your menu.lst.
38# echo eg: "grep -v '/talk/' menu.lst > menu.lst.new ; cat menu.lst.new talk/talk_menu.lst > menu.lst"
39