Closed super-nathan closed 10 years ago
something along these lines:
get_current_memory_split() {
# Stop if /boot is not a mountpoint
if ! mountpoint -q /boot; then
return 1
fi
MEMVAR=$(cat /proc/meminfo | grep MemTotal | awk '{print $2}')
if [ $MEMVAR < 240000 ]; then
AVAILABLE_SPLITS="128 192 224 240"
MEMSPLIT_DESCRIPTION=""
for SPLIT in $AVAILABLE_SPLITS;do
if [ -e /boot/arm${SPLIT}_start.elf ] && cmp /boot/arm${SPLIT}_start.elf /boot/start.elf >/dev/null 2>&1;then
CURRENT_MEMSPLIT=$SPLIT
MEMSPLIT_DESCRIPTION="Current: ${CURRENT_MEMSPLIT}MiB for ARM, $((256 - $CURRENT_MEMSPLIT))MiB for VideoCore"
break
fi
fi
if [ $MEMVAR > 240000] ; then
AVAILABLE_SPLITS= PUT OPTIONS HERE!!!!
MEMSPLIT_DESCRIPTION=""
for SPLIT in $AVAILABLE_SPLITS;do
if [ -e /boot/arm${SPLIT}_start.elf ] && cmp /boot/arm${SPLIT}_start.elf /boot/start.elf >/dev/null 2>&1;then
CURRENT_MEMSPLIT=$SPLIT
MEMSPLIT_DESCRIPTION="Current: ${CURRENT_MEMSPLIT}MiB for ARM, $((512 - $CURRENT_MEMSPLIT))MiB for VideoCore"
break
fi
fi
done
}
I should let it be know that the above code is a mock up of something, not even close to working code!
Will there be high-split specific packages so that the arm384_start.elf (etc) are only on 512MB based boards?
If so, I think this script should list the /boot dir to work out the available splits, instead of having them baked in.
If not, I'd like to be able to get the memory of the unit somehow, and then list the /boot directory, but only display compatible options.
I think this is now covered, and should be closed.
How can the memory split be modified to accommodate?
Ill mock up some ideas soon....