Building and booting custom kernel on HiKey Debian


#1

Hi all,

I want to boot a custom kernel on my LeMaker HiKey with a Debian rootfs. I don’t know if the HiKey has been merged in the mainline kernel yet. I searched for old forum posts and documents, but they lead me to dead links (404s on github) or to the HiKeyUEFI page that mentions updating grub and not much beyond that. It’s not clear to me what the steps are, if any.

What I’ve gathered so far is to clone the 96boards/linux repo[1]. Unsure of which branch to checkout, I assume you’d run defconfig and then run the make command with ARCH=arm64 and CROSS_COMPILE=aarch64-linux-gnu- to create the image and dtb. Then I’m lost from there.

Correct me if I’m wrong. Any ideas?

Thanks,
Lisa

[1] https://github.com/96boards/linux


#2

Hi Lisa,

The instructions are here[1].
Note that in order for dpkg to work, the board would have to have been flashed already with an rpb image first. Rpb images can be found here[2].

[1] https://github.com/Linaro/documentation/blob/master/Reference-Platform/Releases/RPB_16.06/ConsumerEdition/HiKey/BFSDebianRPB.md
[2] http://builds.96boards.org/releases/reference-platform/debian/hikey/16.06


#3

@vchong: Thanks for the links!

I flashed the 16.06 RPB images (except I used jessie developer for my rootfs instead of jessie alip) via fastboot. Then I removed the link 5-6 from the J601 header and powered up the board.

I see the grub prompt from the console side:

             GNU GRUB  version 2.02~beta2-33.linarojessie.6

Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists possible
device or file completions.

grub>

Is this normal behaviour? I wanted to check before I go through the build instructions.


#4

Hi Lisa,

I’m trying to reproduce on my board. Will update.

Additionally, looks like similar/same problem here: http://www.96boards.org/forums/topic/bootloader-problem.


#5

Hi Lisa,

Can you please try below and post the results?

wget http://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/bootloader/ptable-linux-8g.img
# You have an 8gb board right?

wget http://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/bootloader/fip.bin
wget http://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/bootloader/nvme.img
wget http://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/hikey-boot-linux-20160629-120.uefi.img.gz

wget http://builds.96boards.org/releases/reference-platform/debian/hikey/16.06/hikey-rootfs-debian-jessie-alip-20160629-120.emmc.img.gz
# There's no developer rootfs for 16.06, so where did you get yours from?

Connect link 5-6 and boot the board into fastboot mode.

$ gunzip *.img.gz
$ sudo fastboot flash ptable ptable-linux-8g.img
$ sudo fastboot flash fastboot fip.bin
$ sudo fastboot flash nvme nvme.img
$ sudo fastboot flash boot hikey-boot-linux-20160629-120.uefi.img
$ sudo fastboot flash system hikey-rootfs-debian-jessie-alip-20160629-120.emmc.img

#6

Those commands worked and I don’t have the grub issue anymore. I originally used the developer rootfs from here[1] just because I wasn’t sure if the alip version would have everything I needed.

I’ll try to build my own kernel now. Thanks for your help!

[1] http://builds.96boards.org/releases/hikey/linaro/debian/latest/