-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzip
executable file
·52 lines (44 loc) · 1022 Bytes
/
zip
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# File containing the following:
#
# ANYKERNEL=/path/to/anykernel
# OUTPUT=/path/to/output
#
SETTINGS=~/bin/paths-kernel.sh
# zImage location within kernel tree
ZIMAGE=arch/arm/boot/zImage
if [ -f ~/bin/paths-kernel.sh ]; then
source ~/bin/paths-kernel.sh
else
echo "Settings file ('$SETTINGS') doesn't exist. Aborting."
exit 1
fi
if [ -z ${ANYKERNEL+x} ]; then
echo "ANYKERNEL is unset. Aborting."
exit 1
fi
if [ -z ${OUTPUT+x} ]; then
echo "OUTPUT is unset. Aborting."
exit 1
fi
DATE=$(date +%Y%m%d-%H%M)
PWD=$(pwd)
# copy files
if [ -f $PWD/$ZIMAGE ]; then
cp -v $PWD/$ZIMAGE $ANYKERNEL/kernel/zImage
else
echo "zImage doesn't exist. Aborting."
exit 1
fi
# zip it
command -v zip >/dev/null 2>&1 || { echo >&2 "I require zip but it's not installed. Aborting."; exit 1; }
if [ -d $ANYKERNEL ]; then
cd $ANYKERNEL
zip -r9 $OUTPUT/kernel-$DATE.zip *
else
echo "AnyKernel path ('$ANYKERNEL') doesn't exists. Aborting."
exit 1
fi
# return
cd $PWD