Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
@CaptainKhan

This comment has been minimized.

Copy link

commented Nov 3, 2016

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

@CaptainKhan

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.