Skip to content

Instantly share code, notes, and snippets.

@javiermon
Last active November 15, 2016 00:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save javiermon/3551dc42f03625ccb9a2 to your computer and use it in GitHub Desktop.
Save javiermon/3551dc42f03625ccb9a2 to your computer and use it in GitHub Desktop.
sdcard4jolla
[nemo@Jolla ~]$ devel-su
Password:
[root@Jolla nemo]# cd /etc/systemd/system
[root@Jolla system]# nano mount-sd4android.service
[root@Jolla system]#
[root@Jolla system]# nano /usr/local/sbin/mount-sd4android.sh
[root@Jolla system]# chmod ug+x /usr/local/sbin/mount-sd4android.sh
[root@Jolla system]# systemctl enable mount-sd4android.service
ln -s '/etc/systemd/system/mount-sd4android.service' '/etc/systemd/system/graphical.target.wants/mount-sd4android.service'
ln -s '/etc/systemd/system/mount-sd4android.service' '/etc/systemd/system/display.service.wants/mount-sd4android.service'
[root@Jolla system]#
[root@Jolla system]#
[Unit]
Description=Mount sd for android
After=mount-sd@mmcblk1p1.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/sbin/mount-sd4android.sh start
ExecStop=/usr/local/sbin/mount-sd4android.sh stop
[Install]
WantedBy=graphical.target display.service
#!/bin/bash
sd_uuid="$(blkid -o value -s UUID /dev/mmcblk1p1)"
if [ "$1" == "start" ]
then
systemctl stop aliendalvik
mkdir -p /data/media/"${sd_uuid}"
chown media_rw.media_rw /data/media/"${sd_uuid}"
mount -o bind /media/sdcard/"${sd_uuid}" /data/media/"${sd_uuid}"
systemctl start aliendalvik
elif [ "$1" == "stop" ]
then
systemctl stop aliendalvik
umount /data/media/"${sd_uuid}"
#rm -rf /data/media/"${sd_uuid}"
fi
Copy link

ghost commented Nov 3, 2016

Doesnt work for me, i says that bash nano command cannot be found.

Copy link

ghost commented Nov 5, 2016

Followed steps above after installing Nano, i replaced the UUID with my SDCard mount ID, are there any other changes required to file contents above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment