summaryrefslogtreecommitdiff
path: root/examples/hooks/all_binary_debian-installer-banner.sh
blob: 61c160ca631a6f25248239d83e1a92e8dbf546d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

# This is an binary hook for live-build(7) to overwrite the banner
# in the graphical Debian Installer.
# To enable it, copy or symlink this hook into your config/binary_local-hooks
# directory and add a replacement banner.png at:
#
#  config/binary_debian-installer/banner.png
#
# The file should be a PNG image of dimensions 800 x 75.

set -e

if [ -e config/binary_debian-installer/banner.png ]
then
	TARGET_INITRD="binary/install/gtk/initrd.gz"
	REPACK_TMPDIR="binary.initrd"

	if [ -e "${TARGET_INITRD}" ]
	then
		# cpio does not have a "extract to directory", so we must change
		# directory
		mkdir -p ${REPACK_TMPDIR}
		cd ${REPACK_TMPDIR}
		gzip -d < ../${TARGET_INITRD} | cpio -i --make-directories --no-absolute-filenames

		# Overwrite banner
		cp ../config/binary_debian-installer/banner.png ./usr/share/graphics/logo_debian.png

		find | cpio -H newc -o | gzip -9 > ../${TARGET_INITRD}
		cd ..
		rm -rf ${REPACK_TMPDIR}
	fi
fi