Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/modules/signing/preimage.40.sign-firmware.sh
blob: 1f8093ea6dba87bd32ed7956b87fd51e7fce4cfb (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
# Copyright (C) 2010 One Laptop Per Child
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.

. $OOB__shlib
wkey=$(read_config signing wkey)
[[ -n "$wkey" ]] || exit 0

bios_crypto=$(read_config signing bios_crypto_path)
[ -n "$bios_crypto" -a -d "$bios_crypto" ] || exit 0

[ -e $fsmount/boot/bootfw.zip ] || exit 0

echo "Signing firmware..."

fwtmp=$intermediatesdir/fw-for-signing
mkdir -p $fwtmp
unzip -d $fwtmp $fsmount/boot/bootfw.zip
mv $fwtmp/data.img $intermediatesdir/fw.rom

outzip=$intermediatesdir/bootfw.zip
rm -f $outzip
pushd $bios_crypto/build
./sign-fw.sh $wkey $intermediatesdir/fw.rom $outzip
popd
mv $outzip $fsmount/boot/