树莓派3B linux内核,树莓派3B交叉编译64位内核(示例代码)

apt-get update

apt-get install git bc

git clone --depth=1 git://github.com/raspberrypi/tools.git

git clone --depth=1 https://github.com/raspberrypi/linux.git

cd linux

git branch

git checkout rpi-4.14.y

export PATH=/opt/aarch64/bin/:$PATH

export CROSS_COMPILE=aarch64-linux-gnu-

export ARCH=arm64

ls -l arcn/arm64/configs/

make bcmrpi3_defconfig

make -j 12

#挂载镜像、更新

[email protected]:/home/z/RaspberryPi# fdisk -l raspbx-04-04-2018.mod.img

Disk raspbx-04-04-2018.mod.img: 3.7 GiB, 3904897024 bytes, 7626752 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x000ee283

Device Boot Start End Sectors Size Id Type

raspbx-04-04-2018.mod.img1 2048 155647 153600 75M c W95 FAT32 (LBA)

raspbx-04-04-2018.mod.img2 157696 7626751 7469056 3.6G 83 Linux

#image root partition offset:157696*512=80740352

#image boot partition offset:2048*512=1048576

#image boot partition sizelimit:153600*512=78643200

[email protected]:/home/z/RaspberryPi# mount -o loop,offset=80740352 raspbx-04-04-2018.mod.img /mnt

[email protected]:/home/z/RaspberryPi# mount -o loop,offset=1048576,sizelimit=78643200 raspbx-04-04-2018.mod.img /mnt/boot

[email protected]:/home/z/RaspberryPi/linux# cp arch/arm64/boot/Image /mnt/boot/kernel8.img

[email protected]:/home/z/RaspberryPi/linux# cp arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b.dtb /mnt/boot/

[email protected]:/home/zhenhai/RaspberryPi/linux# echo "kernel=kernel8.img">>/mnt/boot/config.txtmakeARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=/mnt modules_install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值