Linux 5.1移植到orange pi (一)--移植新内核

Linux 5.1移植到orange  pi pc plus快速预览

1:下载最新的Linux内核

首先下载最新的Linux 5.1

解压压缩包

xz -d linux-5.1.15.tar.xz
tar xvzf linux-5.1.tar.gz

2:编译

sudo make ARCH=arm CROSS_COMPILE=~/share/orangepi_h3_linux/orangepi_h3_linux/OrangePi-Kernel/brandy/gcc-linaro/bin/arm-linux-gnueabi- sunxi_defconfig

sudo make ARCH=arm CROSS_COMPILE=~/share/orangepi_h3_linux/orangepi_h3_linux/OrangePi-Kernel/brandy/gcc-linaro/bin/arm-linux-gnueabi- zImage -j4

sudo make ARCH=arm CROSS_COMPILE=~/share/orangepi_h3_linux/orangepi_h3_linux/OrangePi-Kernel/brandy/gcc-linaro/bin/arm-linux-gnueabi- dtbs

sudo make ARCH=arm CROSS_COMPILE=~/share/orangepi_h3_linux/orangepi_h3_linux/OrangePi-Kernel/brandy/gcc-linaro/bin/arm-linux-gnueabi- modules

3:烧到SD卡

参考链接orange pi官方烧录指导,然后替换里面的zImage和dtb文件,可以启动

U-Boot SPL 2018.05-g6a42bfa-dirty (Jun 15 2019 - 10:13:10 +0800)
DRAM: 1024 MiB
Trying to boot from MMC1


U-Boot 2018.05-g6a42bfa-dirty (Jun 15 2019 - 10:13:10 +0800) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi PC Plus
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   serial
Err:   serial
Net:   phy interface0
eth0: ethernet@1c30000
230456 bytes read in 14 ms (15.7 MiB/s)
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
USB4:   USB EHCI 1.00
USB5:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
scanning bus 4 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Autoboot in 2 seconds, press <Space> to stop
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
3700 bytes read in 3 ms (1.2 MiB/s)
## Executing script at 43100000
U-boot loaded from SD
Boot script loaded from mmc
86 bytes read in 2 ms (42 KiB/s)
5876450 bytes read in 285 ms (19.7 MiB/s)
4040928 bytes read in 196 ms (19.7 MiB/s)
Found mainline kernel configuration
32641 bytes read in 5 ms (6.2 MiB/s)
** Unable to read file /dtb/overlay/sun8i-h3-fixup.scr **
## Loading init Ramdisk from Legacy Image at 43300000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5876386 Bytes = 5.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Ramdisk to 49a65000, end 49fffaa2 ... OK
   reserving fdt memory region: addr=43000000 size=6e000
   Loading Device Tree to 499f4000, end 49a64fff ... OK

Starting kernel ...

Loading, please wait...
starting version 229
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.27.1
[/sbin/fsck.ext4 (1) -- /dev/mmcblk0p2] fsck.ext4 -a -C0 /dev/mmcblk0p2
/dev/mmcblk0p2 has unsupported feature(s): metadata_csum
e2fsck: Get a newer version of e2fsck!
fsck exited with status code 8
done.
Warning: File system check failed but did not detect errors
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.

Welcome to Ubuntu 16.04.5 LTS!

[  OK  ] Listening on fsck to fsckd communication Socket.
[  OK  ] Started Trigger resolvconf update for networkd DNS.
[  OK  ] Reached target Remote File Systems (Pre).
[  OK  ] Listening on Syslog Socket.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Encrypted Volumes.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Reached target Swap.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Listening on Journal Socket.
[  OK  ] Created slice System Slice.
         Starting Set console keymap...
         Starting Nameserver information manager...
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Reached target Slices.
         Starting File System Check on Root Device...
         Starting Create Static Device Nodes in /dev...
         Starting Load Kernel Modules...
         Mounting Debug File System...
         Starting Journal Service...
[  OK  ] Created slice system-systemd\x2dfsck.slice.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Reached target Paths.
[  OK  ] Mounted Debug File System.
[  OK  ] Started Journal Service.
[  OK  ] Started Set console keymap.
[  OK  ] Started File System Check on Root Device.
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Started Load Kernel Modules.
[  OK  ] Started Nameserver information manager.
[  OK  ] Started File System Check Daemon to report status.
[  OK  ] Reached target Network (Pre).
         Starting Apply Kernel Variables...
         Starting udev Kernel Device Manager...
         Starting Remount Root and Kernel File Systems...
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Started udev Kernel Device Manager.
         Starting Flush Journal to Persistent Storage...
[  OK  ] Reached target Local File Systems (Pre).
         Starting Load/Save Random Seed...
         Starting udev Coldplug all Devices...
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Found device /dev/ttyS0.
[  OK  ] Found device /dev/mmcblk0p1.
         Starting File System Check on /dev/mmcblk0p1...
[  OK  ] Found device /sys/subsystem/net/devices/eth0.
[  OK  ] Started File System Check on /dev/mmcblk0p1.
         Mounting /boot...
[  OK  ] Mounted /boot.
[  OK  ] Reached target Local File Systems.
[  OK  ] Started ifup for eth0.
         Starting Raise network interfaces...
         Starting Create Volatile Files and Directories...
         Starting Set console font and keymap...
[  OK  ] Started Create Volatile Files and Directories.
[   11.314032] sun4i-codec 1c22c00.codec: ASoC: codec-analog@01f015c0 not registered
[   11.321568] sun4i-codec 1c22c00.codec: Failed to register our card
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Network Time Synchronization.
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Reached target System Initialization.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Basic System.
         Starting System Logging Service...
         Starting Restore /etc/resolv.conf i...re the ppp link was shut down...
         Starting dnsmasq - A lightweight DHCP and caching DNS server...
         Starting Permit User Sessions...
         Starting LSB: Set the CPU Frequency Scaling governor to "ondemand"...
         Starting Generate SSH keys if not there...
[  OK  ] Started Regular background program processing daemon.
[  OK  ] Started D-Bus System Message Bus.
         Starting Network Manager...
         Starting Login Service...
         Starting Initializes zram swaping...
[  OK  ] Started Daily apt download activities.
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Reached target Timers.
[  OK  ] Started System Logging Service.
[  OK  ] Started Set console font and keymap.
[  OK  ] Started Restore /etc/resolv.conf if...fore the ppp link was shut down.
[  OK  ] Started Permit User Sessions.
[  OK  ] Started Generate SSH keys if not there.
[FAILED] Failed to start Initializes zram swaping.
See 'systemctl status zram-config.service' for details.
[  OK  ] Started LSB: Set the CPU Frequency Scaling governor to "ondemand".
[  OK  ] Started Network Manager.
[  OK  ] Started Raise network interfaces.
[  OK  ] Started Login Service.
         Starting Network Manager Script Dispatcher Service...
         Starting Network Manager Wait Online...
[  OK  ] Reached target Network.
[  OK  ] Started Unattended Upgrades Shutdown.
         Starting OpenBSD Secure Shell server...
[  OK  ] Started Serial Getty on ttyS0.
         Starting Set console scheme...
[  OK  ] Created slice system-getty.slice.
[  OK  ] Started dnsmasq - A lightweight DHCP and caching DNS server.
[  OK  ] Started Set console scheme.
[  OK  ] Started Network Manager Script Dispatcher Service.
         Starting Hostname Service...
[  OK  ] Reached target Host and Network Name Lookups.
[  OK  ] Started Hostname Service.
[  OK  ] Started OpenBSD Secure Shell server.
         Starting Authenticate and Authorize Users to Run Privileged Tasks...
[  OK  ] Started Authenticate and Authorize Users to Run Privileged Tasks.

Ubuntu 16.04.5 LTS OrangePi ttyS0

OrangePi login: root
Password:
Last login: Mon Jul  1 12:23:43 UTC 2019 on ttyS0
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 5.1.0 armv7l)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
root@OrangePi:~# uname -a
Linux OrangePi 5.1.0 #1 SMP Mon Jul 1 20:06:29 CST 2019 armv7l armv7l armv7l GNU/Linux
cat /proc/version
Linux version 5.1.0 (root@ubuntu) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NG linaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02)) #1 SMP Mon Jul 1 20:06:29 CST 2019
root@OrangePi:~#

后记:快速记录怎么移植Linux版本到orange pi板子上,有个基本的概念,Linux官方对全志平台有了支持,启动后很多driver并没有支持,需要自己porting,还需要加深下对u-boot启动参数设置的理解。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值