|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|
||||
devd based AUTOMOUNTER
Hi,
I have finally made some effort on writing flexible yet very simple automounter for FreeBSD desktop. Feel free to submit me BUG reports to this thread It currently supports these file formats: -- NTFS (rw) requires sysutils/fusefs-ntfs -- FAT/FAT32 -- exFAT requires sysutils/fusefs-exfat -- EXT2 -- EXT3 -- EXT4 requires sysutils/fusefs-ext4fuse -- UFS (DOH!) It keeps state of the mounted devices at /var/run/automount.state and logs all activities to /var/log/automount.log file. The place for the script is at /usr/local/sbin/automount.sh executable. The only additional configuration it requires is /usr/local/etc/devd/automount_devd.conf file. I have created repository @ GITHUB here: https://github.com/vermaden/automount
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd Last edited by vermaden; 20th February 2012 at 01:28 PM. |
|
||||
Added a check if ntfs-3g is available, if not then mount_ntfs is used instead.
Added deleting of empty directories at ${MNTPREFIX}. Added ${MNTPREFIX} to be set to /mnt or /media according to preference Adddd additional checks for NTFS filesystem with label "FAT". Adddd additional checks for FAT filesystem with label "NTFS".
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Quote:
pl_PL.ISO8859-2 cp852 ... and I do not want to write it myself, besides, You set these options ONCE, then use it all the time, I may even put the 'settings' into the *.conf file, good idea I think. Also these values are there because I did not finished working on this daemon yet, these are just mine settings. There is also other 'issue', the 'mount' encoding and my user encoding are different Quote:
Quote:
Typing scripts that way the moment when I look at something I already know what it does and what does not, at least it helps me a lot to write/reuse/modify scripts faster and do not waste time on figuring, keeps WTFs/min at rather low value
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Quote:
It's easy to use a config file, just make it a shell script and source (.) it Quote:
It's not your script's job to fix a potentially broken PATH ... At the very least *append* it, instead of overwriting it. And even that *may* cause problems in some exotic setups ... Quote:
I find myself avoiding shell scripting at all costs these days ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
Quote:
Code:
[ -f /usr/local/etc/automount.conf ] && . /usr/local/etc/automount.conf https://github.com/vermaden/automoun...automount.conf Quote:
Quote:
Ok, You convinced me. Quote:
I use sh(1) as long as its quite simple, then I try at python(1)
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
CHANGELOG:
Added check if ntfsfix from sysutils/ntfsprogs is available, if Yes then try to fix the NTFS filesystem before mouting it. Added GPL3 License ... just joking ... added FreeBSD License to the file. Added 'noatime' as a default mount option when possible. Added TIMEOUT so when an 'orphan' STATE file lock remains, it will be deleted after a TIMEOUT. Added /usr/local/etc/devd/automount_devd.conf file instead of messing with the base system config at /etc/devd.conf. Added config file to be used from /usr/local/etc/automount.conf file, possible options are (these are defaults): MNTPREFIX="/media" Mine config currently has only these: ENCODING="pl_PL.ISO8859-2" The USERMOUNT otions if set to YES (default to NO) will 'chmod +s /sbin/umount', so You can click the ^ button on the devices list in NAUTILUS. These newly mounted devices appear on NAUTILUS sidebar (only with /media prefix). But THUNAR and PCMANFM does not do that, You know any other FMs that display mounted thumb drives/devices? EXAMPLE:
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Hi,
I removed the state_lock and stat_unlock mechanisms as they appeared to be not needed, I have shufled with 3 drives all the time and the 'integrity' has not been lost, at it was a lot faster, because the lock always had to wait for the 'slowest' drive (in term of initializing the device, like USB hard drive). I simplified the 'attach' section a lot, now each filesystem contains only check/fsck (if possible), mount and log info. I also simplified and improved the 'detach' section a little. I have added an option to automatically launch the set-up in config file manager (Yes, like in Windows ;p). These are options that I currently successfully use for NAUTILUS file manager, You need to set-up all three of them to make it work. Code:
POPUP=YES FM="nautilus --browser --no-desktop" USER=vermaden Code:
USERUMOUNT=YES POPUP=YES FM="nautilus --browser --no-desktop" USER=vermaden ENCODING=pl_PL.ISO8859-2 CODEPAGE=cp852 https://github.com/vermaden/automount Regards, vermaden
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Hi,
I have created a PORT at last, its in the 'port' directory in the usual place: https://github.com/vermaden/automount/ Its my first PORT so feel free to bash me about my mistakes After latest 'commits' I think that its ready for day-to-day use. To make 'full advantage' of *automount* install these ports: sysutils/ntfsprogs sysutils/fusefs-ntfs sysutils/fusefs-ext4fuse sysutils/fusefs-exfat I will try to add these ports as OPTIONS in the Makefile later. I will have to think about creating a man page through ... Feel free to submit Your propositions about next changes/development, because I think that I already created everything 'I' needed. Regards, vermaden
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Quote:
After that, the /usr/pkg/ habit kind of stuck for many years (But I've reverted back to the mainstream /usr/local since). In addition it's also useful if you want to install multiple versions of the same problem alongside eachother... Or if you're on some Read-only FS, you can mount a USB drive with additional software in /mnt/ and set my PATH to /mnt/bin/ ... I did this with jggimi's liveCD a couple of times. ... And there are probably many more scenarios ... Assuming /usr/local/ is a bad habit, and will break sooner or later.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
Regarding your port:
You can use NOBUILD instead of specifying an empty do-build target. And running a shell command (/etc/rc.d/devd restart) is the wrong place, this doesn't work when you install the package for example. You should put this in a pkg-install script.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
Quote:
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Added help page, removed some bugs and added some new features.
Code:
% automount --help AUTOMOUNT is a devd(8) based automounter for FreeBSD. It supports following file systems: UFS/FAT/exFAT/NTFS/EXT2/EXT3/EXT4 It needs these ports to mount NTFS/exFAT/EXT4 respectively: o sysutils/fusefs-ntfs o sysutils/fusefs-exfat o sysutils/fusefs-ext4fuse By default it mounts/unmounts all removable media but it is possible to set some additional options at the /usr/local/etc/automount.conf config file. Below is a list of possible options with description. MNTPREFIX (set to /media by default) With this options You can alter the default root for mounting the removable media, for example to the /mnt directory. example: MNTPREFIX="/media" ENCODING (set to en_US.ISO8859-1 by default) Only used with FAT32 mounts, specifies which encoding to use at the mount. example: ENCODING="pl_PL.ISO8859-2" CODEPAGE (set to cp437 by default) Only used with FAT32 mounts, specifies which code page to use at the mount. example: CODEPAGE="cp852" USER (unset by default) If set to some username, the mount command will chown(1) the mount directory with the user and its primary user group. If used with FM option allows to launch the specified file manager after a successful mount. example: USER="vermaden" FM (unset by default) If set to file manager command, the mount will launch the specified command after successful mount. Works only if USER parameter is also set. example: FM="nautilus --browser --no-desktop" USERUMOUNT (set to NO by default) When set to YES it will 'chmod +s /sbin/umount' which would allow an USER to unmount the file system with their selected file manager. example: USERUMOUNT="YES" ATIME (set to YES by default) When set to NO it will mount filesystems with noatime options when possible. example: ATIME="NO" REMOVEDIRS (set to NO by default) When set to YES it will remove empty directories under the used after device detach. example: REMOVEDIRS="YES"
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Hi,
after some 'fun' with MP3 players I have made some modifications and fixes. Here is a list of whats changed: Fixed bug about inproper exFAT detection, now mounts fine. Fixed bug about creating mount dirs for all attached devices no matter if needed or not. Revised 'detach' section, now removes only directory that is unmounted (if enabled of course). Simplified FAT/NTFS sections, removed additional check as it break some MP3 players default filesystems automount. The latest 1.3 version can be found here as usual: https://github.com/vermaden/automount/ Regards, vermaden
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
Already at 1.3.1 ...
Fixed the 'detach' section (s/PREFIX/MNTPREFIX/g). Fixed removing directories of manually (properly) unmounted filesystems.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
||||
The sysutils/automount in the latest 1.4.1 version just hit the ports (thanks Bryan).
Changelog since the 1.3.1 version: Quote:
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Which software is most secure for web-based webhosting? | steamrent | General software and network | 4 | 20th December 2011 02:46 PM |
Installing AMD Automounter | Kirfew | OpenBSD General | 2 | 6th November 2010 05:47 PM |
Requirements-based BSD | jboisvert | FreeBSD General | 2 | 20th October 2010 01:14 PM |
A name for an embedded FreeBSD-based OS | nimnod | Off-Topic | 15 | 16th March 2009 03:06 PM |
FOSS web-based accounting? | DraconianTimes | Off-Topic | 0 | 16th November 2008 02:20 PM |