Am 26.06.2019 um 17:08 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi,
Am 26.06.2019 um 16:55 schrieb aTc atc@k-n-p.org:
On 6/26/19 4:49 PM, H. Nikolaus Schaller wrote:
Am 26.06.2019 um 16:28 schrieb aTc atc@k-n-p.org:
Is there a more official method of detecting if a pyra is a 2 or 4gb model from linux, other than just looking at /proc/meminfo MemTotal ?
Yes, that is the official way. It is robust and independent of specific hardware. Like on x86 systems where you can insert new memory modules and the new memory is magically found. But which problem do you want to solve by this detection from user-space? The only area where it seems to make sense is for system information which reports available and used memory size or for Installers.
I was working on the emmc installer script, and want to automatically select the right bootloader.
Ah, ok. I see. Yes, that is one of the very specific areas where it is required (Installer).
Although I think the plan was to eventually have a single uboot version that handles both ?
Well, it is even only the SPL which differs and does different setup of the EMIF. U-Boot is the same for both.
Hm. There is some additional complexity. You will only see more than 2GB MemTotal if an LPAE kernel is running. If you use the correct SPL for 4GB and run a non-LPAE kernel it will simply ignore the additional RAM.
Ok, this case would indeed be more precisely described by the Pyra model.
But what stops us from copying the SPL from the installation SD card to the boot partition of eMMC? If it can boot from SD it should be the right one...
On a second thought it is even possible to clone the full boot partition from Installer SD to eMMC. This will include device trees and kernel images. Only the kernel modules must be copied to the rootfs partition.
So a scheme for eMMC installation could be: 1. create partitions in eMMC 2. mount e.g. as /media/rootfs and /media/boot 3. copy /boot to /media/boot 4. install (expand) user OS into the /media/rootfs partition 5. copy /lib/modules to /media/rootfs
BTW: I have used my makesd script for installing a system to eMMC - I just had to find out and specify the different device name. So there is nothing special between eMMC and SD card formatting.