[packages/autofs] - cleanup mount map configs, rel4 - remove ancient, non-working configs - add Debian fix for nfs4 m
baggins
baggins at pld-linux.org
Mon Aug 25 00:10:01 CEST 2025
commit 1b255ab12ce8f64aaf00bb91750c1cf6b683b141
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Aug 25 02:08:16 2025 +0200
- cleanup mount map configs, rel4
- remove ancient, non-working configs
- add Debian fix for nfs4 mounts
- disable default mount maps
autofs-auto.master | 7 ----
autofs-auto.media | 12 -------
autofs-auto.net | 19 -----------
autofs.spec | 18 ++++------
cleanup-master-map.patch | 31 ++++++++++++++++++
fix-nfs4-mounts-in-auto-net.patch | 69 +++++++++++++++++++++++++++++++++++++++
6 files changed, 107 insertions(+), 49 deletions(-)
---
diff --git a/autofs.spec b/autofs.spec
index 37c196f..d1e4fbc 100644
--- a/autofs.spec
+++ b/autofs.spec
@@ -14,19 +14,18 @@ Summary(pt_BR.UTF-8): Servidor autofs
Summary(tr.UTF-8): autofs sunucu süreci
Name: autofs
Version: 5.1.9
-Release: 3
+Release: 4
Epoch: 1
License: GPL v2+
Group: Daemons
Source0: https://www.kernel.org/pub/linux/daemons/autofs/v5/%{name}-%{version}.tar.xz
# Source0-md5: 06fb59a03c82364a0d788435b6853d70
Source1: %{name}.init
-Source2: %{name}-auto.master
-Source3: %{name}-auto.media
-Source4: %{name}-auto.net
-Source5: %{name}.sysconfig
+Source2: %{name}.sysconfig
Patch0: %{name}-systemd-service.patch
Patch1: cifs-creds-path.patch
+Patch2: fix-nfs4-mounts-in-auto-net.patch
+Patch3: cleanup-master-map.patch
# https://www.kernel.org/pub/linux/daemons/autofs/v5/patches-5.2.0/
Patch100: autofs-5.1.9-update-configure.patch
Patch101: autofs-5.1.9-fix-ldap_parse_page_control-check.patch
@@ -133,6 +132,7 @@ przechowywanych na serwerze LDAP.
%setup -q
%patch -P0 -p1
%patch -P1 -p1
+%patch -P2 -p1
%patch -P100 -p1
%patch -P101 -p1
@@ -181,7 +181,7 @@ LDFLAGS="%{rpmldflags}" \
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/misc,/net,%{_sysconfdir}/creds,%{_sbindir},%{_libdir}/autofs,%{_mandir}/man{5,8}} \
+install -d $RPM_BUILD_ROOT{/misc,/net,%{_sysconfdir}/{creds,auto.master.d},%{_sbindir},%{_libdir}/autofs,%{_mandir}/man{5,8}} \
$RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
%{__make} install install_samples \
@@ -189,10 +189,7 @@ install -d $RPM_BUILD_ROOT{/misc,/net,%{_sysconfdir}/creds,%{_sbindir},%{_libdir
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/autofs
-cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/auto.master
-cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/auto.media
-cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/auto.net
-cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/autofs
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/autofs
touch $RPM_BUILD_ROOT%{_sysconfdir}/auto.{home,var,tmp}
@@ -234,7 +231,6 @@ fi
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/autofs.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/auto.home
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/auto.master
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/auto.media
%attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/auto.net
%attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/auto.smb
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/auto.tmp
diff --git a/autofs-auto.master b/autofs-auto.master
deleted file mode 100644
index f99a45c..0000000
--- a/autofs-auto.master
+++ /dev/null
@@ -1,7 +0,0 @@
-# Sample auto.master file
-# Format of this file:
-# mountpoint map options
-# For details of the format look at autofs(8).
-
-/media auto.media
-/net auto.net
diff --git a/autofs-auto.media b/autofs-auto.media
deleted file mode 100644
index 29961ce..0000000
--- a/autofs-auto.media
+++ /dev/null
@@ -1,12 +0,0 @@
-# This is an automounter map and it has the following format
-# key [ -mount-options-separated-by-comma ] location
-# Details may be found in the autofs(5) manpage
-
-kernel -ro,soft,intr ftp.kernel.org:/pub/linux
-cdrom -fstype=iso9660,ro :/dev/cdrom
-
-# the following entries are samples to pique your imagination
-#floppy -fstype=auto :/dev/fd0
-#floppy -fstype=ext2 :/dev/fd0
-#e2floppy -fstype=ext2 :/dev/fd0
-#jaz -fstype=ext2 :/dev/sdc1
diff --git a/autofs-auto.net b/autofs-auto.net
deleted file mode 100644
index 65f27da..0000000
--- a/autofs-auto.net
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-# Look at what a host is exporting to determine what we can mount.
-# This is very simple, but it appears to work surprisingly well
-
-key="$1"
-opts="-fstype=nfs,hard,intr,nodev,nosuid"
-
-# Showmount comes in a number of names and varieties. "showmount" is
-# typically an older version which accepts the '--no-headers' flag
-# but ignores it. "kshowmount" is the newer version installed with knfsd,
-# which both accepts and acts on the '--no-headers' flag.
-#SHOWMOUNT="kshowmount --no-headers -e $key"
-#SHOWMOUNT="showmount -e $key | tail +2"
-
-# Newer distributions get this right
-SHOWMOUNT="showmount --no-headers -e $key"
-
-$SHOWMOUNT | sort +0 | sed -e "s|^\([^ ]*\).*|$key\1 $opts $key:\1|"
diff --git a/cleanup-master-map.patch b/cleanup-master-map.patch
new file mode 100644
index 0000000..cb9eed9
--- /dev/null
+++ b/cleanup-master-map.patch
@@ -0,0 +1,31 @@
+--- autofs-5.1.9/samples/auto.master.orig 2025-08-25 02:03:41.643331333 +0200
++++ autofs-5.1.9/samples/auto.master 2025-08-25 02:05:29.016664654 +0200
+@@ -4,22 +4,22 @@
+ # mount-point [map-type[,format]:]map [options]
+ # For details of the format look at auto.master(5).
+ #
+-/misc /etc/auto.misc
++#/misc /etc/autofs/auto.misc
+ #
+ # NOTE: mounts done from a hosts map will be mounted with the
+ # "nosuid" and "nodev" options unless the "suid" and "dev"
+ # options are explicitly given.
+ #
+-/net -hosts
++#/net -hosts
+ #
+-# Include /etc/auto.master.d/*.autofs
++# Include /etc/autofs/auto.master.d/*.autofs
+ # To add an extra map using this mechanism you will need to add
+-# two configuration items - one /etc/auto.master.d/extra.autofs file
++# two configuration items - one /etc/autofs/auto.master.d/extra.autofs file
+ # (using the same line format as the auto.master file)
+-# and a separate mount map (e.g. /etc/auto.extra or an auto.extra NIS map)
++# and a separate mount map (e.g. /etc/autofs/auto.extra or an auto.extra NIS map)
+ # that is referred to by the extra.autofs file.
+ #
+-+dir:/etc/auto.master.d
+++dir:/etc/autofs/auto.master.d
+ #
+ # If you have fedfs set up and the related binaries, either
+ # built as part of autofs or installed from another package,
diff --git a/fix-nfs4-mounts-in-auto-net.patch b/fix-nfs4-mounts-in-auto-net.patch
new file mode 100644
index 0000000..6967fc4
--- /dev/null
+++ b/fix-nfs4-mounts-in-auto-net.patch
@@ -0,0 +1,69 @@
+Description: Fix nfs4/nfs mounting via autofs in auto.net.
+Author: David Mohr <bugs at da.mcbf.net>
+
+--- a/samples/auto.net
++++ b/samples/auto.net
+@@ -9,28 +9,44 @@
+
+ # add "nosymlink" here if you want to suppress symlinking local filesystems
+ # add "nonstrict" to make it OK for some filesystems to not mount
+-opts="-fstype=nfs,hard,nodev,nosuid"
+
+-for P in /bin /sbin /usr/bin /usr/sbin
+-do
+- for M in showmount kshowmount
++[ -f /etc/default/autofs ] && . /etc/default/autofs
++
++if [ -z "$MOUNT_NFS_DEFAULT_PROTOCOL" -o "$MOUNT_NFS_DEFAULT_PROTOCOL" == "3" ]; then
++ # Showmount comes in a number of names and varieties. "showmount" is
++ # typically an older version which accepts the '--no-headers' flag
++ # but ignores it. "kshowmount" is the newer version installed with knfsd,
++ # which both accepts and acts on the '--no-headers' flag.
++ #SHOWMOUNT="kshowmount --no-headers -e $key"
++ #SHOWMOUNT="showmount -e $key | tail -n +2"
++
++ for P in /bin /sbin /usr/bin /usr/sbin
+ do
+- if [ -x $P/$M ]
+- then
+- SMNT=$P/$M
+- break 2
+- fi
++ for M in showmount kshowmount
++ do
++ if [ -x $P/$M ]
++ then
++ SMNT=$P/$M
++ break
++ fi
++ done
+ done
+-done
+
+-[ -x $SMNT ] || exit 1
++ [ -x $SMNT ] || exit 1
++
++ # Newer distributions get this right
++ SHOWMOUNT="$SMNT --no-headers -e $key"
+
+-# Newer distributions get this right
+-SHOWMOUNT="$SMNT --no-headers -e $key"
++ $SHOWMOUNT | LC_ALL=C cut -d' ' -f1 | LC_ALL=C sort -u | \
++ awk -v key="$key" -v opts="$opts" -- '
++ BEGIN { ORS=""; first=1 }
++ { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 }
++ END { if (!first) print "\n"; else exit 1 }
++ ' | sed 's/#/\\#/g'
++ opts="-fstype=nfs,hard,intr,nodev,nosuid"
++else
++ # NFSv4
++ opts="-fstype=nfs4,hard,intr,nodev,nosuid,async"
+
+-$SHOWMOUNT | LC_ALL=C cut -d' ' -f1 | LC_ALL=C sort -u | \
+- awk -v key="$key" -v opts="$opts" -- '
+- BEGIN { ORS=""; first=1 }
+- { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 }
+- END { if (!first) print "\n"; else exit 1 }
+- ' | sed 's/#/\\#/g'
++ echo "$opts $key:/"
++fi
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/autofs.git/commitdiff/1b255ab12ce8f64aaf00bb91750c1cf6b683b141
More information about the pld-cvs-commit
mailing list