View Single Post
Posts: 1,335 | Thanked: 3,931 times | Joined on Jul 2010 @ Brittany, France
#4
ext4 format will be OK, but it will not be automatically mounted. I had to edit /usr/sbin/mount-sd.sh with valuable help from someone on the IRC channel to automatically mount it. Now it works and I can use SFTP to transfer or remove files from /run/user/100000/media/sdcard, even using Windows.

My mount-sd.sh after the changes is the following, but I cannot guarantee this is safe as I only did what I was told to. Please keep in mind that it might really result in issues with your Jolla, and here the warning is a true warning because I'm not a Linux power user.

Code:
#!/bin/bash

SDCARD=/dev/sdcard
DEF_UID=$(grep "^UID_MIN" /etc/login.defs |  tr -s " " | cut -d " " -f2)
DEF_GID=$(grep "^GID_MIN" /etc/login.defs |  tr -s " " | cut -d " " -f2)
DEVICEUSER=$(getent passwd $DEF_UID | sed 's/:.*//')
MNT=/run/user/$DEF_UID/media/sdcard

if [ "$ACTION" = "add" ]; then
        if [ -b /dev/mmcblk1p1 ]; then
                ln -sf /dev/mmcblk1p1 $SDCARD
        elif [ -b /dev/mmcblk1 ]; then
                ln -sf /dev/mmcblk1 $SDCARD
        else
                exit $?
        fi
        su $DEVICEUSER -c "mkdir -p $MNT"
        mount $SDCARD $MNT -o uid=$DEF_UID,gid=$DEF_GID
        if [ -z $(mount | grep $MNT) ]; then
                # let's try 2nd time w/o options
                mount -o rw $SDCARD $MNT
                if [ $? = 0 ]; then
                        chown $DEF_UID:$DEF_GID $MNT
                fi
        fi
else
        umount $SDCARD

        if [ $? = 0 ]; then
                rm -f $SDCARD
        else
                umount -l $MNT
                rm -f $SDCARD
        fi
fi
 

The Following 5 Users Say Thank You to Kabouik For This Useful Post: