Help Upgrading the Kernel and u-boot

Hi All,

I got a vim3 yesterday, installed krescue into an sdcard and from there, I installed ubuntu focal 20.04 into the MMC.

From there, I tried to upgrade u-boot to mainline u-boot, so I followed the steps in the documentation, setting the board as vim3, mainline kernel, mainline u-boot, SD card (as there was no EMMC option).

I got the .deb package, installed & rebooted, and… the system never got up again. Something about corrupted file system.

Ok – scratch that. I started again, installed the same ubuntu, and decided to only update the kernel. Same story. I was able to reproduce make the .deb image, and after installing it and rebooting, the system wouldn’t boot anymore because of corrupted filesystem (this time I have the uboot console to do something).

I am not sure how to proceed. What is the recommended way of updating the kernel on the eMMC? Well, I don’t really care whether it’s on the emmc or an sd card, but I just want to be able to run a custom kernel :frowning:

Can anyone point me on the right direction?
Thanks!

Hello @Marco

Please check here:

Hi @numbqq ,

Thanks for your answer.

As I mentioned in my post, I have followed the steps in the documentation that you linked to.

In particular, I am having issues after doing the steps that involve installing the debian packages for u-boot and the linux kernel:

$ sudo dpkg -i linux-u-boot-vim3-vendor_0.8.3-2015.01_arm64.deb
$ sync
$ sudo reboot

After that reboot the system doesn’t come up. Maybe I am not supposed to run that with the mainline kernel (for sdcard) in the emmc?

You are right. You can not upgrade mainline kernel to vendor kernel.

Please use the mainline kernel.

Hi @numbqq
I didn’t quite catch your answer.

You mean that’s not possible to write the mainline kernel onto the emmc and boot from it directly? I need to have an emmc os and boot from the sd card with the new kernel?

What kernel on eMMC? 4.9 or 5.x ?

If the kernel is 4.9, you need to choose 4.9 linux to build the debian package.
If the kernel is 5.x, you need to choose mainline linux to build the debian package.

I think I get it. Thanks for the patience.

I have a few follow up questions.
I installed from krescue the ubuntu 5.7 focal, which says it’s for an SDCARD: VIM3_Ubuntu-gnome-focal_Linux-5.7-rc7_arm64_SD-USB_V0.9-20200530.img.xz… however, I guess it got installed in the eMMC. Is that OK? Should that work?

The other question is that: I have 5.7 focal (installed directly from krescue), should I update via the debian packages then? would that work?

Thanks again!

Yes, you can use krescue to install it to eMMC.

It should work.

Hmm… I couldn’t get it to work :frowning:

khadas@Khadas:~$ sudo dpkg -i linux-dtb-amlogic-mainline_1.0.2_arm64.deb 
(Reading database ... 126200 files and directories currently installed.)
Preparing to unpack linux-dtb-amlogic-mainline_1.0.2_arm64.deb ...
Unpacking linux-dtb-amlogic-mainline (1.0.2) over (0.9) ...
dpkg: error processing archive linux-dtb-amlogic-mainline_1.0.2_arm64.deb (--install):
 error setting ownership of '/boot/dtb-5.10.0-rc6.dpkg-new': Operation not permitted
mv: cannot stat '/boot/dtb-5.7.0-rc7': No such file or directory
cp: cannot stat '/boot/dtb/amlogic/meson-g12b-a311d-khadas-vim3.dtb': No such file or directory
Errors were encountered while processing:
 linux-dtb-amlogic-mainline_1.0.2_arm64.deb

This is my /boot dir:

khadas@Khadas:~$ ls -l /boot
total 80772
-rwxr-xr-x 1 root root      868 May 30  2020 aml_autoscript
-rwxr-xr-x 1 root root      796 May 30  2020 aml_autoscript.txt
-rwxr-xr-x 1 root root      803 May 30  2020 aml_autoscript.zip
-rwxr-xr-x 1 root root     8282 May 30  2020 boot.ini
-rwxr-xr-x 1 root root     8600 May 30  2020 boot.scr
-rwxr-xr-x 1 root root   182505 May 30  2020 config-5.7.0-rc7
-rwxr-xr-x 1 root root    50997 Feb 19 03:19 dtb.img
-rwxr-xr-x 1 root root     2792 May 30  2020 env.txt
-rwxr-xr-x 1 root root 11947972 May 30  2020 initrd.img-5.7.0-rc7
-rwxr-xr-x 1 root root     8600 May 30  2020 s905_autoscript
-rwxr-xr-x 1 root root     8528 May 30  2020 s905_autoscript.cmd
-rwxr-xr-x 1 root root  4603676 May 30  2020 System.map-5.7.0-rc7
-rwxr-xr-x 1 root root     8192 Jan  1  1980 uboot.env
-rwxr-xr-x 1 root root 11948036 May 30  2020 uInitrd
-rwxr-xr-x 1 root root 11948036 May 30  2020 uInitrd-5.7.0-rc7
-rwxr-xr-x 1 root root 20969480 May 30  2020 vmlinuz-5.7.0-rc7
-rwxr-xr-x 1 root root 20969480 May 30  2020 zImage

Any suggestions?

OK. We will check on our side.

Hello @miah.li Please check.

I have fixed this issue. Please update your code and rebuild the kernel debian package again.

Hi Nick!

Thanks for the help, I updated the code today and was able to upgrade the kernel :slight_smile:

The only hiccup is that the headers deb package was having some issues:

khadas@Khadas:~$ sudo dpkg -i linux-headers-amlogic-mainline_1.0.2_arm64.deb
(Reading database ... 126205 files and directories currently installed.)
Preparing to unpack linux-headers-amlogic-mainline_1.0.2_arm64.deb ...
Unpacking linux-headers-amlogic-mainline (1.0.2) over (0.9) ...
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/scripts/mod': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/scripts/kconfig': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/scripts/dtc': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/scripts/basic': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/scripts': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/stackprotector': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/have/dynamic': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/have': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/cc/has/asm': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/cc/has': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/cc': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/as/has': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config/as': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include/config': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7/include': Directory not empty
dpkg: warning: unable to delete old directory '/usr/src/linux-headers-5.7.0-rc7': Directory not empty
Setting up linux-headers-amlogic-mainline (1.0.2) ...
Compiling headers - please wait ...

But I will remove those manually.

¡Ah! After updating the kernel, my dmesg log is filled with messages like this:

[  157.975364]  fe.dai-link-0: ASoC: no backend DAIs enabled for fe.dai-link-0

Hello @Marco

It doesn’t matter.