Bug 197023 - sysutils/automount 1.4.3 does not work under FreeBSD 10.1
Summary: sysutils/automount 1.4.3 does not work under FreeBSD 10.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-23 07:47 UTC by Nikolaus Klepp
Modified: 2015-02-06 16:22 UTC (History)
3 users (show)

See Also:


Attachments
automount-1.5.1.tar.gz (4.63 KB, application/x-gzip)
2015-01-26 08:02 UTC, Slawomir Wojciech Wojtczak
no flags Details
automount-1.5.2.tar.gz (4.75 KB, application/x-gzip)
2015-01-26 18:19 UTC, Slawomir Wojciech Wojtczak
no flags Details
automount-1.5.3.tar.gz (4.75 KB, application/x-gzip)
2015-02-05 15:50 UTC, Slawomir Wojciech Wojtczak
no flags Details
automounter.diff (1.51 KB, patch)
2015-02-05 18:59 UTC, Guido Falsi
madpilot: maintainer-approval? (vermaden)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolaus Klepp 2015-01-23 07:47:54 UTC
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2015-01-26 03:12:08 UTC
Fix Summary and assign.
Comment 2 Slawomir Wojciech Wojtczak 2015-01-26 08:02:44 UTC
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).
Comment 3 Slawomir Wojciech Wojtczak 2015-01-26 16:15:35 UTC
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
Comment 4 Ivan Klymenko 2015-01-26 16:35:08 UTC
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.
Comment 5 Ivan Klymenko 2015-01-26 16:36:18 UTC
s/UFC/UFS/ 
sorry
Comment 6 Ivan Klymenko 2015-01-26 17:16:12 UTC
and more importantly - start the disk check e2fsck -y and so I lost the data on it. cool.
Comment 7 Slawomir Wojciech Wojtczak 2015-01-26 18:19:06 UTC
> 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
Comment 8 Slawomir Wojciech Wojtczak 2015-01-26 18:19:49 UTC
Created attachment 152190 [details]
automount-1.5.2.tar.gz
Comment 9 Slawomir Wojciech Wojtczak 2015-02-02 07:48:16 UTC
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
Comment 10 Slawomir Wojciech Wojtczak 2015-02-05 15:50:07 UTC
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
Comment 11 Guido Falsi freebsd_committer 2015-02-05 18:59:55 UTC
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 12 Slawomir Wojciech Wojtczak 2015-02-05 19:05:34 UTC
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
Comment 13 commit-hook freebsd_committer 2015-02-06 13:42:21 UTC
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
Comment 14 Guido Falsi freebsd_committer 2015-02-06 13:43:09 UTC
Committed.

I fixed pkg-install to substitute the prefix. There is no warranty the file will end up in /usr/local/.

Thanks!
Comment 15 Slawomir Wojciech Wojtczak 2015-02-06 13:45:06 UTC
Thank You for help with port update.

Regards,
vermaden
Comment 16 Slawomir Wojciech Wojtczak 2015-02-06 16:06:19 UTC
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
Comment 17 Guido Falsi freebsd_committer 2015-02-06 16:21:23 UTC
(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.
Comment 18 Slawomir Wojciech Wojtczak 2015-02-06 16:22:23 UTC
No problem, its not THAT important.