-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·41 lines (31 loc) · 983 Bytes
/
build.sh
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
#!/bin/sh
set -e
cd -- "$(dirname -- "$0")"
mkdir -p modules
if [ -z "$(ls -A modules)" ]; then (
cd linux-stable
# use kernel config
zcat ../config.gz > .config
# tweak config to enable some modules
sed -i \
-e "s/.*CONFIG_BRIDGE.*/CONFIG_BRIDGE=m/g" \
-e "/.*CONFIG_NETFILTER.*/d" \
.config
# patch module vermagic to match the one used by the oem nvr kernel
# i couldn't find a valid kernel config with ARM_PATCH_PHYS_VIRT disabled
# it would always default to 'y' (yes)
# XXX: find a better way to do this
sed -i -e "s/p2v8 //g" arch/arm/include/asm/module.h
# nuking git repo because uncommitted changes also affect vermagic value
rm -rf .git
# rebuild config with default values for all remaining parameters
yes "" | make oldconfig
# build modules
make modules
# collect .ko files
find | grep "\.ko$" | xargs cp -t ../modules/
) fi
echo
echo "result"
echo
file modules/*