Happy eMMC and SDcard OS usage for Pinebook Pro Newbies...
#11
Well, you can do an experiment
First, and formost, if emmc is diasbled, does a good SD boot?
If so, blank emmc uboot (1st save emmc mbr, restore at end), re-enable emmc, then
run fdisk on good SD, note sector numbers (write down) delete all partitions
(later you will restore partitions with written down sector numbers)
This forces cpu to use uboot from SD, the only OS that it can find is on emmc,
might work, no guarantees
BTW, what ubuntu version? there are more than 1 I think
  Reply
#12
(10-07-2020, 08:53 PM)wdt Wrote: Well, you can do an experiment
First, and formost, if emmc is diasbled, does a good SD boot?
If so, blank emmc uboot (1st save emmc mbr, restore at end), re-enable emmc, then
run fdisk on good SD, note sector numbers (write down) delete all partitions
(later you will restore partitions with written down sector numbers)
This forces cpu to use uboot from SD, the only OS that it can find is on emmc,
might work, no guarantees
BTW, what ubuntu version?  there are more than 1 I think
Sorry its Ubuntu 20.04 from ayufan. 
https://github.com/ayufan-rock64/linux-build/releases

Using etcher to extract image to emmc won't work? Isn't uboot on internal memory? Maybe just need to rename partitions to what manjaro had?
  Reply
#13
Ayufan, I think, usually uses GPT partitoning, better check
No, uboot is not in internal memory, bootrom is quite limited,
it searches, in its boot order (SPI, emmc, SD, usb-not-for-booting) for
the signature of idbloader, on the above media (3B 8C DC FC BE 9F 9D 51)
Signature (for rk3399) is 64 sectors in, this is a "raw" read
Then idbloader sets up memory, has more memory available, loads uboot,
I think it is assumed that it will be on that same media as idbloader, 8M in
To have space for this (idbloader, uboot, trust) is why 1st user partition is at 16m, 32768 sectors
The bootrom will use the 1st idbloader found, ignore all others (in its search path)
So,.... if SPI is blank, if emmc uboot area is blank, then idbloader & uboot on SD will be used
To blank,,, save mbr, dd /dev/zero to 1st-16M, restore mbr,, GPT mbr is 34 sectors
--edit--
uboot nearly always has a different search path, looking for extlinux.conf or boot.scr, for example
@localhost mrfixit-uboot]$ strings uboot.img |grep _target
boot_targets=mmc1 nvme0 usb0 mmc0 pxe dhcp ,,,,, mmc0 is emmc

In previous post, if SD partitions are deleted, can't find anything on disk it is still there, just in unknown place
(idbloader/uboot/trust) is equivalent of bios, they are loaded by "raw" reads
  Reply
#14
I think it might be easier to flash manjaro back on emmc and hopefully fix the emmc boot. Then i can boot from sd card and run ubuntu from there again. I'm still new to Linux, this process sounds complicated. On the wiki it does state that ayufan Ubuntu image boots to emmc or SD. If I were to follow these steps for install on SD card, would it work if I made an image with partitions from SD card and duplicated to emmc?

# Remove invalid X11 config, and fix bootloaders
sudo rm /etc/X11/xorg.conf.d/20-armsoc.conf
sudo rm /etc/apt/sources.list.d/ayufan-rock64-0.8-*.list
sudo new_extlinux_boot.sh rootfs
sudo rock64_upgrade_bootloader.sh

Maybe my issue was that I flashed the image directly to emmc before doing all of these steps from within os.
  Reply
#15
(10-08-2020, 10:10 AM)Mangled Wrote: I think it might be easier to flash manjaro back on emmc and hopefully fix the emmc boot. Then i can boot from sd card and run ubuntu from there again. I'm still new to Linux, this process sounds complicated. On the wiki it does state that ayufan Ubuntu image boots to emmc or SD. If I were to follow these steps for install on SD card, would it work if I made an image with partitions from SD card and duplicated to emmc?

# Remove invalid X11 config, and fix bootloaders
sudo rm /etc/X11/xorg.conf.d/20-armsoc.conf
sudo rm /etc/apt/sources.list.d/ayufan-rock64-0.8-*.list
sudo new_extlinux_boot.sh rootfs
sudo rock64_upgrade_bootloader.sh

Maybe my issue was that I flashed the image directly to emmc before doing all of these steps from within os.
I think I had found the information I was looking for. The spi does require uboot to be flashed to it. Link below:
 https://github.com/ayufan-rock64/linux-b...ash-spi.md
  Reply
#16
The image, whatever it is, is supposed to "just work", whether it is flashed to emmc or SD
No editing should be needed, but some images are not so good
It is often hard to tell just exactly what is wrong, unless you have a serial connection
If there is a SD inserted, if there is a bootable image on it, the emmc uboot
will find it 1st and boot from it (if the search path has MMC1 as first item, this is common)
If it is a non-bootable SD or absent, then nvme0, then usb0 will be searched, then emmc will be examined
uboot is looking for extlinux.conf or boot.scr
>would it work if I made an image with partitions from SD card and duplicated to emmc?
I would guess not
--edit--
>The spi does require uboot to be flashed to it.
Any uboot will do (if it is "good") wherever it is (not usb)
Flashing uboot to SPI, at this time, is NOT recommended unless you are somewhat "expert"
All of this is a bit "beta", somewhat immature
And, if you read closely, this is more for rockpro rather than pinbookpro
  Reply
#17
(10-08-2020, 12:02 PM)wdt Wrote: The image, whatever it is, is supposed to "just work", whether it is flashed to emmc or SD
No editing should be needed, but some images are not so good
It is often hard to tell just exactly what is wrong, unless you have a serial connection
If there is a SD inserted, if there is a bootable image on it, the emmc uboot
will find it 1st and boot from it (if the search path has MMC1 as first item, this is common)
If it is a non-bootable SD  or absent, then nvme0, then usb0 will be searched, then emmc will be examined
uboot is looking for extlinux.conf or boot.scr
>would it work if I made an image with partitions from SD card and duplicated to emmc?
I would guess not
--edit--
>The spi does require uboot to be flashed to it.
Any uboot will do (if it is "good") wherever it is (not usb)
Flashing uboot to SPI, at this time, is NOT recommended unless you are somewhat "expert"
All of this is a bit "beta", somewhat immature
And, if you read closely, this is more for rockpro rather than pinbookpro
I did a little test. I have Ubuntu installed on my SD card and manjaro on emmc. It boots fine into Ubuntu. However removing the emmc with SD still in, the device will turn on but remain on black screen. So I tried to flash the Ubuntu image on emmc and remove SD card. Again, turns on but remains on black screen. I then reinstalled manjaro on emmc and put SD card back in, it boots fine into Ubuntu. Next I will try to duplicate my SD card to emmc to see if it boots. Its possible that running ubuntu via sd and updating os may have fixed the boot. I will try tonight. I find it odd that it boots from SD card but will not from emmc
  Reply
#18
> I find it odd that it boots from SD card but will not from emmc
When emmc is in, its uboot will be 1st found & used
I think that your post shows that the uboot for ubuntu is not good
When it loads manjaro uboot (from emmc) and then that uboot finds SD, boots OK
So, a test would be,, save SD mbr (gpt, so 34 sectors),, dd 1st 16M emmc->SD,, restore SD mbr
Then try to boot with ONLY SD (emmc removed,disabled, check with lsblk, no boot0 or boot1)
(check that SD mbr is gpt,, run gdisk /dev/SD, the page that shows gives status, q (to quit))
Do you need more detailed info?
  Reply
#19
(10-09-2020, 08:15 AM)wdt Wrote: > I find it odd that it boots from SD card but will not from emmc
When emmc is in, its uboot will be 1st found & used
I think that your post shows that the uboot for ubuntu is not good
When it loads manjaro uboot (from emmc) and then that uboot finds SD, boots OK
So, a test would be,, save SD mbr (gpt, so 34 sectors),, dd 1st 16M emmc->SD,, restore SD mbr
Then try to boot with ONLY SD (emmc removed,disabled, check with lsblk, no boot0 or boot1)
(check that SD mbr is gpt,, run gdisk /dev/SD, the page that shows gives status, q (to quit))
Do you need more detailed info?
Yes please. I'm a newb to Linux. Just learning as I go. How do I dd the MBR? 
Dd if=/dev/mmcblk2(?mbr of emmc?) bs=16M of=/dev/mmcblk1(SD card)

I read online somewhere that mbr is generally 512b from first boot sector. Should bs=512 ?
  Reply
#20
OK, lsblk 1st,, boot0 and boot1 are on emmc, I will use terms /dev/SD and /dev/emmc,,
replace SD and emmc with right mmcblkX
Then, sudo gdisk /dev/SD,,, the screen that comes up will have this section

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present

So you can tell the partitioning style of the disk, Ayufan often uses GPT
If it is mbr, you save 1 sector, if gpt save 34 sectors,,, (dd default bs is 512 Bytes, 1 sector)
(GPT has protective mbr, 1 sector, GPT boot code, 1 sector, partition table, 32 sectors,,4/sector,128 partitions)
make a directory to work in, empty
cd ; mkdir uboot-sav ; cd uboot-sav
save SD mbr
dd if=/dev/SD of=SD.ubuntu.mbr count=(either 1 OR 34)
save ubuntu uboot(optional), good practice to always be able to go back
dd if=/dev/SD of=ubuntu.uboot.16M bs=1M count=16
Transfer 1st-16M emmc->SD
dd if=/dev/emmc of=/dev/SD bs=1M count=16
restore mbr
dd if=SD.ubuntu.mbr of=/dev/SD (count not necessary, will stop at end of file)
Also a good practice to give self documenting names, very helpful a month later
This assumes manjaro on emmc,, ayufan ubuntu on SD,, ubuntu boots OK
Doesn't matter where you boot from, but if SD card is in, will boot ubuntu
Then test, remove/disable emmc, can SD boot OK? If so, transfer ubuntu to emmc,,
with rsync (already in forum OR on other computer OR do an install from image,, BUT
BEFORE rebooting transfer manjaro uboot to emmc (saving emmc mbr 1st, and restoring last)
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinebook Pro for sale - Europe (Poland) - SOLD as400 8 377 Today, 03:29 AM
Last Post: as400
  Pinebook Pro won't turn on when unplugged decisivedove 7 1,460 Yesterday, 09:44 AM
Last Post: mattpenn
  Pinebook Pro Initial Impressions kunger 400 195,576 02-25-2021, 11:57 PM
Last Post: Braillynn
  Pinebook pro for sale [UA only] mikkra 0 101 02-24-2021, 01:38 PM
Last Post: mikkra
  Games compilation howto on the Pinebook-pro (Manjaro Linux and Debian native) astr0baby 196 101,990 02-22-2021, 12:07 AM
Last Post: bifo
  Pinebook Pro pre-order iMav 3 208 02-21-2021, 10:15 AM
Last Post: Arwen
  Pinebook Pro for sale - ISO keyboard - UK only c6Q$! 0 117 02-21-2021, 09:19 AM
Last Post: c6Q$!
  How Much Non-Free Software Does The PineBook Pro Use? ImmyChan 6 405 02-18-2021, 07:58 PM
Last Post: TRS-80
  Pinebook Pro for Sale in US BluBombr64 13 1,762 02-18-2021, 05:54 AM
Last Post: BluBombr64
Exclamation Pinebook Pro dead after dd crmcalls 1 158 02-18-2021, 03:17 AM
Last Post: KC9UDX

Forum Jump:


Users browsing this thread: 2 Guest(s)