-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mount-sd] create directory writable for all users. Fixes MER#1010 #18
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Denis Zalevskiy <[email protected]>
If card has filesystem different from vfat or ntfs, so maybe posix attrs are applicable to it, create directory there with recognizable name and sticky bit to allow users (e.g. nemo) to create files/directories there. To git rid of the hassle of handling card with different filesystems in a different way and hard-coding sticky-marked dir name, symlink this directory for posix-compliant filesystems in the temporary runtime dir /run/media or just the filesystem root directory - for vfat and ntfs Signed-off-by: Denis Zalevskiy <[email protected]>
if mkdir ${COMMON_DIR} && chmod 1777 ${COMMON_DIR}; then | ||
ln -s "${COMMON_DIR}" "$(get_path_fname ${UUID})" | ||
fi | ||
elif ! $(su nemo -c "test -w ${COMMON_DIR}"); then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This puts in the assertion that the system user is nemo
, and that there's only one user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a log record to know what happened (hard to check availability for each/unknown user), I can remove it.
This solution is proposed as the simple feature until we get something better: we discussed the state of things with @foolab and will try to propose more universal and flexible solution for all this data storage (cards, internal flash etc.) stuff. But the former will be implemented later. |
This proposal will still cause unexpected behaviour for most users by not indexing content on the card due to permission issues. There's no need to rush out a half baked solution breaking in most usecases when advanced users capable of figuring out what's breaking and fixing can just properly prepare their card from the very beginning. For all other users this would just generate support volume. |
@bwachter There should be some solution to allow to store backups on the sd card. Or course, we can say that users of better filesystems should do more steps to get it working but on the other hand this is unfair. This patch does not solve card indexing issue and it was not intended to solve it. It solves specifically one issue and it does not introduce new ones, as also it does not prevent from doing things in a better way :) |
It adds semantics to directories on the SD card and we'll then kind of have to support that in some way. What about going back to @lbt's patch, but make it so that a system-level dialog pops up and asks if we should make the SD card world-writable (in user-friendly words, like "Change permission, so the device can write indepentent of file owner" or something)? (so not |
Or alternatively: 1.) If SD card is |
I was writing a patch which did a chown but cached and restored on umount (lets just hope that we do umount on poweroff or that the UI has an 'eject' :) )
|
@deztructor linux filesystems are currently not supported. It's better to clearly state they're not supported than doing some half assed thing breaking most usecases. To properly support there is the overlay solution as android uses. @lbt this will break if the user just removes the card, and has other interesting ways of breaking. At least try to be serious, please. |
Linux filesystems ARE supported. Me and @iamer spent time making sure we can mount them. The proposed solution ensures that we have a writable directory for e.g. backups. We already have directories with semantics (Documents, Videos, Music, ...) which we use and I don't see why this case is bad. A bigger plan is to allow aps to make use of that directory to store their data there but it needs to be documented and discussed. |
@bwachter please take a time to understand my patch and describe use cases it breaks |
@bwachter I am being serious - try to have some respect. @deztructor @foolab I wonder if we could merge the ideas - I like the idea of something like /home/nemo/External mapping to a dedicated directory in the root of the SD card - but I also like the idea of being able to access (and even see via tracker) media files etc on the card which are readable and not in that directory. |
isn't it possible to just configure tracker so that it scans the dedicate nemo-specific folder as well as the directories in the root of the SD? |
Alternative solution (comparing to #17) for the problem of writable directories on posix-compliant filesystems. It is implemented and described in the commit 3ae6881