“Build Linux for Hikey log”的版本间的差异

来自个人维基
跳转至: 导航搜索
第16行: 第16行:
 
KERNEL_DIR=/data/cj.chang/hikey960/hikey-linaro/
 
KERNEL_DIR=/data/cj.chang/hikey960/hikey-linaro/
 
# Tool directory: for mkbootimg and mkdtimg
 
# Tool directory: for mkbootimg and mkdtimg
GEN_IMAGES_DIR=/data/cj.chang/hikey960/tools-images-hikey960/build-from-source/
+
GEN_IMAGES_DIR=/data/cj.chang/hikey960/tools-images-hikey960/build-from-source
  
 
export ARCH=arm64
 
export ARCH=arm64
第27行: 第27行:
 
make hisilicon/hi3660-hikey960.dtb
 
make hisilicon/hi3660-hikey960.dtb
  
cp arch/arm64/boot/Image.gz ${GEN_IMAGES_DIR}
+
cp arch/arm64/boot/Image.gz ${GEN_IMAGES_DIR}/.
cp arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb ${GEN_IMAGES_DIR}
+
cp arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb ${GEN_IMAGES_DIR}/.
  
 
cd ${GEN_IMAGES_DIR}
 
cd ${GEN_IMAGES_DIR}

2019年9月29日 (日) 12:11的版本

1. How to build kernel
cd /data/cj.chang/hikey960/tools-images-hikey960/build-from-source
./genimg.sh

# AOSP root directory:
AOSP_ROOTDIR=/data/cj.chang/hikey960/android
# AOSP build output directory:
PRODUCT_OUT=${AOSP_ROOTDIR}/out/target/product/hikey960/
# RAMDISK_IMG:
RAMDISK_IMG=${PRODUCT_OUT}/ramdisk.img
 
# kernel source code is in this repository:
#    https://github.com/96boards-hikey/linux/
# Kernel source code directory:
KERNEL_DIR=/data/cj.chang/hikey960/hikey-linaro/
# Tool directory: for mkbootimg and mkdtimg
GEN_IMAGES_DIR=/data/cj.chang/hikey960/tools-images-hikey960/build-from-source
 
export ARCH=arm64
export CROSS_COMPILE=${AOSP_ROOTDIR}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
 
cd ${KERNEL_DIR}
make distclean
make hikey960_defconfig
make -j7 Image.gz
make hisilicon/hi3660-hikey960.dtb
 
cp arch/arm64/boot/Image.gz ${GEN_IMAGES_DIR}/.
cp arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb ${GEN_IMAGES_DIR}/.
 
cd ${GEN_IMAGES_DIR}
# Note: here build result boot.img and dt.img are in folder ${PRODUCT_OUT}
#       To change this, change --output and -o.
./mkbootimg  --kernel Image.gz --ramdisk ${RAMDISK_IMG} --cmdline "loglevel=15 androidboot.hardware=hikey960 androidboot.selinux=permissive firmware_class.path=/system/etc/firmware" --base 0x0 --tags-addr 0x07A00000 --kernel_offset 0x00080000 --ramdisk_offset 0x07c00000 --os_version 7.0 --os_patch_level 2016-08-05  --output ${PRODUCT_OUT}/boot.img
./mkdtimg -d hi3660-hikey960.dtb -s 2048 -c -o ${PRODUCT_OUT}/dt.img
 
echo "dt.img boot.img build finished!"

2. Remove printk log:
(1). CPU7: update max cpu_capacity 1024

implemented in ./kernel/sched/fair.c:7131
undefine CONFIG_SCHED_DEBUG in .config

(2) audit: audit_lost=54513 audit_rate_limit=5 audit_backlog_limit=64

implemented in ./kernel/audit.c:277
remark it. if(print)==> if(0)