0
kot7k

Unable to boot after kernel update

Recommended Posts

Hi,

Please, i am seeking for some help.

Today i just did an apt-get dist-upgrade and my banana pi updated the kernel to 4.19.13. There wasnt any error messages but then i wasnt able to boot.

I get messages like "/boot/zImage file not found" so i checked my sdcard (wich cointains the boot folder) and i saw that zImage was symlink to the previous kernel image (wich no longer existed). I corrected it cause in fact there was a vmlinuz-4.19.13-sunxi but there are some more symlinks broken in boot foolder. UInitrd is also broken and i dont have the appropiate file to make a new symlink, script.bin symlink is also broken (it pointed to /boot/bin/bananapi.bin wich dont exists anymore on my system)

 

Can i repair the boot folder in any way? Can somebody with the same board provide me that files? Basically all the boot folder with kernel 4.19.13-sunxi or if anyone can explain me a way to boot again...

Share this post


Link to post
Share on other sites

Can you describe your setup in more details:

 

- did you perhaps transfer your system to SATA drive

- was this upgrade from Bananian

- which was the initial build of the image

- can you provide the content of /boot

 

One way dirty of booting is to download new image and copy missing files over ... 

 

Share this post


Link to post
Share on other sites

-Yes, my system was already in my sata drive.

-I was on previous armbian version, kernel version was  4.14. something ( i will have to look again into it to be more specific).

 

Im on windows right now so the attached image does not show symlinks and that, if you want i can get a better screenshot from a livecd.

 

EDIT: Just downloaded latest armbian stretch armbian image and saw that many of the files i need are there, will try to copy them but i think i still miss the script.bin file  (it pointed to /boot/bin/bananapi.bin)

                                                                                                                                 

Captura de pantalla 2019-01-20 21.29.03.png

Share this post


Link to post
Share on other sites
10 minutes ago, kot7k said:

will try to copy them but i think i still miss the script.bin file


Modern kernel doesn't need script.bin

 

I see you are upgrading from some very old builds. It is strange that you manage to update to 4.14.y but it broke when upping to 4.19.y ... it should not be any difference. It is also possible that your SD card has troubles.

zImage looks at the right place ... you can also copy vmlinuz* to zImage and try booting.

Share this post


Link to post
Share on other sites

Hi,  thank you for trying to help me. Yes i had armbian since many time ago, from Wheezy to now stretch.

I copied all the contents from the boot folder of the clean downloaded image to my boot folder on my sd card but i still dont manage to boot it. Here are some pics. Sorry for the quality, i didnt managed to make them better.

One shows the files on my boot folder on my sd card, and the other the boot sequence when it fails and doesnt boot.

 

At first it says unable to read /boot/boot.env (i didnt get it in the pic)  But i dont have that file.

 

EDIT: used armbianEnv.txt to make a boot.env with uuid of my sata hdd but didn't boot :/

Spoiler

thumbnail_IMG_20190120_225418_1.jpgthumbnail_IMG_20190120_225935.jpg

Share this post


Link to post
Share on other sites
8 hours ago, kot7k said:

At first it says unable to read /boot/boot.env (i didnt get it in the pic)  But i dont have that file.


That's O.K.

Huh, running low on ideas. Power the board on and see what is u-boot version ...  Also provide armbianEnv.txt and boot.cmd content. 

Share this post


Link to post
Share on other sites

armbianEnv.txt by default is:

Spoiler

verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun7i-a20
rootdev=UUID=85fff9ba-cebc-4404-98b3-05ec04f392be
rootfstype=ext4

 

I tried booting like this and modifying rootdev with the uuid of my sata disk.

boot.cmd is:

Spoiler

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

setenv load_addr "0x44000000"
setenv overlay_error "false"
# default values
setenv verbosity "1"
setenv console "both"
setenv disp_mem_reserves "off"
setenv disp_mode "1920x1080p60"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv devnum "0"
setenv rootdev "/dev/mmcblk${devnum}p1"

# Print boot source
itest.b *0x28 == 0x00 && echo "U-boot loaded from SD"
itest.b *0x28 == 0x02 && echo "U-boot loaded from eMMC or secondary SD"
itest.b *0x28 == 0x03 && echo "U-boot loaded from SPI"

# get PARTUUID of first partition on SD/eMMC it was loaded from
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
if test "${devtype}" = "mmc"; then
  part uuid mmc ${devnum}:1 partuuid;
  setenv devnum ${mmc_bootdev}
  setenv rootdev "/dev/mmcblk${mmc_bootdev}p1"
fi

echo "Boot script loaded from ${devtype}"

if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
	load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
	env import -t ${load_addr} ${filesize}
fi

if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty1"; fi
if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200"; fi

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} hdmi.audio=EDID:0 disp.screen0_output_mode=${disp_mode} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ubootsource=${devtype} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"

if test "${disp_mem_reserves}" = "off"; then setenv bootargs "${bootargs} sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16"; fi
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi

load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}zImage

if test -e ${devtype} ${devnum} "${prefix}.next"; then
	echo "Found mainline kernel configuration"
	load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
	fdt addr ${fdt_addr_r}
	fdt resize 65536
	for overlay_file in ${overlays}; do
		if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
			echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
			fdt apply ${load_addr} || setenv overlay_error "true"
		fi
	done
	for overlay_file in ${user_overlays}; do
		if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
			echo "Applying user provided DT overlay ${overlay_file}.dtbo"
			fdt apply ${load_addr} || setenv overlay_error "true"
		fi
	done
	if test "${overlay_error}" = "true"; then
		echo "Error applying DT overlays, restoring original DT"
		load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
	else
		if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/overlay/${overlay_prefix}-fixup.scr; then
			echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
			source ${load_addr}
		fi
		if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
			load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
			echo "Applying user provided fixup script (fixup.scr)"
			source ${load_addr}
		fi
	fi
	bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
else
	echo "Found legacy kernel configuration"
	load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}script.bin
	bootz ${kernel_addr_r} ${ramdisk_addr_r}
fi

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

 

I add a pick with uboot version (says something about bad crcs)

 

 

EDIT: should i be able to boot if a do a clean flash on my sd with diskimage writer? Will that make me lose my system as it is (system is in the sata disk)?

 

EDIT2: ok, i decided to flash my sd card with a clean image and system booted again (from sd). Then i modified boot.cmd and compiled boot.scr and also modified armbianEnv.txt and managed to boot from my HDD with all my files, so problem solved. Thank you for trying to help me again.

Spoiler

photo_2019-01-21_07-53-10.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0