Booting Ubuntu on LattePanda Mu with SlimbootLoader

This is the only open-source X86 BIOS solution available online, which allows for booting Ubuntu on Latte Panda Mu.

To use SlimBootLoader on Latte Panda Mu, you also need to prepare the following hardware:

1. A hardware tool to flash IFWI, such as: SF100 programmer;

2. A tool to view serial Log, such as: CH343 serial to USB tool, used for configuring and installing Ubuntu;

3. Prepare 2 USB drives, one for creating the Ubuntu installation disk. I used a 64GB Kingston USB drive, formatted it to FAT32 using DiskGuinus (note not to use exFat). Extract all contents of Ubuntu into the root directory of the USB drive; the other USB drive is for creating the boot script.

The first step is to generate a bootable IFWI for Latte Panda Mu. According to【Reference 1 QEMU.

a. Compile the BIOS code:

Python BuildLoader.py build adln

b. Generate IFWI, here I did not use mFIT but directly replaced the original code in the BIOS Region.

python Platform/AlderlakeBoardPkg/Script/StitchLoader.py -i LattePanda.bin -s Outputs/adln/SlimBootloader.bin -o LattePanda_ifwi.bin -p 0xAA000007

In the above command, LattePanda.bin is the original IFWI provided by DFRobot, and the BIOS is from AMI CodeBase; SlimBootloader.bin is the BIOS generated from SBL Build; finally, LattePanda_ifwi.bin is the newly generated IFWI.

d. In the shutdown state, connect the USB to serial tool to LattePanda Mu’s PCH UART0.

c. Use SF100 or another programmer to flash LattePanda_ifwi.bin onto LattePanda Mu.

d. After starting LattePanda Mu, it will quickly complete the startup and display the SBL Logo. At this point, SBL will not interact via screen and keyboard, but through serial. You can see a text Shell interface by opening the serial tool on another computer, enter the boot command, then adjust to boot from USB devices such as:

Thus, the preparation on the Firmware side is complete.

The second step is to install Ubuntu and set it up【Reference 2】.

a. This will take some time, please be patient, and then enter the following interface. The left side works directly in the USB provided Live Linux, and the right side is for installation. Here you need to select the left button “Try Ubuntu”.

Booting Ubuntu on LattePanda Mu with SlimbootLoader

Open a Terminal from the left corner of Activities

Booting Ubuntu on LattePanda Mu with SlimbootLoader

b. Use lsblk to list the current devices. The LattePanda Mu has built-in eMMC, which is the mmcblk0 device.

Booting Ubuntu on LattePanda Mu with SlimbootLoader

c. Use sudo disk /dev/mmcblk0 to wipe the hard drive, the command is as follows:

sudo gdisk /dev/mmcblk0

x

z

y

y

Booting Ubuntu on LattePanda Mu with SlimbootLoader

d. Create GPT partitions:

sudo gdisk /dev/mmcblk0

o

y

w

y

Booting Ubuntu on LattePanda Mu with SlimbootLoader

e. Next, you can proceed with the Ubuntu installation.

f. The partition needs special handling, allocate a 500MB FAT32 partition for booting.

Booting Ubuntu on LattePanda Mu with SlimbootLoader

g. The remaining capacity reduced by 4GB or so, set as Ext4 partition.

Booting Ubuntu on LattePanda Mu with SlimbootLoader

h. Finally, create a 4GB partition as a SWAP partition.

Booting Ubuntu on LattePanda Mu with SlimbootLoader

i. Next, select Continue

j. After installation, select Continue Testing

Booting Ubuntu on LattePanda Mu with SlimbootLoader

k. Next, use lsblk

l. Enter the following command:

Mkdir rootSudo mount /dev/mmcblk0  root/

m. Insert another USB drive which contains three scripts with the following content in cmdline.txt

echo "root=/dev/ mmcblk0  ro quiet splash" > cmdline.txt

n. Run the following batch process (the PEM file comes from compiling the SBL code)

python3 GenContainer.py create -cl CMDL:cmdline.txt KRNL:./root/boot/vmlinuz-<kernel-version> INRD:./root/boot/initrd.img-<kernel-version> -k ./SblKeys/OS1_TestKey_Priv_RSA3072.pem -a RSA3072_PKCS1_SHA2_384 -t CLASSIC -o sbl_ossudo cp sbl_os ./root/bootsudo umount ./root

o. Finally, remove the USB drive, and you can boot.

A complete video of the above operations (the entire installation process is lengthy):

This is just a simple first step, self-compiling BIOS and booting X86 Ubuntu. Many functions have not been debugged, and you may encounter issues during use (for example, X4 PCIE support, Audio support). If you have some requirements for performance and size, or have special requirements for BIOS customization, consider DFRobot launched LattePanda MU, which consists of a core board and a baseboard, and the manufacturer provides circuit diagrams and corresponding interfaces for easy customization.

Booting Ubuntu on LattePanda Mu with SlimbootLoader

The code mentioned in this article can be downloaded from https://gitee.com/willok/slimbootloader, provided by Tian Sha.

References:

1.https://www.lab-z.com/sblb/

2.https://slimbootloader.github.io/how-tos/boot-ubuntu.html#setup-spn-os-container-boot

Leave a Comment

Your email address will not be published. Required fields are marked *