PINE64
Booting Linux/Debian from the eMMC - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98)
+--- Forum: Linux on RockPro64 (https://forum.pine64.org/forumdisplay.php?fid=101)
+--- Thread: Booting Linux/Debian from the eMMC (/showthread.php?tid=13283)



Booting Linux/Debian from the eMMC - linuxha - 03-02-2021

Okay, I've been searching like mad to get my RockPro64 back up and running. I figured out the serial (the jumper to select 3v3 is important). It would work for a little while then not. At least now I have a backup board but I'll put that to good use.  Big Grin

Now I've been searching the site for how to copy over the Debian image (Armbian) to the emmc and then booting from emmc. I ran this:

cat /tmp/Armbian_21.02.1_Rockpro64_buster_current_5.10.12.img.xz | xz -d | dd bs=30M of=/dev/mmcblk2

Fdisk shows:

# fdisk -l /dev/mmcblk2
Disk /dev/mmcblk2: 58.2 GiB, 62537072640 bytes, 122142720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcb08aa40

Device                      Boot   Start       End Sectors  Size  Id  Type
/dev/mmcblk2p1      32768 3571711 3538944       1.7G 83 Linux



I attempted to boot (SW4 removed), SD and eMMC installed. Only boots to SD.

Pointers please
thanks


RE: Booting Linux/Debian from the eMMC - dukla2000 - 03-02-2021

remove the eMMC - IMHO Armbian does not support the eMMC despite what is said on their website.

If this indeed enables you to boot from the SDcard, then you need a 4.4 kernel thet will in fact support the eMMC.


RE: Booting Linux/Debian from the eMMC - dukla2000 - 03-02-2021

(03-02-2021, 08:49 AM)linuxha Wrote: ...
I attempted to boot (SW4 removed), SD and eMMC installed. Only boots to SD.
...

OK - if you are getting Armbian to boot from the SDcard while the eMMC is installed you are doing better than me. What is the output of lsblk and blkid?


RE: Booting Linux/Debian from the eMMC - linuxha - 03-02-2021

(03-02-2021, 11:31 AM)dukla2000 Wrote:
(03-02-2021, 08:49 AM)linuxha Wrote: ...
I attempted to boot (SW4 removed), SD and eMMC installed. Only boots to SD.
...

OK - if you are getting Armbian to boot from the SDcard while the eMMC is installed you are doing better than me. What is the output of lsblk and blkid?

lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    0  1.8T  0 disk
├─sda1        8:1    0  1.8T  0 part
└─sda2        8:2    0    4G  0 part
sdb            8:16  0 931.5G  0 disk
└─sdb1        8:17  0 931.5G  0 part
mtdblock0    31:0    0    16M  0 disk
mmcblk1      179:0    0  14.9G  0 disk
└─mmcblk1p1  179:1    0  14.7G  0 part /
mmcblk2      179:32  0  58.2G  0 disk
└─mmcblk2p1  179:33  0  1.7G  0 part /media
mmcblk2boot0 179:64  0    4M  1 disk
mmcblk2boot1 179:96  0    4M  1 disk
zram0        252:0    0  1.9G  0 disk [SWAP]
zram1        252:1    0    50M  0 disk /var/log

# blkid
/dev/mmcblk1p1: UUID="14d11106-8b44-404d-997a-7da7ef398a89" TYPE="ext4" PARTUUID="cb08aa40-01"
/dev/mmcblk2p1: UUID="14d11106-8b44-404d-997a-7da7ef398a89" TYPE="ext4" PARTUUID="cb08aa40-01"
/dev/sda1: UUID="138c9642-f94f-47d2-99af-20606e1d1d39" TYPE="ext4" PARTUUID="bd3e785e-01"
/dev/sda2: UUID="a0debd38-3ca9-4529-b45a-c5299f2d8ae7" TYPE="swap" PARTUUID="bd3e785e-02"
/dev/sdb1: UUID="1dd2523f-4bfb-4349-a91b-514b496f909a" TYPE="ext4" PARTUUID="ec316db9-bf76-a04b-b46f-d19cd118342f"
/dev/zram0: UUID="5e7d0395-0460-48a7-9e5e-54d7c256866a" TYPE="swap"
/dev/mmcblk1: PTUUID="cb08aa40" PTTYPE="dos"
/dev/mmcblk2: PTUUID="cb08aa40" PTTYPE="dos"
/dev/zram1: LABEL="log2ram" UUID="4f709af9-d3da-4955-afe0-09ffd0c8f596" TYPE="ext4"

Please ignore sda (SATA) and sdb (USB3). I did try without sdb also.

I did notice this (just noticed it):

MMC: mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from SPIFlash... SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment


RE: Booting Linux/Debian from the eMMC - linuxha - 03-02-2021

Fixed it! I'm thinking the issue was with the SPI flash. Since this RockPro64 was one of the first V2.0 boards I guess it has an old image on it.

First, after booting with the SD card to Linux (SW4 jumper was removed), I then dd'd the same image used on the SD card to the emmc device, in my case /dev/mmcblk2. I then downloaded 

https://github.com/ayufan-rock64/linux-u-boot/releases/tag/2017.09-rockchip-ayufan-1065-g95f6152134 (u-boot-flash-spi-rockpro64.img.xz)

to a PC with an SD card reader/writer. When the dd completed, I did a shutdown -h. Removed the SD card, burned the u-boot image (the unzx'd image) to the SD. Put the SD in the RockPro64 and booted it up. This took several minutes. I was then greeted by the intitial boot up of my image (asked to to set a root password and add a new user). I just did an apt update on the RockPro64. I've also removed the SD card as it doesn't show in the df or mount commands. I then rebooted, watched the console (still getting the "bad CRC, using default environment") and I've booted to the rockpro64 login prompt.

I'll now get busy restoring the services I had running previously and do an apt upgrade also, uhm first.  Rolleyes