> For the complete documentation index, see [llms.txt](https://bananapi.gitbook.io/bpi-m2-ultra-open-source-single-board-computer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bananapi.gitbook.io/bpi-m2-ultra-open-source-single-board-computer/bpi-m2ultrasourcecodeongithub/bpi-berrybpi-ultra-how-to-alter-ubootkernel-from-github.md).

# BPI-Berry/BPI-Ultra How to alter Uboot、Kernel from github

**Banana Pi BPI-M2 Ultra / BPI-M2 Berry How to alter Uboot、Kernel**  <br>

**1,Click** [**http://www.banana-pi.org/download.html**](http://www.banana-pi.org/download.html)**, download relatively BPI-M2 Ultra Image ；and burn images to SD card.**

**2,Install tool-chain**

`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`

**3,Install BPI-Tools ,to BPI-GitHub** [**https://github.com/BPI-SINOVOIP/bpi-tools**](https://github.com/BPI-SINOVOIP/bpi-tools)

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

![](/files/-M2HXP14nwdsx_u8usJR)

**4，Put Download done BPI-Tools copy to under /usr/bin**

`sudo cp -a bpi-* /usr/bin/`

![](/files/-M2HXP16sjoTRJN_ELk6)

Execute bpi-tools -u order，install successfully after appear belows screen

![](/files/-M2HXP18-KaPLbqu4GO3)

Go to BPI-GitHub <https://github.com/BPI-SINOVOIP/BPI-M2U-bsp>\
，note: BPI-M2 berry and BPI-M2 Ultra use the same code.

![](/files/-M2HXP1AXk1FZFHIPq3B)Grab BPI-M2Ultra-bsp Source Code; execute grabing source code order

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

![](/files/-M2HXP1Cjm7G4b8pmKL5)

switch to BPI-M2U-bsp category after carried out，execute ./build.sh order

![](/files/-M2HXP1Ek2jwz9wdfKZb)

Can see BPI-M2 Ultra/BPI-M2 Berry configuration,choose BPI-M2U’s resolution what you wanted.:default compile 720P：

![](/files/-M2HXP1GdFtgG6jkptaY)

Choose mode what you need compile (advise choose 1 option first time compile)

**5，Compile done can seen under generate new SD folder BPI-M2U-bsp**

![](/files/-M2HXP1IdHKZ72oatO_B)

Later Enter into SD folder seen below files

![](/files/-M2HXP1K5k33YBCS_w-f)

These files represent information one by one

100MB --> BPI-M2Ultra uboot relative file

BPI-BOOT-bpi-m2u.tgz --> BPI-M2Ultra uEnv.txt & uImage relative file

3.10.65-BPI-M2U-Kernel.tgz --> BPI-M2Ultra kernel relative file

**6,Use command to see the SD card current position.**

`sudo fdisk -l`

![](/files/-M2HXP1MHI5HdaHpknSp)

This example can be seen SD Card’s position in /dev/sdb

Can be seen BPI-M2Ultra system has two partition,one FAT32 partition,another one EXT4 partition,represent gradually.

![](/files/-M2HXP1OOU06BQLKchHq)

**7，Change BPI-M2Ultra Uboot ，switch to /SD/100MB category；execute bpi-bootsel order:**

`sudo bpi-bootsel <file source> <SD route>`

![](/files/-M2HXP1QiUdSWX4sdCBX)

**8， Change BPI-M2Ultra uImage ,switch to /SD/ category；carry out relative command.**  <br>

```
sudo tar –xvf  <file source>  -C  <SD Boot route >
```

![](/files/-M2HXP1SLVhGlE8FdmS7)

Belowinformation after execute，successfully done.

![](/files/-M2HXP1Uw5xxu8RWQkrb)

**9， Change BPI-M2Ultra Kernel，switch to /SD/ category；execute relative order**

`sudo tar -xvf <file source> -C <SD Boot route>`

![](/files/-M2HXP1Wt9AYVkxMOf5E)

**Supplement**&#x20;

Change kernel setting，switch to / linux-sunxi category，execute order

`make ARCH=arm menuconfig`

![](/files/-M2HXP1YWX55J9kn2YIw)![](/files/-M2HXP1_LZHTNSNdk9wg)
