This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / scripts / modsign / modsign.sh
1 #!/bin/bash
2
3
4 if [ $# = "0" ] ; then
5         echo
6 #       echo "usage: $0 <module_to_sign> <key_name>"
7         echo "usage: $0 <module_to_sign>"
8         echo
9         exit 1
10 fi
11
12 module=$1
13 #key=$2
14
15 # strip out only the sections that we care about
16 sh scripts/modsign/mod-extract.sh $module $module.out
17
18 # sign the sections
19 #gpg --no-greeting --default-key $key -b $module.out
20 gpg --no-greeting --no-default-keyring --secret-keyring ../kernel.sec --keyring ../kernel.pub -b $module.out
21
22 # check the signature
23 #gpg --verify rxrpc.ko.out.sig rxrpc.ko.out
24
25 ## sha1 the sections
26 #sha1sum $module.out | awk "{print \$1}" > $module.sha1
27 #
28 ## encrypt the sections
29 #gpg --no-greeting -e -o - -r $key $module.sha1 > $module.crypt
30
31 # add the encrypted data to the module
32 #objcopy --add-section module_sig=$module.crypt $module $module.signed
33 objcopy --add-section module_sig=$module.out.sig $module $module.signed
34 objcopy --set-section-flags module_sig=alloc $module.signed
35 rm -f $module.out*