{"action":"created","comment":{"url":"https://api.github.com/repos/nemomobile/sd-utils/pulls/comments/38189478","id":38189478,"diff_hunk":"@@ -31,36 +31,48 @@ if [ \"$ACTION\" = \"add\" ]; then\n         exit 0\n     fi\n \n-    # This hack is here to delay mounting the sdcard until tracker is ready\n-    export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$DEF_UID/dbus/user_bus_socket\n-    count=1\n-    while true; do \n-        test $count -ge 64 && break\n-        MINER_STATUS=\"$(dbus-send --type=method_call --print-reply --session --dest=org.freedesktop.Tracker1.Miner.Files /org/freedesktop/Tracker1/Miner/Files org.freedesktop.Tracker1.Miner.GetStatus | grep -o 'Idle')\"\n-        STORE_STATUS=\"$(dbus-send --type=method_call --print-reply --session --dest=org.freedesktop.Tracker1 /org/freedesktop/Tracker1/Status org.freedesktop.Tracker1.Status.GetStatus | grep -o 'Idle')\"\n-        test \"$MINER_STATUS\" = \"Idle\" -a \"$STORE_STATUS\" = \"Idle\" && break\n-        systemd-cat -t mount-sd /bin/echo \"Waiting $count seconds for tracker\"\n-        sleep $count ; \n-        count=$(( count + count ))\n-    done\n+    case \"${TYPE}\" in\n+\tf2fs)\n+            FSCK_OPTS=\"-a\"\n+            ;;\n+        *)\n+            FSCK_OPTS=\"-p\"\n+            ;;\n+    esac\n+    fsck $FSCK_OPTS ${DEVNAME}\n \n     test -d $MNT/${UUID} || mkdir -p $MNT/${UUID}\n     chown $DEF_UID:$DEF_GID $MNT $MNT/${UUID}\n-    touch $MNT/${UUID}\n \n     case \"${TYPE}\" in\n \tvfat|exfat)\n-\t    mount ${DEVNAME} $MNT/${UUID} -o uid=$DEF_UID,gid=$DEF_GID,$MOUNT_OPTS,utf8,flush,discard || /bin/rmdir $MNT/${UUID}\n+\t    MOUNT_OPTS+=\",uid=$DEF_UID,gid=$DEF_GID,utf8,flush,discard\"\n \t    ;;\n \t# NTFS support has not been tested but it's being left to please the ego of an engineer!\n \tntfs)\n-\t    mount ${DEVNAME} $MNT/${UUID} -o uid=$DEF_UID,gid=$DEF_GID,$MOUNT_OPTS,utf8 || /bin/rmdir $MNT/${UUID}\n-\t    ;;\n-\t*)\n-\t    mount ${DEVNAME} $MNT/${UUID} -o $MOUNT_OPTS || /bin/rmdir $MNT/${UUID}\n+\t    MOUNT_OPTS+=\",uid=$DEF_UID,gid=$DEF_GID,utf8\"\n \t    ;;\n+\t# ext and btrfs are both able to handly TRIM. Add more to the list if needed.\n+        ext4|btrfs|f2fs)\n+            MOUNT_OPTS+=\",discard\"\n+            ;;","path":"scripts/mount-sd.sh","position":46,"original_position":46,"commit_id":"8dc08031f2cd1b8c19229cc1e4dcac65103f8c95","original_commit_id":"8dc08031f2cd1b8c19229cc1e4dcac65103f8c95","user":{"login":"saukko","id":990755,"avatar_url":"https://avatars.githubusercontent.com/u/990755?v=3","gravatar_id":"","url":"https://api.github.com/users/saukko","html_url":"https://github.com/saukko","followers_url":"https://api.github.com/users/saukko/followers","following_url":"https://api.github.com/users/saukko/following{/other_user}","gists_url":"https://api.github.com/users/saukko/gists{/gist_id}","starred_url":"https://api.github.com/users/saukko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saukko/subscriptions","organizations_url":"https://api.github.com/users/saukko/orgs","repos_url":"https://api.github.com/users/saukko/repos","events_url":"https://api.github.com/users/saukko/events{/privacy}","received_events_url":"https://api.github.com/users/saukko/received_events","type":"User","site_admin":false},"body":"Identation is a bit off here.","created_at":"2015-08-28T10:57:53Z","updated_at":"2015-08-28T10:57:53Z","html_url":"https://github.com/nemomobile/sd-utils/pull/19#discussion_r38189478","pull_request_url":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/nemomobile/sd-utils/pulls/comments/38189478"},"html":{"href":"https://github.com/nemomobile/sd-utils/pull/19#discussion_r38189478"},"pull_request":{"href":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19","id":38322176,"html_url":"https://github.com/nemomobile/sd-utils/pull/19","diff_url":"https://github.com/nemomobile/sd-utils/pull/19.diff","patch_url":"https://github.com/nemomobile/sd-utils/pull/19.patch","issue_url":"https://api.github.com/repos/nemomobile/sd-utils/issues/19","number":19,"state":"open","locked":false,"title":"Tune + fix /usr/sbin/mount-sd.sh","user":{"login":"V10lator","id":1312422,"avatar_url":"https://avatars.githubusercontent.com/u/1312422?v=3","gravatar_id":"","url":"https://api.github.com/users/V10lator","html_url":"https://github.com/V10lator","followers_url":"https://api.github.com/users/V10lator/followers","following_url":"https://api.github.com/users/V10lator/following{/other_user}","gists_url":"https://api.github.com/users/V10lator/gists{/gist_id}","starred_url":"https://api.github.com/users/V10lator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/V10lator/subscriptions","organizations_url":"https://api.github.com/users/V10lator/orgs","repos_url":"https://api.github.com/users/V10lator/repos","events_url":"https://api.github.com/users/V10lator/events{/privacy}","received_events_url":"https://api.github.com/users/V10lator/received_events","type":"User","site_admin":false},"body":"See the commits for details.","created_at":"2015-06-23T10:31:45Z","updated_at":"2015-08-28T10:57:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf71fd713ded5395d25c48619220bb5ae2b19419","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19/commits","review_comments_url":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19/comments","review_comment_url":"https://api.github.com/repos/nemomobile/sd-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nemomobile/sd-utils/issues/19/comments","statuses_url":"https://api.github.com/repos/nemomobile/sd-utils/statuses/8dc08031f2cd1b8c19229cc1e4dcac65103f8c95","head":{"label":"V10lator:master","ref":"master","sha":"8dc08031f2cd1b8c19229cc1e4dcac65103f8c95","user":{"login":"V10lator","id":1312422,"avatar_url":"https://avatars.githubusercontent.com/u/1312422?v=3","gravatar_id":"","url":"https://api.github.com/users/V10lator","html_url":"https://github.com/V10lator","followers_url":"https://api.github.com/users/V10lator/followers","following_url":"https://api.github.com/users/V10lator/following{/other_user}","gists_url":"https://api.github.com/users/V10lator/gists{/gist_id}","starred_url":"https://api.github.com/users/V10lator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/V10lator/subscriptions","organizations_url":"https://api.github.com/users/V10lator/orgs","repos_url":"https://api.github.com/users/V10lator/repos","events_url":"https://api.github.com/users/V10lator/events{/privacy}","received_events_url":"https://api.github.com/users/V10lator/received_events","type":"User","site_admin":false},"repo":{"id":37911895,"name":"sd-utils","full_name":"V10lator/sd-utils","owner":{"login":"V10lator","id":1312422,"avatar_url":"https://avatars.githubusercontent.com/u/1312422?v=3","gravatar_id":"","url":"https://api.github.com/users/V10lator","html_url":"https://github.com/V10lator","followers_url":"https://api.github.com/users/V10lator/followers","following_url":"https://api.github.com/users/V10lator/following{/other_user}","gists_url":"https://api.github.com/users/V10lator/gists{/gist_id}","starred_url":"https://api.github.com/users/V10lator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/V10lator/subscriptions","organizations_url":"https://api.github.com/users/V10lator/orgs","repos_url":"https://api.github.com/users/V10lator/repos","events_url":"https://api.github.com/users/V10lator/events{/privacy}","received_events_url":"https://api.github.com/users/V10lator/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/V10lator/sd-utils","description":"Scripts for properly handling SD card and similar media","fork":true,"url":"https://api.github.com/repos/V10lator/sd-utils","forks_url":"https://api.github.com/repos/V10lator/sd-utils/forks","keys_url":"https://api.github.com/repos/V10lator/sd-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/V10lator/sd-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/V10lator/sd-utils/teams","hooks_url":"https://api.github.com/repos/V10lator/sd-utils/hooks","issue_events_url":"https://api.github.com/repos/V10lator/sd-utils/issues/events{/number}","events_url":"https://api.github.com/repos/V10lator/sd-utils/events","assignees_url":"https://api.github.com/repos/V10lator/sd-utils/assignees{/user}","branches_url":"https://api.github.com/repos/V10lator/sd-utils/branches{/branch}","tags_url":"https://api.github.com/repos/V10lator/sd-utils/tags","blobs_url":"https://api.github.com/repos/V10lator/sd-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/V10lator/sd-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/V10lator/sd-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/V10lator/sd-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/V10lator/sd-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/V10lator/sd-utils/languages","stargazers_url":"https://api.github.com/repos/V10lator/sd-utils/stargazers","contributors_url":"https://api.github.com/repos/V10lator/sd-utils/contributors","subscribers_url":"https://api.github.com/repos/V10lator/sd-utils/subscribers","subscription_url":"https://api.github.com/repos/V10lator/sd-utils/subscription","commits_url":"https://api.github.com/repos/V10lator/sd-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/V10lator/sd-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/V10lator/sd-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/V10lator/sd-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/V10lator/sd-utils/contents/{+path}","compare_url":"https://api.github.com/repos/V10lator/sd-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/V10lator/sd-utils/merges","archive_url":"https://api.github.com/repos/V10lator/sd-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/V10lator/sd-utils/downloads","issues_url":"https://api.github.com/repos/V10lator/sd-utils/issues{/number}","pulls_url":"https://api.github.com/repos/V10lator/sd-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/V10lator/sd-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/V10lator/sd-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/V10lator/sd-utils/labels{/name}","releases_url":"https://api.github.com/repos/V10lator/sd-utils/releases{/id}","created_at":"2015-06-23T10:15:15Z","updated_at":"2015-06-23T10:15:15Z","pushed_at":"2015-07-08T16:17:15Z","git_url":"git://github.com/V10lator/sd-utils.git","ssh_url":"git@github.com:V10lator/sd-utils.git","clone_url":"https://github.com/V10lator/sd-utils.git","svn_url":"https://github.com/V10lator/sd-utils","homepage":null,"size":159,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nemomobile:master","ref":"master","sha":"75169b0757d3a07d337f11d919d98143616d4eb4","user":{"login":"nemomobile","id":1088947,"avatar_url":"https://avatars.githubusercontent.com/u/1088947?v=3","gravatar_id":"","url":"https://api.github.com/users/nemomobile","html_url":"https://github.com/nemomobile","followers_url":"https://api.github.com/users/nemomobile/followers","following_url":"https://api.github.com/users/nemomobile/following{/other_user}","gists_url":"https://api.github.com/users/nemomobile/gists{/gist_id}","starred_url":"https://api.github.com/users/nemomobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nemomobile/subscriptions","organizations_url":"https://api.github.com/users/nemomobile/orgs","repos_url":"https://api.github.com/users/nemomobile/repos","events_url":"https://api.github.com/users/nemomobile/events{/privacy}","received_events_url":"https://api.github.com/users/nemomobile/received_events","type":"Organization","site_admin":false},"repo":{"id":13926363,"name":"sd-utils","full_name":"nemomobile/sd-utils","owner":{"login":"nemomobile","id":1088947,"avatar_url":"https://avatars.githubusercontent.com/u/1088947?v=3","gravatar_id":"","url":"https://api.github.com/users/nemomobile","html_url":"https://github.com/nemomobile","followers_url":"https://api.github.com/users/nemomobile/followers","following_url":"https://api.github.com/users/nemomobile/following{/other_user}","gists_url":"https://api.github.com/users/nemomobile/gists{/gist_id}","starred_url":"https://api.github.com/users/nemomobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nemomobile/subscriptions","organizations_url":"https://api.github.com/users/nemomobile/orgs","repos_url":"https://api.github.com/users/nemomobile/repos","events_url":"https://api.github.com/users/nemomobile/events{/privacy}","received_events_url":"https://api.github.com/users/nemomobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nemomobile/sd-utils","description":"Scripts for properly handling SD card and similar media","fork":false,"url":"https://api.github.com/repos/nemomobile/sd-utils","forks_url":"https://api.github.com/repos/nemomobile/sd-utils/forks","keys_url":"https://api.github.com/repos/nemomobile/sd-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nemomobile/sd-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nemomobile/sd-utils/teams","hooks_url":"https://api.github.com/repos/nemomobile/sd-utils/hooks","issue_events_url":"https://api.github.com/repos/nemomobile/sd-utils/issues/events{/number}","events_url":"https://api.github.com/repos/nemomobile/sd-utils/events","assignees_url":"https://api.github.com/repos/nemomobile/sd-utils/assignees{/user}","branches_url":"https://api.github.com/repos/nemomobile/sd-utils/branches{/branch}","tags_url":"https://api.github.com/repos/nemomobile/sd-utils/tags","blobs_url":"https://api.github.com/repos/nemomobile/sd-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nemomobile/sd-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nemomobile/sd-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/nemomobile/sd-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nemomobile/sd-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/nemomobile/sd-utils/languages","stargazers_url":"https://api.github.com/repos/nemomobile/sd-utils/stargazers","contributors_url":"https://api.github.com/repos/nemomobile/sd-utils/contributors","subscribers_url":"https://api.github.com/repos/nemomobile/sd-utils/subscribers","subscription_url":"https://api.github.com/repos/nemomobile/sd-utils/subscription","commits_url":"https://api.github.com/repos/nemomobile/sd-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/nemomobile/sd-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/nemomobile/sd-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/nemomobile/sd-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/nemomobile/sd-utils/contents/{+path}","compare_url":"https://api.github.com/repos/nemomobile/sd-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nemomobile/sd-utils/merges","archive_url":"https://api.github.com/repos/nemomobile/sd-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nemomobile/sd-utils/downloads","issues_url":"https://api.github.com/repos/nemomobile/sd-utils/issues{/number}","pulls_url":"https://api.github.com/repos/nemomobile/sd-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/nemomobile/sd-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/nemomobile/sd-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nemomobile/sd-utils/labels{/name}","releases_url":"https://api.github.com/repos/nemomobile/sd-utils/releases{/id}","created_at":"2013-10-28T13:17:52Z","updated_at":"2015-04-30T17:14:12Z","pushed_at":"2015-08-28T10:50:40Z","git_url":"git://github.com/nemomobile/sd-utils.git","ssh_url":"git@github.com:nemomobile/sd-utils.git","clone_url":"https://github.com/nemomobile/sd-utils.git","svn_url":"https://github.com/nemomobile/sd-utils","homepage":null,"size":433,"stargazers_count":2,"watchers_count":2,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":3,"forks":9,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19"},"html":{"href":"https://github.com/nemomobile/sd-utils/pull/19"},"issue":{"href":"https://api.github.com/repos/nemomobile/sd-utils/issues/19"},"comments":{"href":"https://api.github.com/repos/nemomobile/sd-utils/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/nemomobile/sd-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nemomobile/sd-utils/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/nemomobile/sd-utils/statuses/8dc08031f2cd1b8c19229cc1e4dcac65103f8c95"}}}}