[Solved] ERROR: can't get kernel image!

Moderators: mdrjr, odroid

[Solved] ERROR: can't get kernel image!

Unread postby Oupsee » Sun Jan 14, 2018 8:23 am

Hi,

Could do with some help to repair an Ubuntu Mate image on µSD, if at all possible... of course no backup :roll:
Apologies for this rather long post, not sure what's needed really.

C1 running ubuntu-16.04.3-mate-odroid-c1-20170908.img.xz all tuned up and up to date using apt-get from terminal. That is until I decided to install new kernel image available from official repo since 03/01/2018 apparently.
Code: Select all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Everything looking good, no error, 30 packages or so upgraded, linux-image-c1 being held back (as usual)
Code: Select all
sudo apt-get autoremove

Reboot and then:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 3.10.107-190 armv7l)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

1 package can be updated.
0 updates are security updates.

Last login: Sat Jan 13 17:17:37 2018 from 192.168.0.2

Code: Select all
sudo apt-get install linux-image-c1

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
linux-image-3.10.107-191
Suggested packages:
fdutils linux-doc-3.10.107-191 | linux-source-3.10.107-191 linux-image-3.10.107-191-dbg linux-manual-3.10.107-191
The following packages will be REMOVED:
linux-image-3.10.107-190
The following NEW packages will be installed:
linux-image-3.10.107-191
The following packages will be upgraded:
linux-image-c1
1 upgraded, 1 newly installed, 1 to remove and 1 not upgraded.
Need to get 11.8 MB/11.8 MB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] Y

Get:1 http://deb.odroid.in/c1 xenial/main armhf linux-image-3.10.107-191 armhf 20180103 [11.8 MB]
Fetched 11.8 MB in 2min 28s (79.5 kB/s)
Preconfiguring packages ...
Selecting previously unselected package linux-image-3.10.107-191.
(Reading database ... 183395 files and directories currently installed.)
Preparing to unpack .../linux-image-3.10.107-191_20180103_armhf.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/remove-old-on-upgrade 3.10.107-191 /boot/uImage-3.10.107-191
Done.
Unpacking linux-image-3.10.107-191 (20180103) ...
Replacing files in old package linux-image-3.10.107-190 (20170904) ...
dpkg: linux-image-3.10.107-190: dependency problems, but removing anyway as you requested:
linux-image-c1 depends on linux-image-3.10.107-190.

(Reading database ... 184647 files and directories currently installed.)
Removing linux-image-3.10.107-190 (20170904) ...
dpkg: error processing package linux-image-3.10.107-190 (--remove):
subprocess installed pre-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-3.10.107-190
E: Sub-process /usr/bin/dpkg returned an error code (1)

At one stage I was presented with a reddish screen asking if I wanted to keep current image. I stuck with default answer YES as was strongly advised "unless I knew exactly what I was doing"... (I remember selecting NO in a previous attempt and having to reinstall Ubuntu Core from scratch)

But now booting gets stuck with both leds lit up constant (blue + red):

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2018.01.13 23:11:17 =~=~=~=~=~=~=~=~=~=~=~=
QA5:A;SVN:B72;POC:17F;STS:0;BOOT:0;INIT:10;BOOT:1;INIT:0;READ:0;CHECK:0;PASS:1;
-----------------------------------------------------------------------
* Welcome to Hardkernel's ODROID-C... (Built at 19:33:00 Dec 8 2014) *
-----------------------------------------------------------------------
CPU : AMLogic S805
MEM : 1024MB (DDR3@792MHz)
BID : HKC13C0001
S/N : HKC1CC0*********
0x0000009f
check SD_boot_type:0x1 card_type:0x1
Loading U-boot...success.


U-boot-00000-g87cafd6(odroidc@87cafd6a) (Jul 12 2016 - 17:04:30)

I2C: clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[25]=0
clear pinmux reg8[12]=0
clear pinmux reg1[3]=0
clear pinmux reg1[2]=0
set output en 0xc1108054[20]=1
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[25]=0
clear pinmux reg8[12]=0
clear pinmux reg1[3]=0
clear pinmux reg1[2]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[20]=0
set output val 0xc1108058[20]=0
clear pinmux reg1[25]=0
clear pinmux reg8[12]=0
clear pinmux reg1[3]=0
clear pinmux reg1[2]=0
set output en 0xc1108054[20]=1
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=fffcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffdcfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[25]=0
clear pinmux reg8[12]=0
clear pinmux reg1[3]=0
clear pinmux reg1[2]=0
out reg=c1108058,value=ffccfa00
set output en 0xc1108054[20]=0
set output val 0xc1108058[20]=0
clear pinmux reg1[24]=0
clear pinmux reg1[1]=0
out reg=c1108058,value=ffecfa00
set output en 0xc1108054[21]=0
set output val 0xc1108058[21]=0
clear pinmux reg1[25]=0
clear pinmux reg8[12]=0
clear pinmux reg1[3]=0
clear pinmux reg1[2]=0
set output en 0xc1108054[20]=1
clear pinmux reg1[25]=0
clear pinmux reg8[12]=0
clear pinmux reg1[3]=0
clear pinmux reg1[2]=0
set output en 0xc1108054[20]=1
clear pinmux reg1[25]=0
clear pinmux reg8[12]=0
clear pinmux reg1[3]=0
clear pinmux reg1[2]=0
set output en 0xc1108054[20]=1
ready
DRAM: 1 GiB
relocation Offset is: 2ff18000
MMC: SDCARD: 0, eMMC: 1
IR init is done!
vpu clk_level = 3
set vpu clk: 182150000Hz, readback: 182150000Hz(0x701)
mode = 6 vic = 4
set HDMI vic: 4
mode is: 6
viu chan = 1
config HPLL
config HPLL done
reconfig packet setting done
MMC read: dev # 0, block # 33984, count 12288 ... 12288 blocks read: OK
There is no valid bmp file at the given address
============================================================
Vendor: Man 035344 Snr d04d25fa Rev: 8.0 Prod: SL08G
Type: Removable Hard Disk
Capacity: 7580.0 MB = 7.4 GB (15523840 x 512)
------------------------------------------------------------
Partition Start Sector Num Sectors Type
1 2048 262144 c
2 264192 15257601 83
============================================================
Net: Meson_Ethernet
init suspend firmware done. (ret:0)
Hit Enter key to stop autoboot -- : 1  0
exit abortboot: 0
reading boot.ini

3563 bytes read
Loading boot.ini from mmc0:1 (vfat)
Executing the script...
setenv m "1080p" # 1080P@60Hz
setenv vout_mode "hdmi"
setenv m_bpp "32"
setenv monitor_onoff "false" # true or false
setenv hpd "0"
setenv cec "0"
setenv disableuhs "disableuhs"
setenv vpu "1"
setenv hdmioutput "1"
setenv condev "console=tty0 console=ttyS0,115200n8" # on both
setenv disable_vu7 "false" # false
setenv max_freq "1536"
if test "${hpd}" = "0"; then setenv hdmi_hpd "disablehpd=true"; fi
if test "${cec}" = "1"; then setenv hdmi_cec "hdmitx=cecf"; fi
if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro ${condev} no_console_suspend fsck.repair=yes vdaccfg=0xa000 logo=osd1,loaded,0x7900000,720p,full dmfc=3 cvbsmode=576cvbs hdmimode=${m} m_bpp=${m_bpp} vout=${vout_mode} ${disableuhs} ${hdmi_hpd} ${hdmi_cec} ${enabledac} monitor_onoff=${monitor_onoff} max_freq=${max_freq} ${hid_quirks}"
fatload mmc 0:1 0x21000000 uImage
reading uImage

5532352 bytes read
fatload mmc 0:1 0x22000000 uInitrd
reading uInitrd

9223037 bytes read
fatload mmc 0:1 0x21800000 meson8b_odroidc.dtb
reading meson8b_odroidc.dtb

** Unable to read "meson8b_odroidc.dtb" from mmc 0:1 **
fdt addr 21800000
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi
if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi
bootm 0x21000000 0x22000000 0x21800000"
## Booting kernel from Legacy Image at 21000000 ...
Image Name: Linux-3.10.107-190
Image Type: ARM Linux Kernel Image (lzo compressed)
Data Size: 5532288 Bytes = 5.3 MiB
Load Address: 00208000
Entry Point: 00208000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 22000000 ...
Image Name: uInitrd
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 9222973 Bytes = 8.8 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
ÿ
Unknown command 'ÿ' - try 'help'
MMC read: dev # 0, block # 1216, count 16384 ... 16384 blocks read: OK
MMC read: dev # 0, block # 1088, count 128 ... 128 blocks read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
odroidc#


Please tell me there is some way to recover this image...

NB: line 7 of this post has been edited: "available from official repo since 03/01/2018", not 03/01/2017
Last edited by Oupsee on Sun Jan 28, 2018 6:24 am, edited 3 times in total.
Oupsee
 
Posts: 10
Joined: Sun Jan 14, 2018 4:57 am
languages_spoken: english
ODROIDs: C1

Re: ERROR: can't get kernel image!

Unread postby odroid » Sun Jan 14, 2018 11:47 am

Some files in the boot partition seem to be corrupted even your update steps had anything wrong.
Can you connect the SD card to a Linux PC to copy your important data first?
User avatar
odroid
Site Admin
 
Posts: 28490
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: ERROR: can't get kernel image!

Unread postby Oupsee » Sun Jan 14, 2018 7:18 pm

Data on SD card backed up now.
Thank you for looking into this odroid.
Code: Select all
sudo ls -lha /media/user1/boot/
total 15M
drwxr-xr-x  2 user1 users  16K janv.  1  1970 .
drwxr-x---+ 4 root  root  4,0K janv. 14 17:49 ..
-rw-r--r--  1 user1 users 3,5K déc.  26 21:01 boot.ini
-rw-r--r--  1 user1 users 1020 sept.  4 23:54 boot.ini.default
-rw-r--r--  1 user1 users 5,3M sept.  4 23:52 uImage
-rw-r--r--  1 user1 users 8,8M sept.  4 23:54 uInitrd

sudo ls -lha /media/user1/rootfs/
total 116K
drwxr-xr-x   22 root root 4,0K déc.  15 09:19 .
drwxr-x---+   4 root root 4,0K janv. 14 17:49 ..
drwxr-xr-x    2 root root 4,0K déc.  27 22:18 bin
drwxr-xr-x    2 root root 4,0K janv. 13 18:26 boot
drwxr-xr-x    4 root root 4,0K juil. 14  2016 dev
drwxr-xr-x  144 root root  12K janv. 13 16:45 etc
drwxr-xr-x    3 root root 4,0K déc.  15 19:23 home
drwxr-xr-x   21 root root 4,0K déc.  27 22:15 lib
drwx------    2 root root  16K juil. 14  2016 lost+found
drwxr-xr-x    3 root root 4,0K juil. 14  2016 media
drwxr-xr-x    2 root root 4,0K juil. 14  2016 mnt
drwxr-xr-x    2 root root 4,0K juil. 14  2016 opt
drwxr-xr-x    2 root root 4,0K avril 12  2016 proc
drwx------    6 root root 4,0K déc.  25 17:35 root
drwxr-xr-x    6 root root 4,0K juil. 14  2016 run
drwxr-xr-x    2 root root  12K déc.  27 22:18 sbin
drwxr-xr-x    2 root root 4,0K juin  29  2016 snap
drwxr-xr-x    2 root root 4,0K juil. 14  2016 srv
drwxr-xr-x    2 root root 4,0K févr.  5  2016 sys
drwxrwxrwt    8 root root 4,0K janv. 13 18:37 tmp
drwxr-xr-x   10 root root 4,0K juil. 14  2016 usr
drwxr-xr-x   14 root root 4,0K juil. 14  2016 var

sudo ls -lha /media/user1/rootfs/boot/
total 60M
drwxr-xr-x  2 root root 4,0K janv. 13 18:26 .
drwxr-xr-x 22 root root 4,0K déc.  15 09:19 ..
-rw-r--r--  1 root root 115K sept.  4 22:30 config-3.10.107-190
-rw-r--r--  1 root root 115K janv.  3 02:39 config-3.10.107-191
-rw-r--r--  1 root root 8,9M déc.  27 22:27 initrd.img-3.10.107-190
-rw-r--r--  1 root root 7,4M févr. 20  2017 initrd.img-4.4.0-28-generic
-rw-r--r--  1 root root  20K janv.  3 03:34 meson8b_odroidc.dtb
-rwxr-xr-x  1 root root  39K janv.  3 03:34 meson8b_odroidc.dts
-rw-------  1 root root 1,9M sept.  4 23:08 System.map-3.10.107-190
-rw-------  1 root root 1,9M janv.  3 03:32 System.map-3.10.107-191
-rw-------  1 root root 5,3M sept.  4 23:08 uImage-3.10.107-190
-rw-------  1 root root 5,3M janv.  3 03:32 uImage-3.10.107-191
-rw-r--r--  1 root root 8,8M sept.  4 23:54 uInitrd-3.10.104-184
-rw-r--r--  1 root root 8,9M sept.  4 23:52 uInitrd-3.10.107-190
-rw-r--r--  1 root root 8,8M févr. 20  2017 uInitrd-3.10.96-154
-rw-r--r--  1 root root 2,1M juil. 14  2016 uInitrd-4.4.0-28-generic


sudo ls -Rtlha /media/user1/rootfs/var/log/
/media/user1/rootfs/var/log/:
total 8,7M
-rw-rw-r--  1 root       utmp        44K janv. 13 18:38 wtmp
-rw-r-----  1 messagebus messagebus 1,4M janv. 13 18:37 syslog
-rw-r--r--  1 root       root        829 janv. 13 18:37 x11vnc.log
-rw-r-----  1 messagebus messagebus  62K janv. 13 18:37 auth.log
-rw-r--r--  1 root       root        14K janv. 13 18:37 Xorg.0.log
-rw-r-----  1 messagebus messagebus 1,7M janv. 13 18:31 kern.log
-rw-r--r--  1 root       root        39K janv. 13 18:28 dpkg.log
-rw-rw-r--  1 root       utmp       286K janv. 13 18:23 lastlog
drwxrwxr-x 13 root       messagebus 4,0K janv. 13 18:20 .
-rw-r--r--  1 root       root        14K janv. 13 18:20 Xorg.0.log.old
-rw-r--r--  1 root       root        535 janv. 13 16:35 alternatives.log

/media/user1/rootfs/var/log/lightdm:
total 140K
-rw-------  1 root root        24K janv. 13 18:37 lightdm.log
-rw-------  1 root root       7,5K janv. 13 18:37 x-0.log
-rw-------  1 root root        11K janv. 13 18:37 seat0-greeter.log
drwxrwxr-x 13 root messagebus 4,0K janv. 13 18:20 ..

/media/user1/rootfs/var/log/cups:
total 56K
-rw-r-----  1 root adm        1,6K janv. 13 18:37 access_log
drwxrwxr-x 13 root messagebus 4,0K janv. 13 18:20 ..

/media/user1/rootfs/var/log/apt:
total 184K
-rw-r--r--  1 root root       3,2K janv. 13 18:28 history.log
-rw-r-----  1 root adm         23K janv. 13 18:28 term.log
drwxrwxr-x 13 root messagebus 4,0K janv. 13 18:20 ..

var/log lists edited to show only latest log files.
Attachments
apt_term.log
(22.77 KiB) Downloaded 92 times
apt_history.log
(3.13 KiB) Downloaded 100 times
dpkg.log
(38.28 KiB) Downloaded 93 times
Oupsee
 
Posts: 10
Joined: Sun Jan 14, 2018 4:57 am
languages_spoken: english
ODROIDs: C1

Re: ERROR: can't get kernel image!

Unread postby odroid » Mon Jan 15, 2018 8:55 am

According to your log files, the kernel package was corrupted.
But I have no idea why it was corrupted. I just guess something was wrong in the EXT4 partition on your SD card.

I've just reflashed the Ubuntu image(20170908) on 8GB micro-SD.
I followed below steps and it updated well.
https://wiki.odroid.com/odroid-c1/os_im ... st-upgrade

Code: Select all
odroid@odroid:~$ uname -a
Linux odroid 3.10.107-190 #1 SMP PREEMPT Mon Sep 4 20:41:37 UTC 2017 armv7l armv7l armv7l GNU/Linux
User avatar
odroid
Site Admin
 
Posts: 28490
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: ERROR: can't get kernel image!

Unread postby Oupsee » Tue Jan 16, 2018 5:04 am

Huh? linux-image-3.10.107-191 (20180103) no longer available for the C1?
Is it regional repository differences?
Oupsee
 
Posts: 10
Joined: Sun Jan 14, 2018 4:57 am
languages_spoken: english
ODROIDs: C1

Re: ERROR: can't get kernel image!

Unread postby odroid » Tue Jan 16, 2018 9:26 am

Sorry, I forgot it.

After running sudo apt install linux-image-c1 and reboot, I got
Code: Select all
odroid@odroid:~$ uname -a                                                                                   
Linux odroid 3.10.107-191 #1 SMP PREEMPT Wed Jan 3 01:59:36 UTC 2018 armv7l armv7l armv7l GNU/Linux
User avatar
odroid
Site Admin
 
Posts: 28490
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: ERROR: can't get kernel image!

Unread postby Oupsee » Wed Jan 17, 2018 5:28 am

Ok, big thanks for doing the test.
Trying to learn from this crash and minimize the risk of a repeat, I have several questions for you please:

- Can I have apt apply further integrity checks before installing a downloaded kernel?

- Should I use apt rather than apt-get when upgrading odroid devices?

- Could a dodgy adm user account cause the crash somehow? I did modify default user/group names from odroid/odroid to user1/userg while leaving user/group ID as 1000/1000... Never was an issue with previous upgrades though.
odroid wrote:According to your log files, the kernel package was corrupted.

- Am I correct in assuming this is either an error during transfer or an error storing the package, the latter pointing to a failing SD card?

- What test should I run to rule out an SD card issue?
Code: Select all
sudo e2fsck -fpv /dev/sdd2
                                                                               
      201704 i-noeuds utilisés (41.73%, sur 483328)
         346 fichiers non contigus (0.2%)
         408 répertoires non contigus (0.2%)
             nombre d'i-noeuds avec des blocs ind/dind/tind : 0/0/0
             Histogramme des profondeurs d'extents : 149783/211
     1048879 blocs utilisés (55.00%, sur 1907200)
           0 bloc défectueux
           1 fichier de grande taille

      127975 fichiers normaux
       15867 répertoires
          54 fichiers de périphérique en mode caractère
          25 fichiers de périphérique en mode bloc
           0 fifo
          31 liens
       57774 liens symboliques (51622 liens symboliques rapides)
           0 socket
------------
      201726 fichiers

- Is this failure to boot consistant with a FAT partition error?
Code: Select all
sudo fsck -CV /dev/sdd1
fsck de util-linux 2.27.1
[/sbin/fsck.vfat (1) -- /dev/sdd1] fsck.vfat /dev/sdd1
fsck.fat 3.0.28 (2015-05-16)
0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 2
/dev/sdd1: 5 files, 7209/65399 clusters

- Any use running chkdsk /f from MS-DOS to try and repair the boot partition?
Oupsee
 
Posts: 10
Joined: Sun Jan 14, 2018 4:57 am
languages_spoken: english
ODROIDs: C1

Re: ERROR: can't get kernel image!

Unread postby odroid » Wed Jan 17, 2018 11:24 am

- I have no idea about further integrity check. I think "deb" package self-integrity check should be enough.
- apt-get should be fine. AFAIK, apt has faster downloading speed thanks to the multiple connections.
- I've never tried to use other accounts while I updated the system software. But 1000/1000 ID level should be fine.

In the boot partition(FAT32), there are several files to load and run Kernel.
Code: Select all
$ ls -alp /media/boot/
total 14516
drwxr-xr-x 2 root root   16384 Jan  1  1970 ./
drwxr-xr-x 4 root root    4096 Sep 19 10:11 ../
-rwxr-xr-x 1 root root    3563 Sep 26 01:28 boot.ini
-rwxr-xr-x 1 root root    1020 Sep 19 09:42 boot.ini.default
-rwxr-xr-x 1 root root    3357 Sep 19 09:42 boot.ini.old
-rwxr-xr-x 1 root root   20032 Jan 16 00:20 meson8b_odroidc.dtb
-rwxr-xr-x 1 root root   39545 Jan 16 00:20 meson8b_odroidc.dts
-rwxr-xr-x 1 root root 5532760 Jan 16 00:20 uImage
-rwxr-xr-x 1 root root 9238361 Jan 16 00:20 uInitrd


If the partition is still alive, download this file and extract it and copy the files into the boot partition.
https://dn.odroid.com/S805/Ubuntu/C1_boot.tar.gz
User avatar
odroid
Site Admin
 
Posts: 28490
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: ERROR: can't get kernel image!

Unread postby Oupsee » Sun Jan 28, 2018 6:16 am

Hello again,

Sorry for the long delay reporting back...
First, I removed the dirty bit on the unmounted 'boot' partition and had it checked ok with:
Code: Select all
sudo fsck -r -CV /dev/sdd1

Remounted 'boot' and extracted the files odroid provided into the partition (except for boot.ini).
SD card back on the C1 and powering up, the boot process completed fine [Thumbs up!]
[ 12.707140@2] systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
[ FAILED ] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.
[ 12.756715@2] systemd[1]: systemd-modules-load.service: Unit entered failed state.
[ 12.763842@2] systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
[ 12.772260@2] systemd[1]: ureadahead.service: Main process exited, code=exited, status=5/NOTINSTALLED
[ 12.782170@2] systemd[1]: ureadahead.service: Unit entered failed state.
[ 12.788527@2] systemd[1]: ureadahead.service: Failed with result 'exit-code'.
[ 12.796251@2] systemd[1]: Started Uncomplicated firewall.
[ OK ] Started Uncomplicated firewall.
[ 12.820207@2] systemd[1]: Started Create list of required static device nodes for the current kernel.
[ OK ] Started Create list of required sta...ce nodes for the current kernel.
[ 12.847478@0] systemd[1]: brltty.service: Main process exited, code=exited, status=228/SECCOMP
[ 12.857076@0] systemd[1]: brltty.service: Unit entered failed state.
[ 12.863281@0] systemd[1]: brltty.service: Failed with result 'exit-code'.
[ 12.870802@0] systemd[1]: Started Set console keymap.
[ OK ] Started Set console keymap.
[ 12.887563@0] systemd[1]: Started Remount Root and Kernel File Systems.
[ OK ] Started Remount Root and Kernel File Systems.
[ 12.919145@0] systemd[1]: Started Nameserver information manager.
[ OK ] Started Nameserver information manager.
[ 12.941508@0] systemd[1]: Started Journal Service.
[ OK ] Started Journal Service.
[ OK ] Reached target Network (Pre).
Starting Load/Save Random Seed...
Starting udev Coldplug all Devices...
Starting Flush Journal to Persistent Storage...
Starting Create Static Device Nodes in /dev...
Starting Apply Kernel Variables...
Mounting Configuration File System...
[ OK ] Mounted Configuration File System.
[ OK ] Started Load/Save Random Seed.
[ OK ] Started Create Static Device Nodes in /dev.
[ OK ] Started Apply Kernel Variables.
[ OK ] Started Flush Journal to Persistent Storage.
[ OK ] Reached target Local File Systems (Pre).
Starting udev Kernel Device Manager...
[ OK ] Started udev Coldplug all Devices.
[ OK ] Started udev Kernel Device Manager.
[ OK ] Started Dispatch Password Requests to Console Directory Watch.
[ OK ] Reached target Sound Card.
[ OK ] Found device /dev/ttyS0.
[ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
[ OK ] Found device /dev/disk/by-label/boot.
Mounting /media/boot...
[ OK ] Mounted /media/boot.

Logged in ok from ttyS0 and ran a few commands:
Code: Select all
ls -lha /boot/
total 52M
drwxr-xr-x  2 root root 4.0K Jan 17 22:13 .
drwxr-xr-x 22 root root 4.0K Dec 15 09:19 ..
-rw-r--r--  1 root root 115K Sep  4 22:30 config-3.10.107-190
-rw-r--r--  1 root root 8.9M Dec 27 22:27 initrd.img-3.10.107-190
-rw-r--r--  1 root root 7.4M Feb 20  2017 initrd.img-4.4.0-28-generic
-rw-------  1 root root 1.9M Sep  4 23:08 System.map-3.10.107-190
-rw-------  1 root root 5.3M Sep  4 23:08 uImage-3.10.107-190
-rw-r--r--  1 root root 8.8M Sep  4 23:54 uInitrd-3.10.104-184
-rw-r--r--  1 root root 8.9M Sep  4 23:52 uInitrd-3.10.107-190
-rw-r--r--  1 root root 8.8M Feb 20  2017 uInitrd-3.10.96-154
-rw-r--r--  1 root root 2.1M Jul 14  2016 uInitrd-4.4.0-28-generic

uname -a
Linux odroid 3.10.107-191 #1 SMP PREEMPT Wed Jan 3 01:59:36 UTC 2018 armv7l armv7l armv7l GNU/Linux

But following a restart:
[ OK ] Found device /dev/disk/by-label/boot.
Mounting /media/boot...
[ 15.318491@3] FAT-fs (mmcblk0p1): codepage cp437 not found
[FAILED] Failed to mount /media/boot.
See 'systemctl status media-boot.mount' for details.

Once logged in emergency mode:
Code: Select all
ls -la /boot
total 8
drwxr-xr-x 2 root root 4096 Jul 14  2016 .
drwxr-xr-x 3 root root 4096 Jul 14  2016 ..

systemctl status media-boot.mount
 media-boot.mount - /media/boot
   Loaded: loaded (/etc/fstab; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-01-17 22:34:35 CET; 21min
    Where: /media/boot
     What: /dev/disk/by-label/boot
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 662 ExecMount=/bin/mount /dev/disk/by-label/boot /media/boot -t vfat

Jan 17 22:34:35 odroid systemd[1]: Mounting /media/boot...
Jan 17 22:34:35 odroid mount[662]: mount: wrong fs type, bad option, bad s
Jan 17 22:34:35 odroid mount[662]:        missing codepage or helper progr
Jan 17 22:34:35 odroid mount[662]:        In some cases useful info is fou
Jan 17 22:34:35 odroid mount[662]:        dmesg | tail or so.
Jan 17 22:34:35 odroid systemd[1]: media-boot.mount: Mount process exited,
Jan 17 22:34:35 odroid systemd[1]: Failed to mount /media/boot.
Jan 17 22:34:35 odroid systemd[1]: media-boot.mount: Unit entered failed s
lines 1-17/17 (END)

It appears that a script launched and removed the new kernel as soon as the system booted ok...
/var/log/apt/history.log

Start-Date: 2018-01-17 22:13:21
Commandline: /usr/bin/unattended-upgrade
Remove: linux-image-3.10.107-191:armhf (20180103)
End-Date: 2018-01-17 22:13:26

/var/log/apt/term.log

Log started: 2018-01-17 22:13:21
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 184647 files and directories currently installed.)
Removing linux-image-3.10.107-191 (20180103) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.10.107-191 /boot/vmlinuz-3.10.107-191
update-initramfs: Deleting /boot/initrd.img-3.10.107-191
Log ended: 2018-01-17 22:13:26

Maybe a post kernel install script was meant to run code from the old image present in /media/boot/ to complete removal of the old kernel. Because files had already been swapped in the 'boot' partition, code from the new kernel image was run instead :?:
Anyhow, I had testdisk analyse the SD card and rewrite the MBR (should probably have done that much earlier):
Command line: TestDisk

TestDisk 6.14-WIP, Data Recovery Utility, September 2012
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
OS: Linux, kernel 3.9.6 (#25 SMP PREEMPT Sat Jun 15 15:27:01 CEST 2013) i686
Compiler: GCC 4.7
Compilation date: 2012-12-16T16:55:56
ext2fs lib: 1.41.12, ntfs lib: libntfs-3g, reiserfs lib: 0.3.0.4, ewf lib: 20100226
User is not root!
Hard disk list

Disk /dev/sdb - 7948 MB / 7580 MiB - CHS 1021 245 62, sector size=512 - Generic- SD/MMC/MS PRO, FW:1.00


Partition table type (auto): Intel
Disk /dev/sdb - 7948 MB / 7580 MiB - Generic- SD/MMC/MS PRO
Partition table type: Intel

Analyse Disk /dev/sdb - 7948 MB / 7580 MiB - CHS 1021 245 62
Geometry from i386 MBR: head=114 sector=33
BAD_RS LBA=2048 2016
FAT16 at 0/33/3
Info: size boot_sector 262144, partition 262144
FAT1 : 1-256
FAT2 : 257-512
start_rootdir : 513
Data : 545-262140
sectors : 262144
cluster_size : 4
no_of_cluster : 65399 (2 - 65400)
fat_length 256 calculated 256
heads/cylinder 255 (FAT) != 245 (HD)
sect/track 63 (FAT) != 62 (HD)
BAD_RS LBA=264192 486080
Current partition structure:
Warning: number of heads/cylinder mismatches 255 (FAT) != 245 (HD)
Warning: number of sectors per track mismatches 63 (FAT) != 62 (HD)
1 P FAT32 LBA 0 33 3 17 96 10 262144 [boot]

Bad relative sector.
2 P Linux 17 96 11 1021 206 31 15257601 [rootfs]

Bad relative sector.
No partition is bootable

search_part()
Disk /dev/sdb - 7948 MB / 7580 MiB - CHS 1021 245 62
FAT16 at 0/33/3
FAT1 : 1-256
FAT2 : 257-512
start_rootdir : 513
Data : 545-262140
sectors : 262144
cluster_size : 4
no_of_cluster : 65399 (2 - 65400)
fat_length 256 calculated 256
heads/cylinder 255 (FAT) != 245 (HD)
sect/track 63 (FAT) != 62 (HD)

FAT16 at 0/33/3
FAT16 >32M 0 33 3 17 96 10 262144 [boot]
FAT16, blocksize=2048, 134 MB / 128 MiB

recover_EXT2: s_block_group_nr=0/58, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 1907200
recover_EXT2: part_size 15257600
Linux 17 96 11 1021 206 30 15257600 [rootfs]
ext4 blocksize=4096 Large file Sparse superblock, 7811 MB / 7450 MiB
Warning: the current number of heads per cylinder is 245 but the correct value may be 255.

Results
* FAT16 >32M 0 33 3 17 96 10 262144 [boot]
FAT16, blocksize=2048, 134 MB / 128 MiB
P Linux 17 96 11 1021 206 30 15257600 [rootfs]
ext4 blocksize=4096 Large file Sparse superblock, 7811 MB / 7450 MiB

interface_write()
1 * FAT16 >32M 0 33 3 17 96 10 262144 [boot]
2 P Linux 17 96 11 1021 206 30 15257600 [rootfs]
write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
You will have to reboot for the change to take effect.

TestDisk exited normally.

Went back to reading this great article by umiddelb:
https://github.com/umiddelb/armhf/wiki/Get-more-out-of-%22Das-U-Boot%22
And came across this thread:
https://bbs.archlinux.org/viewtopic.php?pid=1341549

'codepage cp437' pointing to a kernel mismatch on embedded devices...
SD card back on the C1, I tried the following from serial console in emergency mode:
Code: Select all
uname -a
Linux odroid 3.10.107-191 #1 SMP PREEMPT Wed Jan 3 01:59:36 UTC 2018 armv7l armv7l armv7l GNU/Linux

apt list    --upgradable
Listing... 0%
Listing... 0%
Listing... 1%
Listing... Done
firefox/xenial-updates,xenial-security 57.0.4+build1-0ubuntu0.16.04.1 armhf [upgradable from: 52.0.2+build1-0ubuntu0.16.04.1]
linux-image-c1/unknown 191-1 armhf [upgradable from: 190-1]

ls -la /var/cache/apt/archives/
apport_2.20.1-0ubuntu2.15_all.deb
apport-gtk_2.20.1-0ubuntu2.15_all.deb
apt-fast/
firefox-locale-en_57.0.3+build1-0ubuntu0.16.04.1_armhf.deb
firefox-locale-en_57.0.4+build1-0ubuntu0.16.04.1_armhf.deb
gir1.2-javascriptcoregtk-4.0_2.18.5-0ubuntu0.16.04.1_armhf.deb
gir1.2-webkit2-4.0_2.18.5-0ubuntu0.16.04.1_armhf.deb
libdrm2_2.4.83-1~16.04.1_armhf.deb
libdrm-amdgpu1_2.4.83-1~16.04.1_armhf.deb
libdrm-common_2.4.83-1~16.04.1_all.deb
libdrm-etnaviv1_2.4.83-1~16.04.1_armhf.deb
libdrm-freedreno1_2.4.83-1~16.04.1_armhf.deb
libdrm-nouveau2_2.4.83-1~16.04.1_armhf.deb
libdrm-radeon1_2.4.83-1~16.04.1_armhf.deb
libegl1-mesa_17.2.4-0ubuntu1~16.04.2_armhf.deb
libgbm1_17.2.4-0ubuntu1~16.04.2_armhf.deb
libgl1-mesa-dri_17.2.4-0ubuntu1~16.04.2_armhf.deb
libgl1-mesa-glx_17.2.4-0ubuntu1~16.04.2_armhf.deb
libglapi-mesa_17.2.4-0ubuntu1~16.04.2_armhf.deb
libgles2-mesa_17.2.4-0ubuntu1~16.04.2_armhf.deb
libjavascriptcoregtk-4.0-18_2.18.5-0ubuntu0.16.04.1_armhf.deb
libllvm5.0_1%3a5.0-3~16.04.1_armhf.deb
libpoppler58_0.41.0-0ubuntu1.6_armhf.deb
libpoppler-glib8_0.41.0-0ubuntu1.6_armhf.deb
libseccomp2_2.3.1-2.1ubuntu2~16.04.1_armhf.deb
libwayland-egl1-mesa_17.2.4-0ubuntu1~16.04.2_armhf.deb
libwebkit2gtk-4.0-37_2.18.5-0ubuntu0.16.04.1_armhf.deb
libwebkit2gtk-4.0-37-gtk2_2.18.5-0ubuntu0.16.04.1_armhf.deb
linux-image-3.10.107-191_20180103_armhf.deb
linux-image-c1_191-1_armhf.deb
linux-libc-dev_4.4.0-109.132_armhf.deb
linux-tools-common_4.4.0-109.132_all.deb
lock
mesa-vdpau-drivers_17.2.4-0ubuntu1~16.04.2_armhf.deb
partial/
poppler-utils_0.41.0-0ubuntu1.6_armhf.deb
python3-apport_2.20.1-0ubuntu2.15_all.deb
python3-problem-report_2.20.1-0ubuntu2.15_all.deb
squashfs-tools_1%3a4.3-3ubuntu2.16.04.1_armhf.deb
ubuntu-mono_14.04+16.04.20171116-0ubuntu1_all.deb
unattended-upgrades_0.90ubuntu0.9_all.deb

Here, u-boot is loading the new kernel from the boot partition, but the root filesystem has modules installed for the old kernel. Then I need to upgrade the root filesystem with the new kernel... Transposing gummiboot/pacman commands to the u-boot/apt-get context I tried:
Code: Select all
apt install /var/cache/apt/archives/linux-image-c1_191-1_armhf.deb

Success! After a reboot, I was able to run:
Code: Select all
sudo apt-get clean

sudo apt-get update

sudo apt-get install --reinstall linux-image-c1

and all went smooth!

Thank you odroid, I'm marking this thread as solved now.
Oupsee
 
Posts: 10
Joined: Sun Jan 14, 2018 4:57 am
languages_spoken: english
ODROIDs: C1

Re: [Solved] ERROR: can't get kernel image!

Unread postby odroid » Sun Jan 28, 2018 11:56 am

Good to hear you found a solution. :D
User avatar
odroid
Site Admin
 
Posts: 28490
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 2 guests