View Single Post
Posts: 594 | Thanked: 1,094 times | Joined on Aug 2012 @ Rhine
#102
sorry guys, but why do you change system files? this is never a good idea...

instead, just use 2 services, one for the general mounting and one for dalvik. i'm using these 4 files atm:

lib/systemd/system/mount-custom.service
Code:
[Unit]
Description=Handle custom sdcard
Before=aliendalvik.service
Requires=local-fs.target
After=local-fs.target
RequiresMountsFor=/home

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/mount-sd.custom.sh add
ExecStop=/usr/sbin/mount-sd.custom.sh remove

[Install]
WantedBy=local-fs.target aliendalvik.service
usr/sbin/mount-sd.custom.sh
Code:
#!/bin/bash

ACTION=$1

if [ "$ACTION" = "add" ]; then
  mount /dev/mmcblk1p1 /mnt/sd
  mount --rbind /mnt/sd/.home /home/nemo
else
  umount /home/nemo
  umount /mnt/sd
fi
lib/systemd/system/mount-android.service
Code:
[Unit]
Description=mount android stuff to sdcard
After=alien-service-manager.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/mount-android.custom.sh add %i
ExecStop=/usr/sbin/mount-android.custom.sh remove %i

[Install]
WantedBy=graphical.target aliendalvik.service
usr/sbin/mount-android.custom.sh
Code:
#!/bin/bash

ACTION=$1

if [ "$ACTION" = "add" ]; then
  mount -o bind /mnt/sd/.android/media /data/media
  mount -o bind /mnt/sd/.android/data/com.whatsapp /data/data/com.whatsapp
  mount -o bind /mnt/sd/.home /opt/alien/home/nemo
else
  umount /opt/alien/home/nemo
  umount /data/data/com.whatsapp
  umount /data/media
fi
this works pretty good with 2.0, there's only 1 problem: dalvik mounting is lost when restarting dalvik without restarting the phone, but i'm sure, this can be solved somehow

edit: the line
mount -o bind /mnt/sd/.android/data/com.whatsapp /data/data
is just my personal use case, only interesting for people who want to store their WA credentials on sd card for use on multiple phones

Last edited by Leinad; 2015-10-23 at 22:14.
 

The Following User Says Thank You to Leinad For This Useful Post: