Hi again,
and many thanks for officially releasing "my" M3/T3 image...
if only it were so simple...
I can definitely tell you that on my T3 (and I assume, things are the same for the T2), the particular devices for emmc and SD depend on the boot mode:
- boot mode emmc (boot button not pressed during power on): emmc is /dev/mmcblk0, SD is /dev/mmcblk1
- boot mode SD (boot button pressed during power on): SD is /dev/mmcblk0, emmc is /dev/mmcblk1
While all content on emmc and SD is exactly the same from block 2048 onwards, unfortunately, there are a number of binary differences in the blocks before (0-2047) between SD and emmc (e.g. bootparams), although u-boot bootloader and partition table are equal.
I have used the following multi-step, but relatively straightforward approach to install DietPi on my emmc:
Write FriendlyARM's eflasher utility:
http://www.mediafire.com/file/9d220h5ut ... ull.img.7z onto an SD card (of at least 8GB in size), then boot from this SD card (using the boot button), and install Debian onto emmc from the graphical installer. This prepares emmc blocks 0-2048 to properly boot into Linux (as opposed to Android) from emmc, and writes FriendlyARM's Debian images into emmc partitions p1 (boot) and p2 (rootfs).
Now switch to a login prompt using Alt+F2 and login as root (password is "fa"). Note that, as this still is from the command prompt of the eflasher (i.e. running off the SD card), the emmc device is currently still called mmcblk1 (and not mmcblk0 like as it would once we've booted from emmc):
Code: Select all
Disk /dev/mmcblk1: 7.3 GiB, 7818182656 bytes, 15269888 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: 0x4dc52160
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 2048 133119 131072 64M 83 Linux
/dev/mmcblk1p2 133120 15269887 15136768 7.2G 83 Linux
Then, using fdisk, delete the maxed out rootfs partition /dev/mmcblk1p2: enter "d" and "2", and recreate it to be the exact size of the DietPi raw rootfs partition as contained in the DietPi image (which happens to be exactly 1024000 blocks of 512 bytes each, i.e. 500MB): enter "n"(ew) "p"(rimary) "2" "133120" "+1023999". This results in:
Code: Select all
Disk /dev/mmcblk1: 7.3 GiB, 7818182656 bytes, 15269888 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: 0x4dc52160
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 2048 133119 131072 64M 83 Linux
/dev/mmcblk1p2 133120 1157119 1024000 500M 83 Linux
Write this modified partition map to emmc by entering "w", and then quit fdisk with "q". Finally copy blocks 2048 and following of the DietPi image to block 2048 and following of the emmc using dd:
Code: Select all
dd if=DietPi_v134_NanoPiM3T3-armv7-(Jessie).img of=/dev/mmcblk1 ibs=512 skip=2048 obs=512 seek=2048
Now shutdown the eflasher command propmpt, switch off the device and switch it back on again, this time without pressing the boot button. You will now be booting into DietPi from emmc, and it will resize the emmc rootfs partition on first run from 1024000 blocks (500MB) to the full 15136768 blocks (7.2GB).
That's how I did it, unfortunately, the process is quite complex. It might be possible to tweak the code available from here:
https://github.com/friendlyarm/sd-fuse_s5p6818 to do all of this in only one step, but - at least for me - it wasn't worth the effort, as the above method worked for me...
Hope this helps & best regards
awl