Other OS

HOWTO upgrade the kernel under Arch on the Banana Pi

2 2632
danboid  
Edited by danboid at Fri Oct 30, 2015 11:00

I refer to the Arch Linux ARM (ALARM) project and kernel in this guide but the Banana Pi is currently not an officially supported ALARM platform.

The 3.4 kernel that ships with the lemaker Arch distro is quite outdated now but 3.4 is required if you want hardware accelerated 3D graphics and sound. BPi audio support is planned for the 4.4 kernel. If you need GLES support then you will have to stick with Linux 3.4 and it would probably be easiest for you to install Ryad's custom Arch distro instead of using the lemaker Arch distro:

http://blog.eldajani.net/banana- ... mized-distribution/

Ryad's Arch distro comes with GLES 3D acceleration working OOTB. If you have no need for the binary blob graphics driver you are probably better off with a mainline, 4.x kernel so read on.

First we install the latest ALARM ARMv7 kernel. Note that most commands in this guide need to be run as root or using sudo:

  1. # pacman -S linux-armv7
Copy the Code


Copy /boot/zImage and your board-specific .dtb to the boot partition. dtb files have replaced the script.bin files used in the 3.4 kernels.

  1. # mount /dev/mmcblk0p1 /mnt
  2. # cp /boot/zImage /boot/dtbs/sun7i-a20-bananapi.dtb /mnt
Copy the Code


Create /mnt/boot.cmd with the following contents:

  1. setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
  2. load mmc 0:1 0x43000000 ${fdtfile} || load mmc 0:1 0x43000000 boot/${fdtfile}
  3. load mmc 0:1 0x42000000 zImage || load mmc 0:1 0x42000000 boot/zImage
  4. bootz 0x42000000 - 0x43000000
Copy the Code


Note the root device assumes you are booting from the second partition of the SD card. You may need to change this to /dev/sda1 or whatever if booting from SATA.

Generate boot.scr using boot.cmd:

  1. # cd /mnt
  2. # mkimage -C none -A arm -T script -d boot.cmd boot.scr
Copy the Code


The u-boot that ships with the lemaker Arch image is outdated so you'll need to download the latest build for your device from:

http://dl.linux-sunxi.org/nightl ... xi-mainline-latest/

In the case of the original BPi you'd use something like these commands to download, uncompress and install the latest u-boot:

  1. # wget [url]http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi-mainline/u-boot-sunxi-mainline-latest/u-boot-sunxi-mainline-bananapi.tar.xz[/url]
  2. # tar xvf u-boot-sunxi-mainline-bananapi.tar.xz
  3. # cd u-boot-sunxi-mainline-bananapi-VERSION
  4. # dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
Copy the Code


Now when you reboot you should boot into the latest ALARMv7 kernel. For more information see http://linux-sunxi.org/Mainline_U-Boot

Rate

1

View Rating Log

danboid  
Edited by danboid at Jan 19, 2016 03:11

Building a custom Arch Linux ARM (ALARM) kernel package for the Banana Pi

I recently wanted to try a kernel patch for the BPi to enable ALSA audio. Doing so required I work out a method of building the Arch Linux armv7 kernel package so I decided to document the process here.

Note that the following method is by no means ideal or even remotely official so you try it at your own risk. It is purely a lazy (wo)mans rough guide. Even if everything works, expect to wait at least twelve hours for the kernel and package to build if you are building on an unassisted BPi!

This guide presumes you already have the Arch base-devel package installed. The makepkg -o command will alert you to most of the other packages you will need to build the kernel EXCEPT for fakeroot so we'll install that first if you haven't done so already:

  1. sudo pacman -S fakeroot
  2. git clone https://github.com/archlinuxarm/PKGBUILDs.git
  3. cd PKGBUILDs/core/linux-armv7
  4. makepkg -o
Copy the Code


makepkg -o will fetch the kernel sources and the ALARM kernel patches but won't proceed to build the kernel or its packages. At this point you can apply any patches to the kernel source that should be located under the src sub-dir of linux-armv7.

Note that the linux-armv7 package is a very generic ARM kernel that aims to support most of the armv7 devices available. One such device it supports is the BeagleBone Black but the regular kernel source doesn't include the required firmware to successfully build the kernel with BBB support. If you were to start building the kernel at this point it would stop after about nine hours with errors such as:

  1. make[1]: *** No rule to make target 'firmware/am335x-pm-firmware.elf', needed by 'firmware/am335x-pm-firmware.elf.gen.o'.  Stop.
Copy the Code


and

  1. make[1]: *** No rule to make target 'firmware/am335x-bone-scale-data.bin', needed by 'firmware/am335x-bone-scale-data.bin.gen.o'.  Stop.
Copy the Code


If you don't adjust the kernel config to disable BBB support you need to fetch the required firmware and copy it into the linux-armv7 kernel firmware dir with commands like these:

  1. git clone https://github.com/beagleboard/linux.git
  2. cp linux/firmware/am* linux-armv7/src/linux-4.4/firmware/
Copy the Code


Adjust the cp command paths as required.

Once you have applied your patches and copied the BBB firmware into the correct firmware directory you can begin building kernel and its packages by running the following from PKGBUILDs/core/linux-armv7:

  1. makepkg -e
Copy the Code


With any luck both the kernel and kernel headers packages will build successfully and you can then use the above guide to install them. You are likely to get an error like this at end of the build process but you likely don't need the extra packages such as package_linux-armv7-smileplug so it's nothing to worry about:

  1. ==> Tidying install...
  2.   -> Purging unwanted files...
  3.   -> Removing libtool files...
  4.   -> Removing static library files...
  5.   -> Compressing man and info pages...
  6. ==> Creating package "linux-armv7"...
  7.   -> Generating .PKGINFO file...
  8.   -> Adding install file...
  9.   -> Generating .MTREE file...
  10.   -> Compressing package...
  11. ==> Starting package_linux-armv7-headers()...
  12. ==> Tidying install...
  13.   -> Purging unwanted files...
  14.   -> Removing libtool files...
  15.   -> Removing static library files...
  16.   -> Compressing man and info pages...
  17. ==> Creating package "linux-armv7-headers"...
  18.   -> Generating .PKGINFO file...
  19.   -> Generating .MTREE file...
  20.   -> Compressing package...
  21. ==> Starting package_linux-armv7-smileplug()...
  22. cat: arch/arm/boot/dts/armada-370-smileplug.dtb: No such file or directory
  23. ==> ERROR: A failure occurred in package_linux-armv7-smileplug().
  24.     Aborting...
Copy the Code

rahu  
The klondike solitaire online free that could be put on an empty place is the King or a legitimate movable groupd that begins with a King. AARP is a not-for-profit, detached organization that assists people 50 and older improve the high quality of their lives.

You have to log in before you can reply Login | Sign Up

Points Rules