Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/modules/signing/preimage.40.sign-os.sh
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2010-01-04 18:11:04 (GMT)
committer Daniel Drake <dsd@laptop.org>2010-01-04 18:11:04 (GMT)
commit6cc90b63ffe245e49adbad6725fed0746db5d96d (patch)
treef7b10ccf0792de7aebc6394fe46cf7299815b3b1 /modules/signing/preimage.40.sign-os.sh
parentc9fb11d7ca37b853641b9427d3d4981f9d139fdc (diff)
Finish signing module
Supports both external signing workflows and build-time signing.
Diffstat (limited to 'modules/signing/preimage.40.sign-os.sh')
-rw-r--r--modules/signing/preimage.40.sign-os.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/signing/preimage.40.sign-os.sh b/modules/signing/preimage.40.sign-os.sh
new file mode 100644
index 0000000..673927b
--- /dev/null
+++ b/modules/signing/preimage.40.sign-os.sh
@@ -0,0 +1,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
+okey=$(read_config signing okey)
+[[ -n "$okey" ]] || exit 0
+
+bios_crypto=$(read_config signing bios_crypto_path)
+[ -n "$bios_crypto" -a -d "$bios_crypto" ] || exit 0
+
+if [ -e "$fsmount/boot/vmlinuz" ]; then
+ echo "Signing kernel..."
+ pushd /tmp
+ $bios_crypto/build/sign-os.sh $okey $fsmount/boot/vmlinuz $fsmount/boot/runos.zip
+ popd
+ [ -e $fsmount/boot/actos.zip ] || ln -s runos.zip $fsmount/boot/actos.zip
+fi
+
+if [ -e "$fsmount/boot/initrd.img" ]; then
+ echo "Signing initramfs..."
+ pushd /tmp
+ $bios_crypto/build/sign-os.sh $okey $fsmount/boot/initrd.img $fsmount/boot/runrd.zip
+ popd
+ [ -e $fsmount/boot/actrd.zip ] || ln -s runrd.zip $fsmount/boot/actrd.zip
+fi
+