Raspberry Pi3

Build Kernel(N900)


Tooolchain

$ git clone https://github.com/raspberrypi/tools
$ sudo mv tools /opt/pi3
$ export PATH=$PATH:/opt/pi3/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/

Build Kernel

$ git clone --depth=1 https://github.com/raspberrypi/linux
$ cd linux
$ KERNEL=kernel7
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- bcm2709_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage modules dtbs

With sdb1 being the FAT (boot) partition, and sdb2 being the ext4 filesystem (root) partition.

$ mkdir mnt/fat32
$ mkdir mnt/ext4
$ sudo mount /dev/sdb1 mnt/fat32
$ sudo mount /dev/sdb2 mnt/ext4
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=mnt/ext4 modules_install
$ sudo cp mnt/fat32/$KERNEL.img mnt/fat32/$KERNEL-backup.img
$ sudo scripts/mkknlimg arch/arm/boot/zImage mnt/fat32/$KERNEL.img
$ sudo cp arch/arm/boot/dts/*.dtb mnt/fat32/
$ sudo cp arch/arm/boot/dts/overlays/*.dtb* mnt/fat32/overlays/
$ sudo cp arch/arm/boot/dts/overlays/README mnt/fat32/overlays/
$ sudo umount mnt/fat32
$ sudo umount mnt/ext4

Enable UART output for pi3

$ nano mnt/fat32/config.txt
 dtoverlay=pi3-miniuart-bt
 force_turbo=1


返回上一頁