3 3
gerotmf

OrangePI PC+ not booting from eMMC after an update

Recommended Posts

12 minutes ago, Jordi said:

Wow, have not tried. I'll try next monday. Thanks !!

 

Yeah there's something wrong with u-boot when it tries to read the edid info. 

 

Read more about it here...

 

Share this post


Link to post
Share on other sites

Dear friends, my system has come back to life. As I explained before, I had an armbian 5.14 Debian Jessy Desktop, and after a september 2018 update, when I rebooted the sistem, it didn't boot again. Before trying anything, I booted from a µSD and made an image of my system ( dd if=/dev/mmblck1  bs=10M  of=/mnt/pendrive/image.img ). Then I tried the solutions proposed here, but didn't work for my system. I tried copying /boot files from 5.14 distribution and from new distributions.. I tried with the files that I found on the installation without being updated and also with the updated versions, but any combination worked for me.

 

I don't have much idea about these issues.. but I have a friend ;) and he's a master.

 

My friend's first plan was related with downgrading the u-boot to an older version, but it didn't work, so I won't spent time on it.

 

The second plan worked! The result is not a clean installation.. but it boots.. and lets me access all my services. My server is working.. I'll install a new server on other machine with a clean installation.

 

The idea was :

1) Boot wit a µSD card with a new installation of 5.14 Armbian Jessy Desktop on my OrangePiPlus2

2) Move the installation to the emmc

nand-sata-install

3) Boot from emmc

4) Mark as 'hold' the packages related with the boot process (to perform an apt-get update && apt-get upgrade without affecting to these packages, because it's upgrade makes my system fail - we tried and we confirm it)

apt-mark hold linux-u-boot-orangepiplus-default
apt-mark hold uboot-tols
apt-mark hold linux-image-sun8i

5) Now yes, we can update the system

apt-get update && apt-get upgrade

6) The system is now updated (not the packages marked as hold) and boots properly

 

7) Boot from the µSD in order to have complete acces to the emmc files

 

8) Mount the image we made at the beginning, with the old system (with all our info, but with the /boot damaged)

losetup -o 1048576 /dev/loop0 /mnt/pendrive/image.img
mnt /dev/loop0 /img/

8) And now, with rsync, we copy all the files from our old system to the new one, which is upgraded  (emmc is mounted on /media)

rsync -avpAHX --numeric-ids /img/bin/*  /media/bin

Important: don't use the -delete modifier.. we need to keep the 3.4.112 files from the new installation (the old installation was upgraded and these files were deleted!)

Repeat this rsync command with all these directories:

   bin  -   etc  -   home  -   lib  -   opt  -   root  -   sbin  -   selinux  -   srv  -   usr   -   var   -   mnt  -   media

(in other words: all but     dev  -   proc  -   run  -   sys  -   tmp)

 

9) Unmount everything (you'll need to execute first

losetup -d /dev/loop0

10) My friend edited the file etc/fstab file on the emmc, and he changed the mmblck1 on the first line for mmblck0     (I'm not sure it's necessary.. but he changed)

 

 

-- Added later BEGIN --

 

11) It's important to repeat the hold operations in order to protect the packages we don't want to be updated (the packages database has been replaced with the rsync copy)

apt-mark hold linux-u-boot-orangepiplus-default
apt-mark hold uboot-tols
apt-mark hold linux-image-sun8i

-- Added later END --

 

 

And ... it worked !

 

I was really worried.. it was a pitty to loose my server..  My current installation is not clean at all.. but it works, and it allows me to run all the services to be able to do a manual migration process to a new installation.

 

I appreciate so much all the support you gave me on this thread.. Thanks !

 

Jordi, from Barcelona

Share this post


Link to post
Share on other sites

Hi,

same problem, it would seem that 5.60 does not work on orangepiplus.

I do not understand why putting an update without testing it first.

Share this post


Link to post
Share on other sites
55 minutes ago, Tonydee said:

I do not understand why putting an update without testing it first.

 

There was a lot of testings but they sadly didn't discover this problem.  You can improve this by joining and help testing + improve protocols + developing the project in general https://www.armbian.com/get-involved or by sponsoring https://www.armbian.com/donate and we will hire professionals (few hundred hours/release) to conduct profound testings. Nothing comes out of thin air.

Share this post


Link to post
Share on other sites

Well i've finally found time to fiddle with emmc storage. Upgrade did corrupt boot script, so what i did is basically just copied everything from my usb flash to /dev/mmcblk1p1 including /boot  .. then fixed /boot/armbianEnv.txt so that root points to correct uuid and also /etc/fstab so that root fs can be mounted rw.. I also removed usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u line from armbianEnv.txt (not sure what that does, but it was not on sd card and i guess emmc isn't usb so .. ). 

 

so basically, boot up with sd card or usb flash (i had running system on flash drive)

 

do 

blkid

..
/dev/mmcblk1p1: UUID="c93833b4-8c9a-46b2-ad43-46d286ba9a10" TYPE="ext4" PARTUUID="e0788fc1-01"
..

 

to get UUID of mmcblk1p1

 

mkdir /tmp/mmc

mount /dev/mmcblk1p1 /tmp/mmc

 

rsync -avx / /tmp/mmc

 

vi /tmp/mmc/boot/armbianEnv.txt

change root UUID to the one of /dev/mmcblk1p1 from blkid command

save changes

 

vi /tmp/mmc/etc/fstab

change first line, use same UUID as above

save changes

 

umount /mnt/tmp

 

poweroff

 

then remove usb flash (for me) i guess sd card for you, and press reset button ..

 

I can confirm that 5.59 works on orangepi pc plus from emmc.

 

 

Share this post


Link to post
Share on other sites

Dear All,

 

Does anybody have the IMAGE like one listed above: Armbian_5.30_Orangepipcplus_Debian_jessie_default_3.4.113 and could share it with me anyhow? 

I have got exactly the same issue like described by  gerotm and had the very same (very old) version installed,   but i do not have the genuine image to burn it to the SD card... I have searched over the Armbian website but it seems that such old archives are not available anymore.

Normally i would not mind installing new version, but all three currently available for Orange Pi Plus result in immediate crash when I set up hostapd AP on wlan0 (integrated wifi). My OrangePi Plus serves as MPD/Shairport player and router/access point and now i cannot use it as I fail to fix the MMC boot (i tried copying the /boot from SD installed Xenial Legacy Kernel 3.4 image and changing the boot device UUID but with no success) and on the other hand I fail to configure any of new versions as wifi immediately crashes (and I mean crashes, the system reboots almost immediately)...

 

So please... help, if anyone has the old image of Jessie for Orange Pi Plus, please share.  It would be much appreciated. Thanks in advance :)

Edited by lukaszbzyk
added crash description

Share this post


Link to post
Share on other sites

Igor, Sir... Thank you very much... You can call me an irritating idiot but I copied & pasted like a dumb and i did Armbian_5.30_Orangepipcplus_Debian_jessie_default_3.4.113 whereas i mean Armbian_5.30_Orangepiplus_Debian_jessie_default_3.4.113... for Orange Pi Plus, not Orange Pi PC Plus...  And i even wrote a word "exactly"... What a shame...

Would it be too much to ask you to take a look on tapes once again? I am very sorry...  Thanks a lot in advance... 

Share this post


Link to post
Share on other sites

Thank You very much! I have managed to re-install it and use successfully. I have not managed to fix the mmc boot error but at least i could mount it and copy all the config files and data, and the hostapd does not crash on this old image. Thanks a lot again!

Share this post


Link to post
Share on other sites

Same issue I got today when upgrade to Armbian 5.60

As recommend I've loaded from SD card (same content as eMMC) copied /boot folder from SD to eMMC, changed rootdev UUID in armbianEnv.txt. It doesn't help.

Do I need to recompile boot.scr or something like this?

Share this post


Link to post
Share on other sites

Hello!

 

error in build-master\config\bootscripts\boot-sunxi.cmd

missing string=setenv devnum "0"

 

Info take from this

http://4pda.ru/forum/index.php?showtopic=668774&view=findpost&p=78434168

 

good file is this (see down)

 

Igor!

Please make good boot-sunxi.cmd and recompile core for orange pi pc plus and pust core to repository jessy!

 

******************

# 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
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=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${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} ${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

***************

Edited by pentagon

Share this post


Link to post
Share on other sites
1 hour ago, pentagon said:

Please make good boot-sunxi.cmd and recompile core for orange pi pc plus and pust core to repository jessy!


Implemented on the build level, but for updating the repository ... we don't update boot scripts via packages updating, at least not out of the box. This part has to be done manually atm by replacing the boot script.


Thanks!

Share this post


Link to post
Share on other sites
46 minutes ago, Igor said:


Implemented on the build level, but for updating the repository ... we don't update boot scripts via packages updating, at least not out of the box. This part has to be done manually atm by replacing the boot script.


Thanks!

 

Can any one here put the pre compiled .scr file for OPi+2E ? Thanks in advance...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
3 3