Created
August 25, 2020 09:36
-
-
Save robertfoss/e6ee7a9b749be18f9c7bd08b7a8d585b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit on any error | |
set -e | |
# Script expects path of kernel repo to be `linux` and located next to the location of this script | |
# Normally configured using | |
$PRODUCT=db845c | |
echo "" | |
echo "== Building kernel for $PRODUCT ==" | |
echo "" | |
echo "" | |
ARCH="arm64" | |
CROSS_COMPILE="ccache aarch64-linux-gnu-" | |
SCRIPT=$(readlink -f $0) | |
SCRIPTPATH=`dirname $SCRIPT` | |
cd $SCRIPTPATH/linux | |
NCPUS=$(nproc --ignore 2) | |
#make -j$NCPUS Image.gz dtbs modules | |
make -j$NCPUS Image.gz dtbs | |
TMPPATH=$SCRIPTPATH/tmp | |
mkdir -p $TMPPATH | |
#MODULEPATH=$TMPPATH/modules | |
#mkdir -p $MODULEPATH | |
#make modules_install INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$MODULEPATH | |
IMAGE=arch/arm64/boot/Image.gz | |
DTB=arch/arm64/boot/dts/qcom/sdm845-db845c.dtb | |
ls -la $IMAGE | |
ls -la $DTB | |
cat $IMAGE $DTB > $TMPPATH/Image.gz+dtb | |
OUTPUTPATH=$TMPPATH | |
#mkbootimg --kernel $TMPPATH/Image.gz+dtb \ | |
# --output $OUTPUTPATH/boot-db845c.img \ | |
# --pagesize 4096 \ | |
# --base 0x80000000 \ | |
# --cmdline "root=PARTLABEL=rootfs console=tty0 console=ttyMSM0,115200n8 clk_ignore_unused pd_ignore_unused debug" | |
#wget http://releases.linaro.org/96boards/dragonboard845c/linaro/debian/19.11/initrd.img-5.2.0-qcomlt-arm64 -O $TMPPATH/initrd.img | |
OUTPUT_IMAGE=$OUTPUTPATH/boot_$PRODUCT.img | |
mkbootimg --kernel $TMPPATH/Image.gz+dtb \ | |
--ramdisk $TMPPATH/initrd.img \ | |
--output $OUTPUTPATH/boot_$PRODUCT.img \ | |
--pagesize 4096 \ | |
--base 0x80000000 \ | |
--cmdline "root=PARTLABEL=rootfs console=tty0 console=ttyMSM0,115200n8 clk_ignore_unused pd_ignore_unused debug" | |
echo "" | |
echo "Wrote image to: $OUTPUT_IMAGE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment