2 ###############################################################################
4 # Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
5 # Written by David Howells (dhowells@redhat.com)
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version
10 # 2 of the License, or (at your option) any later version.
12 ###############################################################################
16 if [ $# -gt 1 -a "x$1" = "x-v" ]
25 echo "usage: $0 [-v] <module_to_sign> [<key_name>]"
34 KEYFLAGS="--no-default-keyring --secret-keyring ../kernel.sec --keyring ../kernel.pub"
39 KEYFLAGS="$KEYFLAGS --default-key $2"
42 # strip out only the sections that we care about
43 scripts/modsign/mod-extract $verbose $module $module.out || exit $?
46 gpg --no-greeting $KEYFLAGS -b $module.out || exit $?
49 #gpg --verify rxrpc.ko.out.sig rxrpc.ko.out
52 #sha1sum $module.out | awk "{print \$1}" > $module.sha1
54 # add the encrypted data to the module
55 objcopy --add-section .module_sig=$module.out.sig $module $module.signed || exit $?
56 objcopy --set-section-flags .module_sig=alloc $module.signed || exit $?