香蕉派M64的编译,烧录和启动

香蕉派的M64用的是全志的A64芯片,由于没有买香蕉派M64的板子,直接用了一个A64的核心板去做。

服务器:ubuntu 12.04 64位

1,下载源码SDK:

先到到github官网拿到SDK,github下面:

git clone https://github.com/BPI-SINOVOIP/BPI-M64-bsp.git

2.编译:

由于没有像M3一样,源码SDK里面有编译的交叉工具,所以需要安装g++-arm-linux-gnueabi交叉编译工具

sudo apt-get install build-essential libncurses5-dev u-boot-tools qemu-user-static debootstrap git binfmt-support libusb-1.0-0-dev pkg-config gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libssl-dev

如果是ubuntu 12.04之前的版本需要先执行以下命令才能安装

add-apt-repository ppa:linaro-maintainers/toolchain
apt-get update

执行命令编译

./build.sh 1

pack时候有报错:

我把--k去掉后编译通过

diff --git a/scripts/mk_pack.sh b/scripts/mk_pack.sh
index 89dfa14..2899249 100755
--- a/scripts/mk_pack.sh
+++ b/scripts/mk_pack.sh
@@ -35,7 +35,7 @@ pack_bootloader()
   for files in $(ls -f $DTB/*.img)
   do
        echo "gzip ${files}"
-       gzip -k ${files}
+       gzip ${files}
        mv ${files}.gz $U/  
   done
 }

编译完成后会生成SD的一个目录,这里面有制作卡启动和系统运行的文件


编译通过后做卡启动,准备一张8G的TF卡,
先格式化,然后分区,分两个区;如我的是/dev/sdc1,和/dev/sdc2,第一个分区64M,其余的都分给第二个分区,分区用fdisk /dev/sdc,
最后格式化两个分区的文件格式:
**Format the partitions**
    # mkfs.vfat -n BOOT /dev/sdc1
    # mkfs.ext4 -L ROOT /dev/sdc2

3,烧入以及启动:

1.先做卡启动引导:

sudo gunzip -c SD/bpi-m64/100MB/u-boot-with-dtb-bpi-m64-{type}-8k.img.gz | dd of=/dev/sdX bs=1024 seek=8

启动type是指你选的显示,有5种:lcd5,lcd7.720p....

2.然后做boot,把BPI-BOOT里面的内容拷贝到第一个分区

**BOOT Partition**
    # mount -t vfat /dev/sdc1 /mnt/
    # cp SD/bpi-m64/BPI-BOOT/bananapi/bpi-m64/linux/Image /mnt/
    # cp SD/bpi-m64/BPI-BOOT/bananapi/bpi-m64/linux/initrd.img /mnt/
    # cp SD/bpi-m64/BPI-BOOT/bananapi/bpi-m64/linux/${type}/* /mnt/ //type是指编译时候选择的模式:HDMI或者是LCD

3.修改下uEnv.txt这个文件,这个文件应该是指定文件路径的,但是这个路径放进机器后就是不对的,修改如下:


4.卸载挂载的文件夹: # umount /mnt/
另外文档说可以把 /BPI-BOOT-bpi-m64.tgz直接解压到sdc1分区,但是我没有试过

5.第二部分就是第二个分区的了,把3.10.105-BPI-M64-Kernel.tgz和BOOTLOADER-bpi-m64.tgz解压到/dev/sdc2的分区

# mount -t ext4 /dev/sdX2 /mnt/
    # tar -c /mnt/ -xvf rootfs.tar.gz这个我没有执行
    # tar xf SD/bpi-m64/3.10.105-BPI-M64-Kernel.tgz --keep-directory-symlink -C /mnt/ 我改成tar -k -xf SD/bpi-m64/3.10.105-BPI-M64-Kernel.tgz -C /mnt
    # tar xf SD/bpi-m64/BOOTLOADER-bpi-m64.tgz --keep-directory-symlink -C /mnt/ 我改成了 tar -k xf SD/bpi-m64/BOOTLOADER-bpi-m64.tgz -C /mnt 应为按照文档说的命令无法执行--keep-directory-symlink参数有问题

6.卸载挂载的目录

# umount /mnt/
把TF卡插入到机器里面,按power键启动。
bpi_a64_android初步编译为LCD显示20170309_1442.7z banana pi a64 android6.0.1初步编译为LCD显示。初步设置。 bpi_a64_android的编译配置文件排版.txt 2017/3/9 14:33 0、压缩包的处理: rootroot@cm-System-Product-Name:/home/wwt/a64$ tar zxvf BPI-A64-Android_SourceCode.tar.gz 增加3个编译链 Notice: Please download this file to the correct path https://drive.google.com/open?id=0B_YnvHgh2rwjaVRrc2VoR0xLTlE (1)gcc-linaro-aarch64.tar.xz ==> /lichee/buildroot/dl (2)gcc-linaro-aarch64.tar.xz ==> /lichee/brandy/toolchain (3)gcc-linaro-arm.tar.xz ==> /lichee/brandy/toolchain 重新分块压缩: rootroot@cm-System-Product-Name:/home/wwt/a64$ tar zcvf - bpi_a64_android/ | split -b 3900000000 - bpi_a64_android_wyb_patch1.tar.gz 1、编译lichee内核 rootroot@cm-System-Product-Name:/home/wwt/a64$ rootroot@cm-System-Product-Name:/home/wwt/a64$ cd bpi_a64_android/ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android$ cd lichee/ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun50iw1p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux 3. camdroid 4. secureandroid Choice: 0 All available kernel: 0. linux-3.10 1. linux-3.4 Choice: 0 All available boards: 0. bpi-m64-hdmi 1. bpi-m64-lcd Choice: 1 rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee$ ./build.sh Copy boot.img to output directory ... Copy modules to target ... sun50iw1p1 compile Kernel successful INFO: build kernel OK. INFO: build rootfs ... INFO: skip make rootfs for android INFO: build rootfs OK. INFO: ---------------------------------------- INFO: build lichee OK. INFO: ---------------------------------------- rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee$ 2、编译Android rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee$ cd ../android/ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ source build/envsetup.sh including device/asus/deb/vendorsetup.sh including device/asus/flo/vendorsetup.sh including device/asus/fugu/vendorsetup.sh including device/generic/mini-emulator-arm64/vendorsetup.sh including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh including device/generic/mini-emulator-mips/vendorsetup.sh including device/generic/mini-emulator-x86_64/vendorsetup.sh including device/generic/mini-emulator-x86/vendorsetup.sh including device/htc/flounder/vendorsetup.sh including device/lge/hammerhead/vendorsetup.sh including device/moto/shamu/vendorsetup.sh including device/softwinner/bpi-m64-hdmi/vendorsetup.sh including device/softwinner/bpi-m64-lcd/vendorsetup.sh including device/softwinner/common/vendorsetup.sh including sdk/bash_completion/adb.bash rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ lunch You're building on Linux Lunch menu... pick a combo: 1. aosp_arm-eng 2. aosp_arm64-eng 3. aosp_mips-eng 4. aosp_mips64-eng 5. aosp_x86-eng 6. aosp_x86_64-eng 7. aosp_deb-userdebug 8. aosp_flo-userdebug 9. full_fugu-userdebug 10. aosp_fugu-userdebug 11. mini_emulator_arm64-userdebug 12. m_e_arm-userdebug 13. mini_emulator_mips-userdebug 14. mini_emulator_x86_64-userdebug 15. mini_emulator_x86-userdebug 16. aosp_flounder-userdebug 17. aosp_hammerhead-userdebug 18. aosp_hammerhead_fp-userdebug 19. aosp_shamu-userdebug 20. bpi_m64_hdmi-eng 21. bpi_m64_hdmi-user 22. bpi_m64_hdmi-userdebug 23. bpi_m64_lcd-eng 24. bpi_m64_lcd-user 25. bpi_m64_lcd-userdebug Which would you like? [aosp_arm-eng] 23 ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=6.0.1 TARGET_PRODUCT=bpi_m64_lcd TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm64 TARGET_ARCH_VARIANT=armv8-a TARGET_CPU_VARIANT=generic TARGET_2ND_ARCH=arm TARGET_2ND_ARCH_VARIANT=armv7-a-neon TARGET_2ND_CPU_VARIANT=cortex-a15 HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=MMB29M OUT_DIR=out ============================================ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ extract-bsp /home/wwt/a64/bpi_a64_android/android/device/softwinner/bpi-m64-lcd/bImage copied! /home/wwt/a64/bpi_a64_android/android/device/softwinner/bpi-m64-lcd/modules copied! rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ make -j12 Creating filesystem with parameters: Size: 2147483648 Block size: 4096 Blocks per group: 32768 Inodes per group: 8192 Inode size: 256 Journal blocks: 8192 Label: system Blocks: 524288 Block groups: 16 Reserved block group size: 127 Created filesystem with 2422/131072 inodes and 260574/524288 blocks Install system fs image: out/target/product/bpi-m64-lcd/system.img out/target/product/bpi-m64-lcd/system.img+out/target/product/bpi-m64-lcd/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p maxsize=2192446080 blocksize=4224 total=1034077436 reserve=22146432 #### make completed successfully (57:57 (mm:ss)) #### rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ 3、打包img镜像 rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ pack -d /home/wwt/a64/bpi_a64_android/lichee/tools/pack/sun50iw1p1_android_bpi-m64-lcd_card0.img pack finish rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ pack /home/wwt/a64/bpi_a64_android/lichee/tools/pack/sun50iw1p1_android_bpi-m64-lcd_uart0.img pack finish rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/android$ 4、编译uboot(可选) rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee/brandy$ ./build.sh -p sun50iw1p1 CC external/openssl_ext.c ... make -C /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/spl/ CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/ss_spl.c ... CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/spc_spl.c ... CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/smc_spl.c ... CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/gic_spl.c ... CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/debug.c ... CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/ctype.c ... CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/eabi_compat.c ... CC /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/spl/efuse_spl.c ... make -C /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/spl/lib/ make[3]: 没有什么可以做的为 `all'。 /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/../gcc-linaro/bin/arm-linux-gnueabi-gcc -E -include /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/include/u-boot/u-boot.lds.h -DSBROMSWADDR="(0x10480)" -ansi -D__ASSEMBLY__ -P - </home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/main/sboot.lds >/home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/sboot.lds /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/../gcc-linaro/bin/arm-linux-gnueabi-ld /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/dram/libchipid.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/dram/libdram.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/mmc/libmmc.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/arch/arm/cpu/armv7/sun50iw1p1/nand/libnand.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/flash/libflash.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/libs/libgeneric.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/load/libload.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/main/libmain.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/openssl/libopenssl.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/spl/libsource_spl.o /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/spl/lib/libgeneric.o -L /home/wwt/a64/bpi_a64_android/lichee/brandy/gcc-linaro/bin/../lib/gcc/arm-linux-gnueabi/4.6.3 -lgcc -T/home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/sboot.lds -o sboot.axf -Map sboot.map /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/../gcc-linaro/bin/arm-linux-gnueabi-objcopy -O binary /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/sboot.axf /home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/sunxi_spl/sbrom/sboot.bin "sboot_sun50iw1p1.bin" -> "/home/wwt/a64/bpi_a64_android/lichee/brandy/u-boot-2014.07/../../tools/pack/chips/sun50iw1p1/bin/sboot_sun50iw1p1.bin" rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee/brandy$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee/brandy$ 5、配置menuconfig(裁剪内核) rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun50iw1p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux 3. camdroid 4. secureandroid Choice: 0 All available kernel: 0. linux-3.10 1. linux-3.4 Choice: 0 All available boards: 0. bpi-m64-hdmi 1. bpi-m64-lcd Choice: 1 rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee$ cd linux-3.10/ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee/linux-3.10$ cp .config bak1_orig.config rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee/linux-3.10$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee/linux-3.10$ rootroot@cm-System-Product-Name:/home/wwt/a64/bpi_a64_android/lichee/linux-3.10$ make ARCH=arm64 menuconfig (1)改大打印缓存 General setup ---> (17) Kernel log buffer size (16 => 64KB, 17 => 128KB) 修改为: (18) Kernel log buffer size (16 => 64KB, 17 => 128KB) (2)只保留博通/正基的WIFI/BT:AP6212等 Device Drivers ---> [*] Network device support ---> [*] Wireless LAN ---> <M> Broadcom FullMAC wireless cards support (/system/vendor/modules/fw_bcmdhd.bin) Firmware path (/system/vendor/modules/nvram.txt) NVRAM path Enable Chip Interface (SDIO bus interface support) ---> Interrupt type (Out-of-Band Interrupt) ---> <M> Realtek 8723B SDIO or SPI WiFi <M> Realtek 8723BS_VQ0 WiFi <M> Realtek 8189F SDIO WiFi 修改为: < > Realtek 8723B SDIO or SPI WiFi < > Realtek 8723BS_VQ0 WiFi < > Realtek 8189F SDIO WiFi (3)关闭SELinux安全内核方便调试 Security options ---> [*] NSA SELinux Support [*] NSA SELinux boot parameter (1) NSA SELinux boot parameter default value [ ] NSA SELinux runtime disable [*] NSA SELinux Development Support [*] NSA SELinux AVC Statistics (1) NSA SELinux checkreqprot default value [ ] NSA SELinux maximum supported policy format version 修改为: [ ] NSA SELinux Support (4)在内核中增加USB摄像头/打开UVC的驱动 Device Drivers ---> <*> Multimedia support ---> [ ] Media USB Adapters ---> 修改为: [*] Media USB Adapters ---> --- Media USB Adapters *** Webcam devices *** < > USB Video Class (UVC) 修改为: <M> USB Video Class (UVC) [*] UVC input events device support (NEW)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值