summaryrefslogtreecommitdiff
blob: 0086237e839ae0a932592c05751a02222b439c15 (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
#!/bin/bash

SCRIPT_NAME="${0}"
KERNEL_VER="${1%/}"
HGPV_PATCH="${2}"
TAR="/bin/tar"
GPG="/usr/bin/gpg"
SIGNAS="basile"

################################################################################

die() {
	echo "$1"
	exit
}

sanity() {
	[[ -d "${KERNEL_VER}" ]]	|| die "Can't find ${KERNEL_VER} directory"
	[[ -e "${TAR}" ]]		|| die "Can't find tar"
	[[ -n "${HGPV_PATCH}" ]]	|| die "No HGPV patchlevel given"
}

################################################################################

sanity

HGPV="${KERNEL_VER}-${HGPV_PATCH}"
HGPV_TARBALL="hardened-patches-${HGPV}.extras.tar.bz2"

$TAR jcvf ${HGPV_TARBALL} ${KERNEL_VER}

$GPG -a -s -b --default-key $SIGNAS ${HGPV_TARBALL}