Permalink
Browse files

build script

  • Loading branch information...
1 parent a66a221 commit eb7c3df0d52fc46016d2cb1b03e126749d6b462f @gokhanmoral committed Jun 5, 2012
Showing with 53 additions and 0 deletions.
  1. +53 −0 build_kernel.sh
  2. BIN mkbootimg
View
@@ -0,0 +1,53 @@
+#!/bin/sh
+export KERNELDIR=`readlink -f .`
+export RAMFS_SOURCE=`readlink -f $KERNELDIR/../ramfs-sgs3`
+export PARENT_DIR=`readlink -f ..`
+export USE_SEC_FIPS_MODE=true
+
+if [ "${1}" != "" ];then
+ export KERNELDIR=`readlink -f ${1}`
+fi
+
+RAMFS_TMP="/tmp/ramfs-source-sgs3"
+
+if [ ! -f $KERNELDIR/.config ];
+then
+ make siyah_defconfig
+fi
+
+. $KERNELDIR/.config
+
+export ARCH=arm
+
+cd $KERNELDIR/
+nice -n 10 make -j4 modules || exit 1
+
+#remove previous ramfs files
+rm -rf $RAMFS_TMP
+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 repositories in ramfs
+find $RAMFS_TMP -name .git -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 $INITRAMFS/lib/modules
+find -name '*.ko' -exec cp -av {} $RAMFS_TMP/lib/modules/ \;
+
+cd $RAMFS_TMP
+find | fakeroot cpio -H newc -o > $RAMFS_TMP.cpio 2>/dev/null
+ls -lh $RAMFS_TMP.cpio
+gzip -9 $RAMFS_TMP.cpio
+cd -
+
+nice -n 10 make -j3 zImage || exit 1
+
+./mkbootimg --kernel $KERNELDIR/arch/arm/boot/zImage --ramdisk $RAMFS_TMP.cpio.gz --board smdk4x12 --base 0x10000000 --pagesize 2048 --ramdiskaddr 0x11000000 -o $KERNELDIR/boot.img
+
+rm /Downloads/galaxys3/siyah.tar
+tar cvf /Downloads/galaxys3/siyah.tar boot.img
View
Binary file not shown.

0 comments on commit eb7c3df

Please sign in to comment.