-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_kernel.sh
More file actions
executable file
·53 lines (42 loc) · 1.51 KB
/
build_kernel.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.51 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
export KERNELDIR=`readlink -f .`
export RAMFS_SOURCE=`readlink -f $KERNELDIR/../ramfs-sgs4-9500`
export PARENT_DIR=`readlink -f ..`
export USE_SEC_FIPS_MODE=true
CROSS_COMPILE=/home/jeff/Desktop/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
if [ "${1}" != "" ];then
export KERNELDIR=`readlink -f ${1}`
fi
RAMFS_TMP="/tmp/ramfs-source-sgs4"
if [ ! -f $KERNELDIR/.config ];
then
make amoonhappy_10_defconfig
fi
. $KERNELDIR/.config
export ARCH=arm
export CROSS_COMPILE=/home/jeff/Desktop/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
mkdir -p $RAMFS_TMP
cd $KERNELDIR/
nice -n 10 make -j4 || exit 1
#remove previous ramfs files
rm -rf $RAMFS_TMP.cpio
rm -rf $RAMFS_TMP.cpio.gz
#copy ramfs files to tmp directory
cp -ax $RAMFS_SOURCE/* $RAMFS_TMP
#clear git/svn repositories in ramfs
find $RAMFS_TMP -name .svn -exec rm -rf {} \;
#remove empty directory placeholders
find $RAMFS_TMP -name EMPTY_DIRECTORY -exec rm -rf {} \;
rm -rf $RAMFS_TMP/tmp/*
#remove mercurial repository
rm -rf $RAMFS_TMP/.hg
#copy modules into ramfs
mkdir -p $RAMFS_TMP/lib/modules
find -name '*.ko' -exec cp -av {} $RAMFS_TMP/lib/modules/ \;
/home/jeff/Desktop/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-strip --strip-unneeded $RAMFS_TMP/lib/modules/*
cd $RAMFS_TMP
/home/jeff/Desktop/work_git/mkbootfs . | gzip > $RAMFS_TMP.cpio.gz
ls -lh $RAMFS_TMP.cpio.gz
cd -
nice -n 10 make -j3 zImage || exit 1
./mkbootimg --kernel $KERNELDIR/arch/arm/boot/zImage --ramdisk $RAMFS_TMP.cpio.gz --base 0x10000000 --pagesize 2048 -o $KERNELDIR/boot.img