How to boot Manjaro from NVME with uboot on eMMC
#1
Edited on 27.03.2020 - due to Manjaro not using boot.scr anymore.

I have taken below steps to achieve booting from NVME. It can be probably mirrored on Debian with some small changes since Manjaro is using boot.scr and Debian extlinux.conf.


First download a package: uboot-pinebookpro-2017.09-2-aarch64.pkg.tar.xz. It has uboot files with @pcm720 patches included. Current Manjaro uboot package does not have nvme support enabled. This is subject to change.

1. Extract the files from the package: idbloader.img, trust.img, uboot.img.
2. Write uboot files (pay attention to your device - it has to be eMMC !!! In my case /dev/mmcblk2):

"dd if=idbloader.img of=/dev/mmcblk2 bs=32k seek=1 conv=fsync"
"dd if=uboot.img of=/dev/mmcblk2 bs=64k seek=128 conv=fsync"
"dd if=trust.img of=/dev/mmcblk2 bs=64k seek=192 conv=fsync"

3. Create partition on your NVME drive to rsync filesystem from eMMC.
4. Mount the partition - lets say in /mnt
5. "cd /mnt"
6. "mkdir dev proc sys mnt"
7. "rsync -aHxv --numeric-ids --progress /* /mnt --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt"
8. chroot to your newly synced partition "chroot /mnt".
9. "cd /boot/extlinux"
9. Edit extlinux.conf and change "root=LABEL=ROOT" to "root=/dev/nvme0n1p1" (if your new partition is first on disk).
10. Exit chroot "exit".
11. On eMMC !!! Rename extlinux directory to something else eg. extlinux.old.
12. Reboot machine - you should boot from NVME.
13. After sucessful reboot check "lsblk" it should be something like:

[root@pbp ~]# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk2      179:0    0  58.2G  0 disk
└─mmcblk2p1  179:1    0  58.2G  0 part
mmcblk2boot0 179:32   0     4M  1 disk
mmcblk2boot1 179:64   0     4M  1 disk
nvme0n1      259:0    0 894.3G  0 disk
└─nvme0n1p1  259:1    0    20G  0 part /


In case you want to start the system from eMMC just rename extlinux.old to extlinux on eMMC. Opposite to what has been done in step 11.

Enjoy ! Cool
  Reply
#2
Are you seeing any performance increases?
  Reply
#3
Not in everyday use. But if I have to move some bigger amount of data between partitions definitely yes.
  Reply
#4
(01-16-2020, 12:10 PM)as400 Wrote: I have taken below steps to achieve booting from NVME. It can be probably mirrored on Debian with some small changes since Manjaro is using boot.scr and Debian extlinux.conf.


First download a package: uboot-pinebookpro-2017.09-2-aarch64.pkg.tar.xz. It has uboot files with @pcm720 patches included. Current Manjaro uboot package does not have nvme support enabled. This is subject to change.

1. Extract the files from the package: idbloader.img, trust.img, uboot.img.
2. Write uboot files (pay attention to your device - it has to be eMMC !!! In my case /dev/mmcblk2):

"dd if=idbloader.img of=/dev/mmcblk2 bs=32k seek=1 conv=fsync"
"dd if=uboot.img of=/dev/mmcblk2 bs=64k seek=128 conv=fsync"
"dd if=trust.img of=/dev/mmcblk2 bs=64k seek=192 conv=fsync"

3. Create partition on your NVME drive to rsync filesystem from eMMC.
4. Mount the partition - lets say in /mnt
5. "cd /mnt"
6. "mkdir dev proc sys mnt"
7. "rsync -aHxv --numeric-ids --progress /* /mnt --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt"
8. chroot to your newly synced partition "chroot /mnt".
9. "cd /boot"
9. Edit boot.txt and change "root=PARTUUID=${uuid}" to "root=/dev/nvme0n1p1" (if your new partition is first on disk).
10. Run "./mkscr" (you might have to chmod +x if it's not executable).
11. Exit chroot "exit".
12. On eMMC !!! Rename boot directory to something else eg. boot.old.
13. Reboot machine - you should boot from NVME.
14. After sucessful reboot check "lsblk" it should be something like:

[root@pbp ~]# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk2      179:0    0  58.2G  0 disk
└─mmcblk2p1  179:1    0  58.2G  0 part
mmcblk2boot0 179:32   0     4M  1 disk
mmcblk2boot1 179:64   0     4M  1 disk
nvme0n1      259:0    0 894.3G  0 disk
└─nvme0n1p1  259:1    0    20G  0 part /


In case you want to start the system from eMMC just rename boot.old to boot on eMMC. Opposite to what has been done in step 12.

Enjoy ! Cool

I have got this working.  Thanks for the tutorial!  Does boot from SD work with this?  I'm having some issues booting from SD.  The PBP boots, then I get a black sreen when the SD card is inserted.  I'm trying to use the Chromium image from the PBP wiki.

Thanks again!
-Josh
  Reply
#5
(01-16-2020, 12:10 PM)as400 Wrote: First download a package: uboot-pinebookpro-2017.09-2-aarch64.pkg.tar.xz. It has uboot files with @pcm720 patches included. Current Manjaro uboot package does not have nvme support enabled. This is subject to change.

I'm curious, is this your own modified u-boot, or is the package included by any of the current OS options? Also, what's its boot priority?
  Reply
#6
@mamboman777 I have no problems booting from sd card whatsoever with this uboot.

@tophneal this package was offered once by Manjaro team. Patches are by @pcm720. So all credits go to them. Sd card has priority on boot.
  Reply
#7
(01-29-2020, 10:32 AM)as400 Wrote: @mamboman777 I have no problems booting from sd card whatsoever with this uboot.

@tophneal this package was offered once by Manjaro team. Patches are by @pcm720. So all credits go to them. Sd card has priority on boot.

Oh, is this the one they used right before switching to the latest u-boot that has USB boot?

Was the boot priority ever changed from SD>NVMe>eMMC?
  Reply
#8
(01-29-2020, 10:49 AM)tophneal Wrote: Oh, is this the one they used right before switching to the latest u-boot that has USB boot?

Was the boot priority ever changed from SD>NVMe>eMMC?

Yes. The one from the first post is last before they switched to mainline uboot.

Actually, right now I am using the one from @pcm720 and booting off SPI flash.
  Reply
#9
(01-29-2020, 11:27 AM)as400 Wrote:
(01-29-2020, 10:49 AM)tophneal Wrote: Oh, is this the one they used right before switching to the latest u-boot that has USB boot?

Was the boot priority ever changed from SD>NVMe>eMMC?

Yes. The one from the first post is last before they switched to mainline uboot.

Actually, right now I am using the one from @pcm720 and booting off SPI flash.

I had to write it back to my CrOS install last night, and noticed for SPI its a simple one line command now. Freaking awesome sauce!I think I might mess around and flash it on mine, since I'm about to get an ANSI. That u-boot would be a nice little surprise to someone if I sell the ISO.
  Reply
#10
(01-29-2020, 11:32 AM)tophneal Wrote: I had to write it back to my CrOS install last night, and noticed for SPI its a simple one line command now. Freaking awesome sauce!I think I might mess around and flash it on mine, since I'm about to get an ANSI. That u-boot would be a nice little surprise to someone if I sell the ISO.

I suggest using rkdeveloptool to write it to SPI. I tried dd method on Manjaro (which is recommended) but it didn't work.
Check out this thread ----> https://forum.pine64.org/showthread.php?tid=8927. Note my little correction at the end. It's kind of important Smile

Edit: and it's not needed to press power button fro 10 seconds. It's enough to remove sd card, turn off eMMC and just press power button to get into maskrom mode.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting a copy of SPI NOR flash contents using micro SD card and u-boot hmuller 0 56 09-21-2020, 11:24 AM
Last Post: hmuller
  Program SPI NOR Flash on Pinebook Pro with u-boot on micro SD Card hmuller 0 82 09-21-2020, 10:02 AM
Last Post: hmuller
  Manjaro ARM, Cryptomator, and MEGA Sync dp1kinobe 2 207 09-06-2020, 09:05 AM
Last Post: dp1kinobe
  Freepascal FPC3.20 and Lazarus IDE on Manjaro KDE dieselnutjob 0 197 08-02-2020, 06:57 AM
Last Post: dieselnutjob
  Installing Ubuntu 20.04 (Focal) with BSP uBoot with deep sleep and sound Syonyk 43 4,953 07-28-2020, 03:18 PM
Last Post: SamWilts
  Installing WPS Office on Manjaro brent.thierens 5 1,163 07-13-2020, 03:13 AM
Last Post: brent.thierens
  kernel build script for latest mainline manjaro kernel xmixahlx 42 6,516 07-11-2020, 09:01 PM
Last Post: xmixahlx
  full disk encryption with luks on manjaro xfce limxr 48 7,234 07-09-2020, 07:27 AM
Last Post: JtR
  Is there a MMC upgrade instruction from debian-mate to manjaro factory (20.06)? pljanson 4 660 06-23-2020, 12:41 AM
Last Post: pljanson
Exclamation Flash dhivael's SPI uboot (risky) clover 51 6,784 06-20-2020, 03:24 PM
Last Post: craftkiller

Forum Jump:


Users browsing this thread: 2 Guest(s)