what is the magic dd incantation to copy the system from the sd card to the emmc?
#11
OK, my memory was wrong
"mainline" uboot has idbloader and uboot.itb, this uboot is uboot + trust
"BSP" uboot has idbloader, uboot.img and trust.img,,,
idb @64 sectors, uboot @8M, trust @12M (16384 sectors = 8M)
Nearly all mainline can NOT do S3mem, sleep to mem
s3mem is good for ~14 days, FWIW
towboot can, but not as good as BSP (?? ~2/3 life ??)
  Reply
#12
I did your test, wdt. I switched off my eMMC and the Armbian SD card will not boot from the PBP micro SD slot so, given that the boot order of the hard-coded SoC  ROM  is eMMC before micro SD, there is either no U-boot  code on the Armbian SD card or its code transfers control to the eMMC U-boot code.
Next I used dd to write PCM720's two U-boot files to the Armbian SD card and then it booted (with eMMC still disabled)! I've been using the PCM720 U-boot on eMMC for over a year now and it's been working well for me so I didn't want to mess with something newer and figured I'd try it on the Armbian SD card.
So Armbian boots from micro SD using PCM720 U-boot without eMMC memory enabled. What is different about Armbian that keeps it from booting when files or the image are copied to eMMC?

(08-08-2022, 07:00 PM)wdt Wrote: armbian uses boot.txt, run thru a simple compiler to make boot.scr
This is one of the things uboot looks for
While the kernel has to be configured to use nvme, 1st uboot has to find it (and be able to read it)
The text file is armbianEnv.txt, right? Yes--boot.cmd has a comment that says:

Code:
# Please edit /boot/armbianEnv.txt to set supported parameters
and also boot.scr:

Code:
# Please edit /boot/armbianEnv.txt to set supported parameters
But why is a compile even necessary when just moving the system to a new device that is obviously supported by the system when booted from SD? After I boot from SD, I can access both my eMMC and NVMe so it's obviously supported by the Armbian kernel. Is it a problem with initrd that requires it to be recompiled?
I don't understand this Armbian compiler requirement or the need for it. With other OSes on the PBP, it is sufficient to simply dd an image to a new memory device or copy the files over to a device that's already partitioned and formatted, as long a U-boot is valid.
Thanks!
-Cal
  Reply
#13
OK, I'll try to describe how the boot works
Please note: ALL? (nearly) images contain the 1st 16M, ie a mbr and a uboot package (2 or 3 files, in right place)
The boot rom searches SPI, emmc, SD for signature of idbloader
It is assumed that if there is an idbloader that there will be a uboot @8M on same media
Then uboot takes control, alters search order (& adds to it, ex, usb)
uboot is looking, in partitions for boot.scr, extlinux/extlinux.conf or aarch64.efi
The first one of those it finds, then it loads it and follows the config within
So... the path to kernel and initrd and dtb must be correct for a succesfull boot
Also note... uboot doesn't know if it is a 1 or 2 partition setup (and knows nothing about mount setup)
so it looks for boot/boot.scr AND boot.scr (it considers where it finds the config file to be /)
Of course, after initrd all this changes, but uboot has done its job by then and exited
I hope this was useful
-----more--
I think the idea of armbianENV.txt is that it is included (referenced) in boot.scr and doesn't need compiling,
but I don't know much about armbian........
----more explaination---
if there is a uboot on emmc, that is the one that will be used,
any uboot on SD will be IGNORED
when you install armbian to emmc, the uboot on emmc will be overwritten by uboot in image
this is the same as uboot on SD
armbians uboot does NOT work, you have proved this, I don't know why
uboot ONLY searches for the config files, all paths to kernel, initrd, dtb are in config file
when uboot loads the config file, then it knows the path to load kernel etc
  Reply
#14
(08-09-2022, 07:20 PM)wdt Wrote: OK, I'll try to describe how the boot works
Please note: ALL? (nearly) images contain the 1st 16M, ie a mbr and a uboot package (2 or 3 files, in right place)
The boot rom searches  SPI, emmc, SD for signature of idbloader
It is assumed that if there is an idbloader that there will be a uboot @8M on same media
Then uboot takes control,  alters search order (& adds to it, ex, usb)
uboot is looking, in partitions for boot.scr, extlinux/extlinux.conf or aarch64.efi
The first one of those it finds, then it loads it and follows the config within
So... the path to kernel and initrd and dtb must be correct for a succesfull boot
Also note... uboot doesn't know if it is a 1 or 2 partition setup (and knows nothing about mount setup)
so it looks for boot/boot.scr AND boot.scr  (it considers where it finds the config file to be /)
Of course, after initrd all this changes, but uboot has done its job by then and exited
I hope this was useful
-----more--
I think the idea of armbianENV.txt is that it is included (referenced) in boot.scr and doesn't need compiling,
but I don't know much about armbian........
----more explaination---
if there is a uboot on emmc, that is the one that will be used,
any uboot on SD will be IGNORED
when you install armbian to emmc, the uboot on emmc will be overwritten by uboot in image
this is the same as uboot on SD
armbians uboot does NOT work, you have proved this, I don't know why
uboot ONLY searches for the config files, all paths to kernel, initrd, dtb are in config file
when uboot loads the config file, then it knows the path to load kernel etc
Thanks for helping to fill the gaps in my PBP boot knowledge, wdt.

I have not attempted to flash the Armbian image to either my eMMC or my NVMe, because my eMMC contains PCM720 U-boot that I used to boot my daily driver Manjaro system on NVMe (NVMe isn't useful for U-boot, because NVMe is not in the PBP's ROM boot order). I have copied Armbian files to the eMMC though, which I've often done to try different version of an operating Manjaro from and to eMMC., NVMe, or SD.

I think the problem with Armbian running from anything but the SD card is a build problem. I found other reports of this failure on the Armbian forum (tried to mount to root filesystem by UUID and failed):
https://forum.armbian.com/search/?q=UUID...st&quick=1
and my post with a link to a failure screenshot here:
https://forum.armbian.com/topic/22360-ro...ent=145200
  Reply
#15
OK, I see you said you have usb -> emmc adapter
make an image of present emmc, maybe on usb key on pbp
dd if=/dev/emmc of=/mnt/sda/emmc.img bs=1M status=progress
(if you don't have a big enough key, pipeline thru gzip,, as so
dd if=dev/emmc bs=1M|gzip >someplace, usb key,,emmc.gz)
Then, with adapter you easily restore any screw-up,
that is I am assuming you have another computer?
Then do a install (of armbian) on emmc,,,DO NOT shut it off
until you ALSO install pcm uboot to emmc (as last step before reboot)
See, with a partition copy install, fstab, boot.scr and probably the initrd need to be adjusted
Because those are all set for the SD
---
BTW,,,pbp reboot is flakey, do a shut off, reboot often hangs
  Reply
#16
(08-10-2022, 01:06 PM)wdt Wrote: OK, I see you said you have usb -> emmc adapter
make an image of present emmc, maybe on usb key on pbp
dd if=/dev/emmc of=/mnt/sda/emmc.img bs=1M status=progress
(if you don't have a big enough key, pipeline thru gzip,, as so
dd if=dev/emmc bs=1M|gzip >someplace, usb key,,emmc.gz)
Then, with adapter you easily restore any screw-up,
that is I am assuming you have another computer?
Then do a install (of armbian) on emmc,,,DO NOT shut it off
until you ALSO install pcm uboot to emmc (as last step before reboot)
See, with a partition copy install, fstab, boot.scr and probably the initrd need to be adjusted
Because those are all set for the SD
---
BTW,,,pbp reboot is flakey, do a shut off, reboot often hangs

I think you have suggested a good plan. Thanks so much for your help.

I have an amd64 architecture laptop running MX-Linux and also a Pinephone with the PP docking station. Either could be used to image my PBP eMMC with my USB eMMC adapter. I think I trust a hard disk drive more than SD cards for backup, though...or my NVMe SSD but I don't have an NVMe USB adapter.

Though generally reliable, even the SanDisk SD cards that Armbian recommends can be a little flaky sometimes, but usually they are much better than other brands.

My Manjaro / is on NVMe. It has plenty of space for the eMMC image and it and the eMMC have proven to be accessible with PCM U-boot on the Armbian SD. Manjaro is my daily driver system that I'm trying to protect, but it mounts /boot from the eMMC. However, it works with /boot on NVMe too (though Manjaro kernel updates have proven to risky with /boot on the NVMe so I now keep /boot on the eMMC--there's really little downside given that U-boot is on the eMMC too). The important thing is to be able to restore PCM720's U-boot on the eMMC but that should be possible with the USB adapter and another machine too. I think a couple of backup and restore strategies are in order, just in case something doesn't work out.

Yeah--full power down has proven to be best for both my PBP and my PP. Even with a full power-down, it will sometimes boot my Manjaro system (boot on eMMC and / on NVMe) when it should boot the micro SD. A second try usually works as expected. This machine has always had boot flakiness when moving things around. Once setup and booting as desired, it's quite stable though. Strange!
  Reply
#17
OK, I see why you don't care about sleep, the nvme sleep problem
The idea of a emmc image backup was ONLY if it doesn't work, easy recovery
So... unless the nvme is small, shrink (gparted) manjaro / with only 100M free,
make a new partition for armbian /....this means that the nvme is easily restored
(just expand shrunk partition)
I would assume armbian install is from a SD boot (also the gparted work)
Unless the install forces a reboot that you cannot stop, installing PCM
is just a command line, cd to right place and the dd commands that you know
Maybe you have (on SD) a ~/pcm directory with the 2 files? or something similar?
I would bet that it would work
BTW, since most of the emmc is empty, you don't have to back it all up,
use appropriate count= (plus a bit extra to be sure)
My boot is ~60M, + the 31M space at beginning of emmc,, so count=120 bs=1M
Yours may be different, gparted will show
  Reply
#18
(08-01-2022, 12:15 AM)geokon Wrote: I had trouble installing it the conventional way to the emmc - where you copy the compressed system image to the emmc.

The 'conventional way' (on Armbian) would be to use the nand-sata-install tool (which, IIRC, may also be available from armbian-config (not sure)).

Different SBCs boot in all different ways, which is part of the problem with them.  This is all very different from x86 you may be used to.

Having said all of the above, some other people were also reporting this issue at Armbian forums (Werner gives a clue in that thread about how it works), so maybe something went wrong.  I do believe it used to work at some point.

Edit: I just realized you are probably the same calinb from the thread I linked. Keep up the good work, and I hope to be able to help you some more very soon (just need to pick up my new PBP from post office in a couple days).
Cheers,
TRS-80

What is Free Software and why is it so important for society?

Protocols, not Platforms

For the most Linux-y experience on your Linux phone, try SXMO!

I am (nominally) the Armbian Maintainer for PineBook Pro (although severely lacking in time these days).
  Reply
#19
(08-15-2022, 07:17 PM)TRS-80 Wrote:
(08-01-2022, 12:15 AM)geokon Wrote: I had trouble installing it the conventional way to the emmc - where you copy the compressed system image to the emmc.

The 'conventional way' (on Armbian) would be to use the nand-sata-install tool (which, IIRC, may also be available from armbian-config (not sure)).

Different SBCs boot in all different ways, which is part of the problem with them.  This is all very different from x86 you may be used to.

Having said all of the above, some other people were also reporting this issue at Armbian forums (Werner gives a clue in that thread about how it works), so maybe something went wrong.  I do believe it used to work at some point.

Edit: I just realized you are probably the same calinb from the thread I linked.  Keep up the good work, and I hope to be able to help you some more very soon (just need to pick up my new PBP from post office in a couple days).

Yes--I posted to the Armbian forum thread. WDT has been very helpful here in filling in the gaps in my knowledge but I don't have time to work on the problem right now. I think it has something to do with initrd generation (initrd doesn't seem to be able to read the eMMC memory and reports (I think) that it can't find the UUID for my eMMC that I put in armbianEnv.txt.

armbianEnv.txt:
Code:
verbosity=1
bootlogo=false
extraargs=systemd.unified_cgroup_hierarchy=0
overlay_prefix=rockchip
fdtfile=rockchip/rk3399-pinebook-pro.dtb
rootdev=UUID=f57dd6bf-3737-40f9-95b0-376895bc2055
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

I have PCM720's Uboot on eMMC (works fine for Manjaro) and Armbian /boot is on SD card.
Hopefully this screen shot link of the Armbian failure works:
Ambian_eMMC_boot failure.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation 'failed to open panfrost' after system update using archarm Puckla 1 212 03-01-2024, 06:46 PM
Last Post: Puckla
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 4 1,917 12-13-2023, 07:22 PM
Last Post: trillobite
  Manjaro 20.04 not loading from SD (with Manjaro on eMMC) zaius 1 292 12-07-2023, 03:11 PM
Last Post: wdt
  Fedora 36 -> 37 upgrade kills system tydeman 0 370 10-28-2023, 09:53 AM
Last Post: tydeman
  [Manjaro] u-boot won't boot from eMMC with (unbootable) SD card present zackw 1 1,853 08-21-2023, 09:08 PM
Last Post: vanessadonald
  2TB SD Card Write Errors jiacovelli 3 962 06-02-2023, 06:13 PM
Last Post: KC9UDX
  Blank screen after Armbian 20.04 install to emmc? psychoacoustic 3 3,344 04-01-2023, 03:22 PM
Last Post: TRS-80
  Fix for Armbian not booting on PBP from eMMC agreenbhm 7 3,655 04-01-2023, 02:58 PM
Last Post: TRS-80
  My installation guide starting from messed up eMMC Besouro 0 813 12-19-2022, 01:01 PM
Last Post: Besouro
  newer ""emmc-installer" images (manjaro xfce) magistral 1 1,037 10-10-2022, 06:22 AM
Last Post: maxjrh

Forum Jump:


Users browsing this thread: 1 Guest(s)