Skip to content

Instantly share code, notes, and snippets.

@ingramali
Forked from playfulgod/build
Created September 15, 2019 12:13
Show Gist options
  • Save ingramali/c2787c3128150d19ea2a8a6f306d99ce to your computer and use it in GitHub Desktop.
Save ingramali/c2787c3128150d19ea2a8a6f306d99ce to your computer and use it in GitHub Desktop.
kernel build script
#!/bin/bash
# Our settings
#Let's make sure the environment is clean and ready to compile the kernel
echo
echo "Cleaning house!!"
echo
make mrproper
rm -rf ../package/system/lib/modules/*.ko
rm -f ../package/zImage
rm -f ../package/ramdisk.gz
echo
echo "House cleaned, lets build a kernel!!!"
echo
#
# Lets set the kernel defconfig
echo "defconfig = plague_defconfig"
echo
make ARCH=arm darkxshadows_defconfig
#
# Let's build a kernel
echo
echo "Now compiling kernel, go get a soda! ;)"
echo
ARCH=arm CROSS_COMPILE=~/Android/CM10/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make -j16
#
if [ -f arch/arm/boot/zImage ]; then
echo
echo "Plague has been compiled!!! You can find it in arch/arm/boot/zImage"
echo
else
echo
echo "Kernel did not compile, please check for errors!!"
echo
fi
# These move files to easier locations
find -name '*.ko' -exec cp -av {} ../package/system/lib/modules/ \;
cp arch/arm/boot/zImage ../package/
# This part packs the img up :)
#../package/mkbootfs ../package/ramdisk_tmp | gzip > ../package/ramdisk.gz
#../package/mkbootimg --kernel ../package/zImage --ramdisk ../package/ramdisk.gz --cmdline "vmalloc=450M, console=ttyDCC0,115200,n8 androidboot.hardware=qcom" -o ../package/boot.img --base 0x40200000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment