Due to a change in the "file"-command, automount-1.4.3 does not work under FreeBSD 10.1. The bug can easily be fixed by adding a "-k" to the file-command in /usr/local/sbin/automount line 161: Change this: case $( file -b -L -s ${DEV} | sed -E 's/label:\ \".*\"//g' ) in into this: case $( file -k -b -L -s ${DEV} | sed -E 's/label:\ \".*\"//g' ) in and it'll work like a charm again.
Fix Summary and assign.
Created attachment 152162 [details] automount-1.5.1.tar.gz Here is fixed automount version 1.5.1 that does have -k option for file(1).
The version 1.5.1 besides the -k fix also provides 'devd fix'. When automount was introduced this REGEX worked for all partitions: match "cdev" "(da|mmcsd)[0-9]+"; Now this REGEX is needed: match "cdev" "(da|mmcsd)[0-9]+.*"; which is included in 1.5.1 Regards, vermaden
I have file -k -b -L -s da0s1 Unix Fast File system [v2] (little-endian) last written at Thu Jan 1 00:00:00 1970, number of blocks 0, number of data blocks 0, pending blocks to free 0, system-wide uuid 0,\012- Linux rev 1.0 ext3 filesystem data, UUID=077a35d4-f8b9-4990-810f-9fbed73ab23e, volume name "DATA" (large files) script determines the file system as ext3 - but in fact it is the UFC :) file -b -L -s da0s1 Unix Fast File system [v2] (little-endian) last written at Thu Jan 1 00:00:00 1970, number of blocks 0, number of data blocks 0, pending blocks to free 0, system-wide uuid 0, specifies the file system correctly.
s/UFC/UFS/ sorry
and more importantly - start the disk check e2fsck -y and so I lost the data on it. cool.
> and more importantly - start the disk check > e2fsck -y and so I lost the data on it. cool. Its not an excuse but that is sometimes cost of automation :/ The file(1) is not perfect for filesystem detection. I may also introduce a 'NOFORCE] option to not force the check? You may check the latest 1.5.2 with reworked filesystem detection. The UFS is tried two times because that works best, its tricky (right guess of the filesystem) because if You create two of three new filesystems on the same device without cleaning it with /dev/zero then file(1) shows more then one filesystem detected, 1.5.2 should not be problematic now, but I for sure did not tested every possible configuration out there: # newfs_msdos /dev/md0p1 newfs_msdos: trim 4 sectors to adjust to a multiple of 9 /dev/md0p1: 163712 sectors in 10232 FAT16 clusters (8192 bytes/cluster) BytesPerSec=512 SecPerClust=16 ResSectors=1 FATs=2 RootDirEnts=512 Media=0xf0 FATsecs=40 SecPerTrack=9 Heads=128 HiddenSecs=0 HugeSectors=163836 # newfs /dev/md0p1 /dev/md0p1: 80.0MB (163840 sectors) block size 32768, fragment size 4096 using 4 cylinder groups of 20.03MB, 641 blks, 2688 inodes. super-block backups (for fsck_ffs -b #) at: 192, 41216, 82240, 123264 # file -k -r -b -L -s /dev/md0p1 DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "BSD4.4 ", sectors/cluster 16, root entries 512, sectors/FAT 40, sectors/track 9, heads 128, sectors 163836 (volumes > 32 MB) , serial number 0x791819df, unlabeled, FAT (16 bit) - Unix Fast File system [v2] (little-endian) last written at Thu Jan 1 00:00:00 1970, number of blocks 0, number of data blocks 0, average file size 0, average number of files in dir 0, pending blocks to free 0, pending inodes to free 0, system-wide uuid 0, DOS executable (COM), boot code # mkfs.ext3 /dev/md0p1 mke2fs 1.42.12 (29-Aug-2014) /dev/md0p1 contains a vfat file system Proceed anyway? (y,n) y Creating filesystem with 81920 1k blocks and 20480 inodes Filesystem UUID: b1b58de6-efc2-4531-8576-e732a272d6dd Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Allocating group tables: done Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done # newfs /dev/md0p1 /dev/md0p1: 80.0MB (163840 sectors) block size 32768, fragment size 4096 using 4 cylinder groups of 20.03MB, 641 blks, 2688 inodes. super-block backups (for fsck_ffs -b #) at: 192, 41216, 82240, 123264 # file -k -r -b -L -s /dev/md0p1 Unix Fast File system [v2] (little-endian) last written at Thu Jan 1 00:00:00 1970, number of blocks 0, number of data blocks 0, pending blocks to free 0, system-wide uuid 0, - Linux rev 1.0 ext3 filesystem data, UUID=b1b58de6-efc2-4531-8576-e732a272d6dd
Created attachment 152190 [details] automount-1.5.2.tar.gz
If there are no complaints about the new 1.5.2 version then You may close this BUG and update the port to 1.5.2. Regards, vermaden
Created attachment 152587 [details] automount-1.5.3.tar.gz Upload automount-1.5.3.tar.gz with small fix (harmless). https://github.com/vermaden/automount/commit/d4fec94dc0d62c789edac95b2ede92d09ef63e1f Regards, vermaden
Created attachment 152598 [details] automounter.diff Hi, I have created a patch against the ports tree to update it. You should not attach the software itself but the patch to update the port here. Please test and approve this patch. I also changed the post-install script slightly. Thanks.
Comment on attachment 152598 [details] automounter.diff I would leave this as is: echo "Check /usr/local/sbin/automount --help for available options." because there is 'other' automount in the FreeBSD base system: % /usr/sbin/automount --help automount: illegal option -- - usage: automount [-D name=value][-o opts][-Lfuv] Rest is ok. Regards, vermaden
A commit references this bug: Author: madpilot Date: Fri Feb 6 13:41:43 UTC 2015 New revision: 378537 URL: https://svnweb.freebsd.org/changeset/ports/378537 Log: - Update to 1.5.3 - Adjust path in pkg-install to PREFIX PR: 197023 Submitted by: vermaden@interia.pl (maintainer) Changes: head/sysutils/automount/Makefile head/sysutils/automount/distinfo head/sysutils/automount/files/ head/sysutils/automount/files/pkg-install.in head/sysutils/automount/pkg-install
Committed. I fixed pkg-install to substitute the prefix. There is no warranty the file will end up in /usr/local/. Thanks!
Thank You for help with port update. Regards, vermaden
Also, here is the changelog for 1.5.3 You may use in the Freshports commit. Add -k option to file(1). Add -o recover option to ntfs-3g(8). Add BOOTDELAY option and associated __wait_for_boot() function. Add __random_wait() function. Fix devd(8) config. Rework state handling. Regards, vermaden
(In reply to vermaden from comment #16) I'm sorry I already did the commit and only stated the port was updated. Commit messages cannot be modified.
No problem, its not THAT important.