Build new linux kernel for Yocto image

I downloaded TorizonCore Embedded Linux Images for imx8, then used easy installer to upgrade whole system. Now I want to only upgrade linux kernel, then I downloaded Linux kernel source files, and build it. I copied the Image to /boot/ostree/torizon-d397ddae5d6bcb44857075977a42cc0856e6b55d9635b3df3ff4ad623271dc8a and rename it to vmlinuz-4.14.170-4.0.0-devel+git.60f8ee9af1da (old kernel file name). However I found Linux system can not boot up, it always reboots automatically.

I remove ‘quiet’ of linux command parameter, the following is a part of linux log information:

Starting version 243.2+
[    8.285433] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    8.495650] systemd[1]: systemd 243.2+ running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[    8.518254] systemd[1]: Detected architecture arm64.
[    8.528081] systemd[1]: Set hostname to <apalis-imx8-06540982>.
[    8.760301] systemd[1]: /usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
[    8.812424] systemd[1]: /usr/lib/systemd/system/docker.socket:6: ListenStream= references a path below legacy directory /var/run/, updating /var/run/docker.sock → /run/docker.sock; please update the unit file accordingly.
[    8.887743] systemd[1]: /usr/lib/systemd/system/rpcbind.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/rpcbind.sock → /run/rpcbind.sock; please update the unit file accordingly.
[    9.073111] random: systemd: uninitialized urandom read (16 bytes read)
[    9.082943] systemd[1]: Created slice system-getty.slice.
[    9.088833] random: systemd: uninitialized urandom read (16 bytes read)
[    9.096628] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    9.103081] random: systemd: uninitialized urandom read (16 bytes read)
[    9.110557] systemd[1]: Created slice User and Session Slice.
[    9.116650] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    9.155386] random: crng init done
[    9.159110] random: 7 urandom warning(s) missed due to ratelimiting
[    9.194827] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    9.901387] [VPU Encoder] enable mu for core[0]
[    9.913658] [VPU Encoder] vpu encoder core[0] firmware version is 1.2.6
[    9.961080] switch cluster 0 cpu-freq governor to schedutil
[    9.989928] switch cluster 1 cpu-freq governor to schedutil
[   10.035566] fec 5b040000.ethernet ethernet0: renamed from eth0
[   10.300315] systemd-journald[2730]: Received client request to flush runtime journal.
[   12.032261] IPv6: ADDRCONF(NETDEV_UP): ethernet0: link is not ready
[   12.118286] Micrel KSZ9031 Gigabit PHY 5b040000.ethernet-1:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=5b040000.ethernet-1:07, irq=207)
[   12.133052] IPv6: ADDRCONF(NETDEV_UP): ethernet0: link is not ready
[   34.015717] systemd-journald[2730]: Received client request to relinquish /var access.
[   34.186925] systemd-shutdow: 75 output lines suppressed due to ratelimiting
[   34.217799] systemd-shutdown[1]: Syncing filesystems and block devices.
[   34.230506] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[   34.253826] systemd-journald[2730]: Received SIGTERM from PID 1 (systemd-shutdow).
[   34.289647] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[   34.309269] systemd-shutdown[1]: Process 2644 (plymouthd) has been marked to be excluded from killing. It is running from the root file system, and thus likely to block re-mounting of the root file system to read-only. Please consider moving it into an initrd file system instead.
[   34.336136] systemd-shutdown[1]: Hardware watchdog 'i.MX8 watchdog timer', version 0
[   34.346199] systemd-shutdown[1]: Unmounting file systems.
[   34.354427] [4294]: Remounting '/usr' read-only in with options 'data=ordered'.
[   34.370865] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
[   34.382220] [4295]: Remounting '/' read-only in with options 'data=ordered'.
[   34.389537] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
[   34.396354] systemd-shutdown[1]: All filesystems unmounted.
[   34.402200] systemd-shutdown[1]: Deactivating swaps.
[   34.407365] systemd-shutdown[1]: All swaps deactivated.
[   34.412660] systemd-shutdown[1]: Detaching loop devices.
[   34.430488] kvm: exiting hardware virtualization
[   35.128161] ci_hdrc ci_hdrc.1: remove, state 1
[   35.132655] usb usb3: USB disconnect, device number 1
[   35.137727] usb 3-1: USB disconnect, device number 2
[   35.145641] ci_hdrc ci_hdrc.1: USB bus 3 deregistered
[   35.151301] arm-smmu 51400000.iommu: removing device with active domains!
[   35.158175] reboot: Restarting system

then I read ‘Build TorizonCore With Yocto’, and built a new image (I do not change any source code). I only copied the Linux kernel file to above directory and rename it. system can not boot uo either.

In addition, I used Linux Console Image, and copy the Linux Image I just built to boot partion and overwrite old kernel, it works well.

so how can I only upgrade Linux kernel for TorizonCore Embedded Linux Images?

Could you please tell us why do you need to replace Linux kernel at Torizon Core? The main advantage of Torizon is that you are doing all development at containers’ level and you don’t need to modify kernel.

In my product, I only want to upgrade linux kernel, device tree and my application, I do not need to upgrade uboot and rootfs. so I will pack new linux kernel, device tree and my application to an image, customer can use this image to upgrade their devices.
and I changed Linux kernel to adapt my system, maybe in the future I still will modify more, so I have to upgrade Linux kernel.

Hi @wen_jian_1973,

If I understand correctly you plan to update the kernel/device-tree/application over the span of your product’s life after it’s been deployed? It sounds like you already have a solution you plan to use to perform updates, correct?

Just to let you know Torizon does come with an over-the-air (OTA) update client that you can make use of. With it you can perform updates/upgrades over time on your system.

Best Regards,
Jeremias