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
  Testing Some More Games on the Pinebook Pro! ImmyChan 5 3,726 09-24-2024, 01:43 AM
Last Post: pigkang
  Converting the Pinebook Pro into a CrowView Note like device 8jef 0 273 08-18-2024, 05:42 PM
Last Post: 8jef
  Pinebook Pro Initial Impressions kunger 443 669,538 04-16-2024, 07:29 PM
Last Post: KC9UDX
  looking to buy one pinebook pro (mainland China) duanduan 3 3,106 03-21-2024, 07:44 PM
Last Post: wangyukunshan
  Cellular module for Pinebook Pro Lotech 1 959 03-05-2024, 05:40 AM
Last Post: KC9UDX
  Screen on pinebook stays black but can ssh into machine tuxxpine 0 690 02-23-2024, 04:22 PM
Last Post: tuxxpine
  Sale my ANSI PineBook Pro cuthbertdavies 0 671 02-14-2024, 09:12 PM
Last Post: cuthbertdavies
  Compiling with -j6 on the Pinebook Pro (Overheat) KC9UDX 0 595 02-14-2024, 09:01 AM
Last Post: KC9UDX
  Pinebook Pro in EU for Sale - €90 jan_vdk 2 1,329 02-07-2024, 02:12 AM
Last Post: 23Ro
  Pinebook Pro for sale tomekdev 2 1,503 02-01-2024, 11:35 AM
Last Post: tomekdev

Forum Jump:


Users browsing this thread: 8 Guest(s)