Bug 282598 - sysutils/am-utils: mounting a UFS file system fails
Summary: sysutils/am-utils: mounting a UFS file system fails
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-07 03:38 UTC by Tatsuki Makino
Modified: 2024-11-12 08:56 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
patch to make it almost identical to the base one in 12.4-STABLE (14.04 KB, patch)
2024-11-07 09:15 UTC, Tatsuki Makino
tatsuki_makino: maintainer-approval-
Details | Diff
Try this (1.09 KB, patch)
2024-11-07 18:10 UTC, Cy Schubert
no flags Details | Diff
attachment 254995 + attachment 255011 (16.02 KB, patch)
2024-11-09 11:15 UTC, Tatsuki Makino
no flags Details | Diff
patch working on 14.2-PRERELEASE (22.01 KB, patch)
2024-11-12 08:56 UTC, Tatsuki Makino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tatsuki Makino 2024-11-07 03:38:19 UTC

    
Comment 1 Tatsuki Makino 2024-11-07 03:49:05 UTC
tatsuki/makino: fails to write report :)

The mount fails when using a map to mount ufs in 14.2-PRERELEASE.
I brought in the configuration that was working fine on /usr/sbin/amd in 12.4-STABLE and used it as it was, and it failed.
And when I ran amd with the following in rc.conf at 12.4-STABLE, it fails to mount ufs.
amd_program="/usr/local/sbin/amd"

amd in ports seems to have a difference in not being able to mount ufs.
Comment 2 Tatsuki Makino 2024-11-07 09:15:25 UTC
Created attachment 254995 [details]
patch to make it almost identical to the base one in 12.4-STABLE

I tried to make it the same code as the base one that worked as intended, but this didn't include any code changes that solved the problem.

It seems to be a difference due to files such as /usr/src/usr.sbin/amd/libamu/Makefile.
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2024-11-07 18:02:42 UTC
I don't know where that patch came from. Git blame tells me it came from this:

commit 449287a2a5ee4743d1e51b1cef8423cd5ac0703b
Merge: 3b49535a5a12 ca57057f598b
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: Fri Nov 11 02:42:53 2016 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: Fri Nov 11 02:42:53 2016 +0000

    MFV r305100: Update amd from am-utils 6.1.5 to 6.2.
    
    Used extensively on my network over the past month.
    
    Reviewed by:    pfg, brooks
    Suggested by:   pfg
    Obtained from:  ftp://ftp.am-utils.org/pub/am-utils/
    MFC after:      6 weeks
    Relnotes:       yes
    Differential Revision:  D8405

Notes:
    svn path=/head/; revision=308493

But this was an SVN vendor branch merge so this doesn't make any sense. The SVN to GIT conversion might have lost the actual commit or something else might have occurred. It's not worth spinning up an SVN repo to find out why.
Comment 4 Cy Schubert freebsd_committer freebsd_triage 2024-11-07 18:10:00 UTC
Created attachment 255011 [details]
Try this

You might want to try this in addition to your patch. 

Having said this, I'm not prepared to tie am-utils that closely to the base O/S. The port will be deprecated once I manage to fix net maps in autofs. I have no intention of supporting automounting UFS filesystems.

Have you considered installing sysutils/devd-mount?
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2024-11-07 18:11:06 UTC
We will not add features to am-utils. It has been deprecated upstream and will be removed from ports when autofs supports net maps.
Comment 6 Tatsuki Makino 2024-11-07 21:38:02 UTC
(In reply to Cy Schubert from comment #4)

I've tried try-this attachment 255011 [details], but it only changed the reason for the failure, and that doesn't solve.

I was so upset that I failed to post #0 this time that I forgot to write it :), but the first reason it was in the syslog log is below.

Nov  7 12:31:59 T4 amd[13967]: NIS domain name is not set.  NIS ignored.
Nov  7 12:32:12 T4 amd[13967]: '/.amd_mnt/ufsid/58e1f14f26a1f54f': mount: Bad address
Nov  7 12:32:12 T4 amd[13967]: mount_ufs: Bad address

And when attachment 255011 [details] was applied, the following log was obtained.

Nov  8 06:22:30 T4 amd[99047]: NIS domain name is not set.  NIS ignored.
Nov  8 06:22:51 T4 amd[99047]: '/.amd_mnt/ufsid/58e1f14f26a1f54f': mount: No such file or directory
Nov  8 06:22:51 T4 amd[99047]: mount_ufs: No such file or directory

Then there's the part of the map file that mounts UFS, in particular.

ufsid   type:=auto;fs=${map};pref:=${key}/;\
        opts:=browsable
ufsid/* type:=ufs;dev:=/dev/ufsid/${/key};fs:=${autodir}/${key};\
        opts:=nodev,nosuid,unmount,utimeout=120

Can sysutils/devd-mount be an alternative to this behavior?
Comment 7 Cy Schubert freebsd_committer freebsd_triage 2024-11-08 00:15:35 UTC
(In reply to Tatsuki Makino from comment #6)

sysutils/devd-mount is preferred. It uses kernel notifications to trigger mounts based on rules in devd.conf or one of its directories.
Comment 8 Tatsuki Makino 2024-11-09 11:15:45 UTC
Created attachment 255047 [details]
attachment 254995 [details] + attachment 255011 [details]

(In reply to Cy Schubert from comment #7)
Thank you. And...

It's a combination of code fixes included in 12.4-STABLE and try-this patch.
The try-this patch is not a patch to the code, but a fix that works at configure phase.
I've also fixed a few more configure phases failing and generating a different config.h.

In the case of this patch, UFS mount will be successful.
However, it is still not identical to the base one in the 12.4-STABLE.
Also, I have only confirmed that it works with 12.4-STABLE.
Comment 9 Tatsuki Makino 2024-11-12 08:56:37 UTC
Created attachment 255115 [details]
patch working on 14.2-PRERELEASE

The patch attached to comment #8 worked in 12.4-STABLE, but not in 14.2-PRERELEASE.
As a result of pursuing that it will work properly in 14.2-PRERELEASE, these changes are required.