external_sd init.d script: if ro.build.characteristics contains nosdcard abort without further action

merge-requests/23/head
Christopher Roy Bratusek 5 years ago
parent bd1623dfb1
commit cdb05d5bdc

@ -30,6 +30,9 @@
* verbose logging of the script itself
* simplify code
* external_sd init.d Script
* if `ro.build.characteristics` contains `nosdcard` abort without further action
## 20.8.20190504 "[Prometheus](https://memory-alpha.fandom.com/wiki/USS_Prometheus_(Prometheus_class))"
### Notes

@ -5,10 +5,15 @@ echo "external_sd init script"
# wait until boot completed
until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
media_rw=$(grep "^/dev/block.*/mnt/media_rw" /proc/mounts \
| cut -d " " -f 2 \
| cut -d "/" -f 4)
storage="/storage/${media_rw}"
if getprop ro.build.characteristics | grep -q nosdcard; then
echo ">> no SD Card found"
exit 0
else
media_rw=$(grep "^/dev/block.*/mnt/media_rw" /proc/mounts \
| cut -d " " -f 2 \
| cut -d "/" -f 4)
storage="/storage/${media_rw}"
fi
if [[ -d ${storage} ]]; then
echo ">> SD Card found"

Loading…
Cancel
Save