-
Notifications
You must be signed in to change notification settings - Fork 1
/
kernel_build_packages
executable file
·130 lines (82 loc) · 1.44 KB
/
kernel_build_packages
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/sh
## hyphop ##
. ./,config
DIR=`pwd`
cd $kernel_out
[ "$name" ] || name="$1"
[ "$name" ] || name="default"
echo "pack as $name"
## meta
#out=/tmp/miZy.linux.kernel.$name
out=/tmp/miZy.linux.kernel.$name/miZy.linux.kernel.$name
d=`dirname $out`
[ -d $d ] || mkdir -p $d
m=$out.modules.meta.tar.gz
##
for r in $out.*; do
# [ "" ] && {
[ -f "$r" ] && {
rm $r
echo "[i] remove $r" 1>&2
}
# }
done
#exit 0
echo "[i] $m" 1>&2
[ -f $m ] && rm $m
tar -czf $m \
modules.builtin \
modules.dep \
modules.links \
modules.list \
modules.order
## raw image
m=$out.Image.gz
echo "[i] $m" 1>&2
[ -f $m ] && rm $m
gzip -c Image > $m
## packaed uimage
P="gzip lzma lzo none"
for p in $P; do
# echo $p
f="uImage.$p"
m="$out.$f"
echo "[i] $m" 1>&2
[ -f $f ] && {
case $p in
none)
gzip -c $f > $m.gz
;;
*)
cp $f $m
esac
}
done
## modules all
m=$out.modules.all.tar.gz
echo "[i] $m" 1>&2
[ -f $m ] && rm $m
tar -czf $m modules.all
## modules tree
m=$out.modules.full.tar.gz
echo "[i] $m" 1>&2
[ -f $m ] && rm $m
tar --exclude "lib/firmware" -czf $m modules
## configs
m=$out.config
echo "[i] $m" 1>&2
#ls -l1
cd $DIR
cat bin/modules/lib/modules/*/source/.config > $m
## configs gz
m=$out.config.gz
echo "[i] $m" 1>&2
gzip -c bin/modules/lib/modules/*/source/.config > $m
## check
d=`dirname $out`
b=`basename $out`
[ -f $out.md5sum ] && rm $out.md5sum
cd $d
md5sum $b* > $out.md5sum
cd $DIR
## ok