@jglanz i tried your way
first i see your working on mmcblk0 (it’s sd-card in my stretch-image, is it diffent in official-images?)
second after i flash the singleimage i see the special-partitions in gdisk:
root@bpi-r64:~# gdisk /dev/mmcblk1
GPT fdisk (gdisk) version 1.0.1
The protective MBR's 0xEE partition is oversized! Auto-repairing.
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/mmcblk1: 15269888 sectors, 7.3 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 9C040E2D-2415-47A1-9193-CB5BD2C34E82
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 14609966
Partitions will be aligned on 512-sector boundaries
Total free space is 14565901 sectors (6.9 GiB)
Number Start (sector) End (sector) Size Code Name
1 1024 1535 256.0 KiB 8300 tee1
2 1536 2559 512.0 KiB 8300 lk
3 2560 3583 512.0 KiB 8300 nvram
4 3584 4095 256.0 KiB 8300 rf
5 4096 45055 20.0 MiB 8300 boot
but i can’t add new partition with parted (btw. the commands are for R2)
root@bpi-r64:~# parted -s /dev/mmcblk1 unit MiB mkpart primary fat32 -- 100MiB 356MiB
Error: Both the primary and backup GPT tables are corrupt. Try making a fresh table, and using Parted's rescue feature to recover partitions.
googled a bit around…as p(rint) looks ok, i tried v(eryfy), it shows this:
Command (? for help): v
Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.
Problem: GPT claims the disk is larger than it is! (Claimed last usable
sector is 14609966, but backup header is at
1 and disk size is 15269888 sectors.
The 'e' option on the experts' menu will probably fix this problem
Identified 2 problems!
then used w(rite) to write the partitiontable again and fix problems
Command (? for help): w
Warning! Secondary header is placed too early on the disk! Do you want to
correct this problem? (Y/N): y
Have moved second header and partition table to correct location.
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/mmcblk1.
[ 1348.931288] mmcblk1: p1 p2 p3 p4 p5
The operation has completed successfully.
now i was able to create the partitions on emmc
root@bpi-r64:~# parted -s /dev/mmcblk1 unit MiB mkpart primary fat32 -- 100MiB 356MiB
root@bpi-r64:~# parted -s /dev/mmcblk1 unit MiB mkpart primary ext2 -- 356MiB 7295MiB
root@bpi-r64:~#
till this point i see emmc-uboot, which i now try to reflash with my emmc/rtl8367-variant…works so far can i clean the openwrt-part anyhow? or can i export the partitiontable and ATF?
i expect that i can dd the first ~1.1MB (uboot is located at 768k and ~300kb in size) or 768k without uboot…atf is before this point (512kb), also the first 4 partitions (tee1,lk,nvram,rf). the 20MB boot-partiton overlaps uboot…maybe thats the cause i can’t mount it
have uploaded both to my gdrive…
https://drive.google.com/open?id=1SRUhYQqs5Jg_lKqgMfUlwSX4dG5T6qPZ
basicly r64_emmc_bootsect*.bin needs to be written to emmc (/dev/mmcblkX) and after reread partitiontable you need to create fs on BPI-BOOT (vfat) and BPI-ROOT
root@bpi-r64:~# partprobe /dev/mmcblk1
root@bpi-r64:~# apt install dosfstools
root@bpi-r64:~# mkfs.vfat /dev/mmcblk1p6 -I -n BPI-BOOT
root@bpi-r64:~# mkfs.ext4 -O ^has_journal -E stride=2,stripe-width=1024 -b 4096 /dev/mmcblk1p7 -L BPI-ROOT
i try to get kernel booted on my machine before create a basic image (without the openwrt-stuff which imho still lays somewhere on my emmc)…
can you tell me whats on the 20MB boot-partition? is this the openwrt-data? which filesystem is it? gdisk says it’s 8300=linux filesystem, but i cannot mount it without mount options