-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild_p6210_kernel
More file actions
executable file
·30 lines (27 loc) · 1.43 KB
/
build_p6210_kernel
File metadata and controls
executable file
·30 lines (27 loc) · 1.43 KB
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
#!/bin/sh
# must have 4.4.3 to work properly with the precompiled ar6000.ko module
# some sources of a 4.4.3 toolchain...
# pulling the latest source directly from google has it prebuilt
#COMPILER_DIR=$HOME/google/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
# also prebuilt in the android ndk
#COMPILER_DIR=$HOME/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
# and also prebuilt from the cyanogenmod source
COMPILER_DIR=$HOME/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
# pull a copy if the initramfs from a generic "initramfs" directory thats
# a sibling of the CWD
mkdir -p kernel/usr/initramfs
rm -rf kernel/usr/initramfs/*
cp -a ../initramfs/* kernel/usr/initramfs
# clean any git related and "empty directory" place holders
rm $(find kernel/usr/initramfs -name EMPTY_DIRECTORY -print)
rm -rf $(find kernel/usr/initramfs -name .git -print)
# set the default config
make ARCH=arm c210_p2w_rev02_defconfig CROSS_COMPILE=$COMPILER_DIR
# actually compile the kernel
make -j3 ARCH=arm CROSS_COMPILE=$COMPILER_DIR
# copy any built modules into our working initramfs copy
cp $(find . -name *.ko -print |grep -v initramfs) kernel/usr/initramfs/lib/modules/
# ...and touch the files to force the initramfs to be repacked with zImage
touch kernel/usr/initramfs/lib/modules/*
# finally, make again to actually repack zImage
make -j3 ARCH=arm CROSS_COMPILE=$COMPILER_DIR