XU4 Bad Linux ARM zImage magic (SOLVED!)

Post Reply
magnum_pi
Posts: 206
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Has thanked: 0
Been thanked: 0
Contact:

XU4 Bad Linux ARM zImage magic (SOLVED!)

Unread post by magnum_pi » Wed Oct 09, 2019 10:58 pm

I'm having problems booting my XU4 (from emmc) after installing

Code: Select all

linux-image-4.14-armhf-odroid-xu4
.

The error message is as in the subject line.

The contents of the /boot directory are:

Code: Select all

-rwxr-xr-x 1 root root 3764205 Jan 24  2017 uInitrd-3.10.92+
-rwxr-xr-x 1 root root 2702381 Sep  4  2019 System.map-4.14.141+
-rwxr-xr-x 1 root root  151275 Sep  4  2019 config-4.14.141+
-rwxr-xr-x 1 root root 5694240 Sep  4  2019 vmlinuz-4.14.141+
-rwxr-xr-x 1 root root   63628 Sep  4  2019 exynos5422-odroidxu4-kvm.dtb
-rwxr-xr-x 1 root root   63484 Sep  4  2019 exynos5422-odroidxu4.dtb
-rwxr-xr-x 1 root root   62462 Sep  4  2019 exynos5422-odroidxu3-lite.dtb
-rwxr-xr-x 1 root root   63517 Sep  4  2019 exynos5422-odroidxu3.dtb
-rwxr-xr-x 1 root root   56387 Sep  4  2019 exynos5422-odroidhc1.dtb
-rwxr-xr-x 1 root root 3787267 Sep 24  2019 uInitrd-3.10.104+
-rwxr-xr-x 1 root root 5568957 Oct  9  2019 uInitrd-4.14.141+
-rwxr-xr-x 1 root root 5568893 Oct  9  2019 initrd.img-4.14.141+
-rwxr-xr-x 1 root root 5694240 Oct  9  2019 zImage
-rwxr-xr-x 1 root root 5568957 Oct  9  2019 uInitrd
-rwxr-xr-x 1 root root    9069 Oct  9  2019 boot.ini
The last files dated Oct 9 are what were installed by the package. The install also brought in uboot as a dependency.

In my main sources.list, I'm using Devuan Ascii, after installing meveric's minimal stretch distro and doing a dist-upgrade to the new distro.

Sources that are enabled in my sources.list.d directory are

Code: Select all

meveric-all.list:
 deb http://oph.mdrjr.net/meveric all main testing
meveric-all-XU3.list:
 deb http://oph.mdrjr.net/meveric all xu3
The exact version of the kernel debian package that was installed seems to be:

Code: Select all

Package: linux-image-4.14.141+
Status: install ok installed
...
Version: 4.14.141-20190904-xu4
The zImage file hash also matches what's in the deb package:

Code: Select all

f1bd7a72494ee12e92be0ddc49392969  /boot/vmlinuz-4.14.141+
f1bd7a72494ee12e92be0ddc49392969  /boot/zImage
I've tested everything I can think of. I'm sure that the kernel images are compatible with Devuan/Debian because I've got older versions installed on other XU4 boards, eg:

Code: Select all

hc2# dpkg -l linux-image\* | grep ii
ii  linux-image-4.14-armhf-odroid-xu4 4.14.28-1            armhf        Linux Image/Headers Meta Package for ODROIDs
ii  linux-image-4.14.28+              4.14.28-20180322-xu4 armhf        Linux kernel, version 4.14.28+
That machine has 'http://deb.odroid.in/5422-s bionic' in the sources.list, though, rather than "https://oph.mdrjr.net/meveric all xu3". Maybe that's where the problem is?

Any help would be appreciated. Thank you.
Last edited by magnum_pi on Thu Oct 10, 2019 4:14 am, edited 1 time in total.

User avatar
meveric
Posts: 10485
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 17 times
Been thanked: 131 times
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by meveric » Thu Oct 10, 2019 12:39 am

hmm I'm not 100% sure, I've heard there are some issues with the HC2 but I haven't tried anything regarding this yet.
Do you have a UART to see the messages on boot?
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

magnum_pi
Posts: 206
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by magnum_pi » Thu Oct 10, 2019 12:57 am

Some more information..

I'm dual-booting with an SD card so I can log on using chroot.

I put these in my /etc/fstab on the SD card:

Code: Select all

# For running in chroot
/proc /mnt/emmc_root/proc none defaults,notauto,bind 0 0
/sys /mnt/emmc_root/sys none defaults,notauto,bind 0 0
/dev /mnt/emmc_root/dev none defaults,notauto,bind 0 0
Then I mounted the emmc at /mnt/emmc and mounted the above:

Code: Select all

mount /mnt/emmc/dev
mount /mnt/emmc/proc
mount /mnt/emmc/sys
This lets me log on to the OS on the emmc card:

Code: Select all

chroot /mnt/emmc /bin/bash
From there, I was able to install the linux-image-4.14.28+ kernel that was working on the other board, but it still gives the same error message.

I noticed something else in the boot message:

Code: Select all

U-Boot 2017.05-15377-gedb23d4 (Aug 24 2017 - 07:09:51 -0300) for ODROID-XU4

CPU:   Exynos5422 @ 800 MHz
Model: Odroid XU4 based on EXYNOS5422
Board: Odroid XU4 based on EXYNOS5422
Type:  xu4
DRAM:  2 GiB
MMC:   EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
MMC Device 0 (eMMC): 29.1 GiB
Info eMMC rst_n_func status = enabled
MMC Device 1 ( SD ): 7.5 GiB

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Press quickly 'Enter' twice to stop autoboot:  0 
reading boot.ini
9069 bytes read in 5 ms (1.7 MiB/s)
cfgload: applying boot.ini...
cfgload: setenv initrd_high "0xffffffff"
cfgload: setenv fdt_high "0xffffffff"
cfgload: setenv macaddr "00:1e:06:61:7a:26
cfgload: setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=LABEL=emmc_root rootwait ro fsck.repair=yes"
cfgload: setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; fatload mmc 0:1 0x42000000 uInitrd; if test "${board_name}" = "xu4"; i
cfgload: if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi
cfgload: if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"i
cfgload: if test "x${board_name}" = "x"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; fi; bootz 0x40008000 0x4200000"
Bad Linux ARM zImage magic!
cfgload: setenv vout "hdmi"
cfgload: setenv governor "performance"
cfgload: setenv HPD "true"
cfgload: setenv hdmi_tx_amp_lvl  "31"
cfgload: setenv hdmi_tx_lvl_ch0      "3"
cfgload: setenv hdmi_tx_lvl_ch1      "3"
cfgload: setenv hdmi_tx_lvl_ch2      "3"
cfgload: setenv hdmi_tx_emp_lvl      "6"
cfgload: setenv hdmi_clk_amp_lvl     "31"
cfgload: setenv hdmi_tx_res      "0"
cfgload: setenv hdmi_phy_control "hdmi_tx_amp_lvl=${hdmi_tx_amp_lvl} hdmi_tx_lvl_ch0=${hdmi_tx_lvl_ch0} hdmi_tx_lvl_ch1=${hdmi_tx"
cfgload: setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control}"
cfgload: boot
reading zImage
5661776 bytes read in 159 ms (34 MiB/s)
reading uInitrd
5557878 bytes read in 152 ms (34.9 MiB/s)
reading exynos5422-odroidxu4.dtb
** Unable to read file exynos5422-odroidxu4.dtb **
mmc block read, dev 0, addr 0x40008000, blk start 2047, blk cnt 16384
Bad Linux ARM zImage magic!
Exynos5422 # 
Just before the zImage error, it's saying "Unable to read file exynos5422-odroidxu4.dtb". That file wasn't included in uboot, but I found it in /usr/lib/linux-image-4.14.28+ and copied it into my boot dir.

Unfortunately, now the loader does find and load the .dtb file, but is still fails to load the kernel:

Code: Select all

reading exynos5422-odroidxu4.dtb
63776 bytes read in 9 ms (6.8 MiB/s)
mmc block read, dev 0, addr 0x40008000, blk start 2047, blk cnt 16384
Bad Linux ARM zImage magic!
Exynos5422 #  
I really don't want to have to re-flash an image. Basically, if updating the kernel fails like this here, I'm sure that it will happen again later on this board and other that I have, so re-flashing is not a practical solution for me.

Thanks for any help/comments you might have.

magnum_pi
Posts: 206
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by magnum_pi » Thu Oct 10, 2019 12:59 am

meveric wrote:
Thu Oct 10, 2019 12:39 am
hmm I'm not 100% sure, I've heard there are some issues with the HC2 but I haven't tried anything regarding this yet.
Do you have a UART to see the messages on boot?
Yes, I'm logging in with the UART. I've also got the board booting with an SD card as I wrote in my second post above. (I was writing it as your post came in)

User avatar
meveric
Posts: 10485
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 17 times
Been thanked: 131 times
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by meveric » Thu Oct 10, 2019 1:14 am

first of all, be careful with dual boot.
If you have Ubuntu and Debian image connected at the same time than they have the same UUID for the rootfs, which can cause issues.
Either only connect one at a time or you need to change UUIDs and configs that use them.

I wonder why it's saying: it can't find exynos5422-odroidxu4.dtb...
Do you have bootfs mounted somewhere differently?
It assumes that it's either mounted under /boot (Debian) or under /media/boot (HardKernels Ubuntu image).
Can you mount check the bootfs directly and not just /boot ?
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

magnum_pi
Posts: 206
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by magnum_pi » Thu Oct 10, 2019 2:15 am

Dual boot is working OK. I always change the UUID of the linux volume.

I can see that the two boot partitions aren't conflicting either, since I see different uboot version numbers after flicking the emmc/sd switch.

From SD:

Code: Select all

U-Boot 2012.07 (Apr 25 2014 - 15:52:11) for Exynos5422

CPU: Exynos5422 Rev0.1 [Samsung SOC on SMP Platform Base on ARM CortexA7]
APLL = 800MHz, KPLL = 800MHz
MPLL = 532MHz, BPLL = 825MHz
From emmc:

Code: Select all

U-Boot 2017.05-15377-gedb23d4 (Aug 24 2017 - 07:09:51 -0300) for ODROID-XU4

CPU:   Exynos5422 @ 800 MHz
Model: Odroid XU4 based on EXYNOS5422
Board: Odroid XU4 based on EXYNOS5422
Type:  xu4
DRAM:  2 GiB
MMC:   EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
MMC Device 0 (eMMC): 29.1 GiB
Info eMMC rst_n_func status = enabled
MMC Device 1 ( SD ): 7.5 GiB
I assume there can only be one u-boot found?

magnum_pi
Posts: 206
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by magnum_pi » Thu Oct 10, 2019 2:26 am

Hmm. Something weird is happening... it seems to boot now if I manually run:

Code: Select all

boot
bootz 0x40008000 0x42000000 0x44000000
Is there something wrong with the boot.ini section below:

Code: Select all

# boot commands
setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; fatload mmc 0:1 0x42000000 uInitrd; if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi
if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi
if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"; fi
#failsafe
if test "x${board_name}" = "x"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; fi; bootz 0x40008000 0x42000000 0x44000000"
I'm specifically wondering about all the double quotes. I assume that everything between the first " and the one on the last line is supposed to be the "bootcmd", even though there's no \" escaping. Is this the way u-boot works? Or is there a problem in the kernel's postinst script (which I think changed the boot.ini)?

So this is some progress, but I'd prefer not to keep the serial debugger attached all the time so that I can manually boot up when I need to...

User avatar
meveric
Posts: 10485
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 17 times
Been thanked: 131 times
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by meveric » Thu Oct 10, 2019 2:30 am

the section in the boot.ini does not look correct and should look more like this:

Code: Select all

# Load kernel, initrd and dtb in that sequence
fatload mmc 0:1 0x40008000 zImage
fatload mmc 0:1 0x42000000 uInitrd
if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi
if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi
if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"; fi
#failsafe
if test "x${board_name}" = "x"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; fi
actually the part with setenv fdtloaded "true"; is pretty stupid as well, and is from an older version of that part of the boot.ini... it's not used and can be removed as well.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

magnum_pi
Posts: 206
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by magnum_pi » Thu Oct 10, 2019 2:42 am

Success! Thanks, meveric.

It seems that I must have had this board running your wheezy at one time, and then just kept dist-upgrading through jessie to Devuan ascii. I guess that that's where the old boot.ini came from.

In addition to what you wrote, I also changed the end of the boot.ini to:

Code: Select all

# Boot the board
#boot
bootz 0x40008000 0x42000000 0x44000000
Thanks again!

User avatar
meveric
Posts: 10485
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 17 times
Been thanked: 131 times
Contact:

Re: XU4 Bad Linux ARM zImage magic

Unread post by meveric » Thu Oct 10, 2019 3:40 am

glad it's working.
Yeah Wheezy was a long time.. from Jessie to Stretch it might have worked, but Wheezy... yeah that's old :D
No boot.ini updates back then I think..
and no setup-odroid packages that would have taken care of this.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest