Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one 3 is unable to find sdcard #8

Open
DSchndr opened this issue Apr 21, 2020 · 0 comments
Open

one 3 is unable to find sdcard #8

DSchndr opened this issue Apr 21, 2020 · 0 comments

Comments

@DSchndr
Copy link

DSchndr commented Apr 21, 2020

one 3 needs different get_partitions() in the init file
the function from the original init file works

get_partitions() {
  echo "* Detecting main storage partitions"

  partitions=`sed -r "s/( )+/ /g" /proc/partitions | cut -s -d\  -f 5`
  storagedevs=""

    for part in ${partitions}; do
    #blkdev = ${part} without the pX for partition
    blkdev=${part%p?}
    if test "${part#mmcblk}" != "${part}"; then
      # Found SD/MMC, this could be our boot disk!
      if test "${hw_bootdevice}" = ""; then
        # Bootloader didn't give a CID, so assume this is the boot device
        storagedevs="${part} ${storagedevs}"
      elif test "`cat /sys/block/${blkdev}/device/cid`" = "${hw_bootdevice}"; then
        # this was the boot device...
        storagedevs="${part} ${storagedevs}"
      else
        # just storage device
        storagedevs="${storagedevs} ${part}"
        fi
    elif test "${part#hd}" != "${part}"; then
      # Found Harddisk, so must be boot disk (we ship no devices with HDD & other storage)
      storagedevs="${part} ${storagedevs}"
    elif test "${part#mtd}" != "${part}"; then
      # Found Flash chip, we don't mount that here
      storagedevs="${storagedevs}"
    else
      echo Ignoring unknown storage device ${part}...
        fi
  done

  # Trim spaces from start/end
  #NOTE: the space after # has intentionally been left blank ;)
  storagedevs="${storagedevs# }"
  storagedevs="${storagedevs% }"

  if test "${storagedevs}" = ""; then
    echo "* No storage detected"
    unset storagedevs
  else
    echo "* Storage detected"
    echo $storagedevs
  fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant