How u-boot can chain "grub" and booting a mainline kernel on my ARM Chromebook

Mario Marietto marietto2008 at gmail.com
Sat Jul 1 01:47:49 CEST 2023


Hello.

I would like to enable KVM virtualization on my old ARM Chromebook
laptop,based on the Exynos5250 arm 32 bit cpu aka snow,model xe303c12.
The first thing I did has been to dd the image below directly on the sd
card :

https://github.com/hexdump0815/imagebuilder/releases/download/220619-01/chromebook_snow-armv7l-jammy.img.gz

and it worked like a charm,but kvm was disabled. So,I have started to look
for a good documentation to understand how to enable kvm and I found this :

http://www.virtualopensystems.com/en/solutions/guides/kvm-on-chromebook/

I've followed all the instructions and it worked,but only with Ubuntu 13.04
and 14.04. More upgraded ubuntu versions give a lot of problems and they
don't work.

So,I've thought about a fresh idea. What about to install the virtual open
systems "non-verified u-boot" on the first partition like explained in the
tutorial,and,instead of starting another u-boot after the original,can I
chain grub with the kernel installed for example by the ubuntu jammy iso
image created by "hexdump0815" ? To be honest I'm not sure if hexdump0815
used grub,but I will explain this later.

Anyway,I've got the idea by reading here :

https://unix.stackexchange.com/questions/599141/how-to-install-grub-bootloader-as-second-stage-bootloader
So,now,I'm going to explain what's the content of the partitions on my
Frankenstein sd card.

1) /dev/sdh1 = unknown = 16 MB. I've created this partition by doing :

$ sudo dd if=nv_uboot-snow.kpart of=/dev/sdh1

Where I've got the file nv_uboot-snow.kpart ? From here :

http://www.virtualopensystems.com/downloads/guides/kvm_on_chromebook/nv_u-boot-snow.kpart

2) /dev/sdh2 = unknown = 16 MB. This partition has been created by
executing the following

script :

$ sudo ./scripts/sdcard.sh /dev/sdh

3) /dev/sdh3 = ext2 BOOT.

Inside the partition /dev/sdh3 I have copied the following files and
folders (taken
from the hexdump0815 "chromebook_snow-armv7l-jammy.img.gz" file :

a) dtb-5.18.1-stb-cbe+ = directory
b) extlinux = directory
c) extra = directory

d) config.5.18.1-stb-cbe+ : file
e) initrd.img-5.18.1-stb-cbe+ : file
f) System.map-5.18.1-stb-cbe+ : file
g) vmlinux.kpart-5.18.1-stb-cbe+ : file
h) zImage-5.18.1-stb.cbe+ : file

Inside the directory "dtb-5.18.1-stb-cbe+" there are the following files :

a) exynos5250-snow.dtb
b) exynos5250-snow-rev5.dtb
c) exynos5250-spring.dtb

Inside the directory "extlinux",there is the following file :

a) extlinux.conf : that has the following content :

TIMEOUT 30

DEFAULT linux-snow-rev4

MENU TITLE snow chromebook boot options

# rev4 snow chromebook
LABEL linux-snow-rev4
      MENU LABEL linux rev4 snow
      LINUX ../zImage-5.18.1-stb-cbe+
      INITRD ../initrd.img-5.18.1-stb-cbe+
      FDT ../dtb-5.18.1-stb-cbe+/exynos5250-snow.dtb
      APPEND console=tty1 root=LABEL=rootpart ro rootwait net.ifnames=0
ipv6.disable=1 fsck.repair=yes noresume

# rev5 snow chromebook
LABEL linux-snow-rev5
      MENU LABEL linux rev5 snow
      LINUX ../zImage-5.18.1-stb-cbe+
      INITRD ../initrd.img-5.18.1-stb-cbe+
      FDT ../dtb-5.18.1-stb-cbe+/exynos5250-snow-rev5.dtb
      APPEND console=tty1 root=LABEL=rootpart ro rootwait net.ifnames=0
ipv6.disable=1 fsck.repair=yes noresume

# spring chromebook - untested
LABEL linux-spring
      MENU LABEL linux spring
      LINUX ../zImage-5.18.1-stb-cbe+
      INITRD ../initrd.img-5.18.1-stb-cbe+
      # rev4 snow chromebook
      FDT ../dtb-5.18.1-stb-cbe+/exynos5250-spring.dtb
      APPEND console=tty1 root=LABEL=rootpart ro rootwait net.ifnames=0
ipv6.disable=1 fsck.repair=yes noresume

Inside the extra directory there are the following files :

a) kernel-chromebook_snow-legacy.tar.gz
b) uboot.kpart.cbe-snow
c) uboot.kpart.cbe-snow-alternative
d) uboot.kpart.cbe-spring

4) /dev/sdh4 : inside here I have copied all the files of the jammy
userland prepared by hexdump0818.

That's all. What I want to do is if and how can I chainload the
"non-verified u-boot"
that is installed on the partition /dev/sdh1 with grub or whatever
mechanism it is able to boot the hexdump0815 jammy iso image.

As I repeat,the "non-verified u-boot" is produced by the script called
"build.sh",that's stored inside the u-boot/scripts directory. And if what I
want to do is impossible,can you explain to me how I can enable kvm on my
chromebook arm,using the most recent kernel possible ? I already know that
the support for kvm on arm 32 has been dropped on kernel 5.7,but for me to
use a lower kernel than 5.7 is ok. I've been working on this project for a
lot of months. I would like to see some progress. Thanks.

-- 
Mario.


More information about the U-Boot mailing list