asb / raspi-config

Configuration tool for the Raspberry Pi. Now maintained at https://github.com/RPi-Distro/raspi-config
Other
264 stars 332 forks source link

RasPi's now shipping with 512mb RAM #7

Closed super-nathan closed 10 years ago

super-nathan commented 11 years ago

How can the memory split be modified to accommodate?

Ill mock up some ideas soon....

super-nathan commented 11 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
}
super-nathan commented 11 years ago

I should let it be know that the above code is a mock up of something, not even close to working code!

Jamstah commented 11 years ago

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.

Jamstah commented 11 years ago

I think this is now covered, and should be closed.