From patchwork Wed Feb 12 19:12:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan McGregor X-Patchwork-Id: 57217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27F01C021A0 for ; Wed, 12 Feb 2025 19:16:09 +0000 (UTC) Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) by mx.groups.io with SMTP id smtpd.web10.24850.1739387766624286866 for ; Wed, 12 Feb 2025 11:16:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lTGv8tRY; spf=pass (domain: gmail.com, ip: 209.85.128.177, mailfrom: danismostlikely@gmail.com) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-6f9e78593b8so644097b3.1 for ; Wed, 12 Feb 2025 11:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739387765; x=1739992565; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mOJmaQsBFSYoIVWr7zdsv4qM4d0FMXLFrxkio0XVYNs=; b=lTGv8tRYPbaYJStDqJuJXgNHb4S5GZfJ3/JxMHVkOVeB2e13J9yQwr6Eesjx5vEp5G Q9l8qptRuKfoTJnSpaqWSKU7Rc4XuYtZki+KszlSu9RUYS2jGuhYNbhdleO6zawTZp2F ZWofTQIFKkY684oEaODlpE7DARyUfexyFxXhSIVQLYI484MuFs/6F6A3Ifx5WLfVxgf5 z1Qsur0QpPl5/h1Wxxr22oS8a+grbcNBM5wzg1tJCKCnP20pGlutcdEC7qcts7KH0b3p JDtm1j3Y6t3rLbdo4PBs9z/4GXRZI2XRRhk74q5r6sNY5E3Vnq8fqzRbl1lj1WLDP1yY zWig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739387765; x=1739992565; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mOJmaQsBFSYoIVWr7zdsv4qM4d0FMXLFrxkio0XVYNs=; b=YPX6bS6ytKzzuNAF0EX7r/0a8/Ti+r+ScZfJxZrQFa3UJUwC2cWKuq8q4ieclQzhp+ LWT2CT/X6PzSgKQp01yyOIS/ph2YVxGhNy2NLKIM1SZni+cZiHicGEAArsWq9Q60H82y ctRm0LBcAONJtJiJhi1RlnwxgiJXRWE5Kr/J92blYZAysgG4sH7TYKfVmw7s9Qv+Wjho kmEjt7qx7BM4fZx7Zm9s2U2d8DxB561945gR9jx+7k4LfRmA9SkMcrCT8J5J+Gx6lHm1 EdJB7g+RgoRvjseglzn3zo5pKbq2SDq750wg0irINjjAwgvG+h4kOGdAxthcCK6gqF29 4s2w== X-Gm-Message-State: AOJu0YwR69ugONo3jluOLM8w5McwN8dScRYC2tn2b8otF2uarRRK9wyT ZX8jjlTYZJiP+NScObPsuT4lDMo8AhNIkWylOkwXaiydumdpcvM0OiyWLQ== X-Gm-Gg: ASbGncsf1BezdHk9FTs3faCDR2KIdlAkJLc70xzsvKQVgl9LPdlXXNRO0RagjBewyCF PzhZw84H8spQwgkZcJewBzmt9t63TD7ADaFIAO675Dwd5c66blbO9mudsbFvWpeMrQI3l+Jz2wp cPyPOuWCGso+RCzh4kDxQNLzC+bwX4XgxjnELdOArl257NodCg0piIg0FOdW07klM2GZiaRYYkz LkB/ErZ4agRMQKrlw0pSM6GinrAM17rZbxC/nUM2B5GdJfvc+NMwHTo3TG10/L0xWFxDZ7UlUc1 p39oMdUSJch+3y9IoLnjKOT5k37sKF4XVYByexsw X-Google-Smtp-Source: AGHT+IFGpYJ7SpfGPEA8dJ5qv8x2DU8aX3guorC8ikqKo6ZikgSTEdR6Jj7wu9T1ZSSTIs+zz/NeFw== X-Received: by 2002:a05:690c:2b8c:b0:6f9:d772:3dfa with SMTP id 00721157ae682-6fb339132e1mr2477947b3.0.1739387765442; Wed, 12 Feb 2025 11:16:05 -0800 (PST) Received: from nebuchadnezzar.home.arpa ([204.83.204.143]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f99fce16d1sm28115017b3.23.2025.02.12.11.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 11:16:04 -0800 (PST) From: Dan McGregor To: openembedded-core@lists.openembedded.org Cc: Daniel McGregor Subject: [PATCH 1/4] nfs-utils: clean up startup Date: Wed, 12 Feb 2025 13:12:29 -0600 Message-ID: <20250212191518.1968329-1-danismostlikely@gmail.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 12 Feb 2025 19:16:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/211273 From: Daniel McGregor Change the sysvinit script to start at the S runlevel, this matches Debian, and prevents systemd from generating a unit file for it. Also have the nfsd systemd service request the nfsd kernel filesystem mountpoint. This avoids startup failures in unpriviled containers or other setups that don't support the filesystem. Signed-off-by: Daniel McGregor --- meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon | 8 ++++---- meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon index 992267d5a16..4f07324a21f 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon @@ -1,9 +1,9 @@ #!/bin/sh ### BEGIN INIT INFO # Provides: nfs-common -# Required-Start: $portmap hwclock -# Required-Stop: $portmap hwclock -# Default-Start: 2 3 4 5 +# Required-Start: $portmap $time +# Required-Stop: $portmap $time +# Default-Start: S # Default-Stop: 0 1 6 # Short-Description: NFS support for both client and server # Description: NFS is a popular protocol for file sharing across @@ -20,7 +20,7 @@ . /etc/init.d/functions test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd -test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid +test -z "$STATD_PID" && STATD_PID=/run/rpc.statd.pid # # The default state directory is /var/lib/nfs test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb index ff02a3aea01..df9c95a71ff 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb @@ -133,15 +133,14 @@ do_install:append () { install -m 0644 ${UNPACKDIR}/nfs-server.service ${D}${systemd_system_unitdir}/ install -m 0644 ${UNPACKDIR}/nfs-mountd.service ${D}${systemd_system_unitdir}/ install -m 0644 ${UNPACKDIR}/nfs-statd.service ${D}${systemd_system_unitdir}/ + install -m 0644 ${UNPACKDIR}/proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/ sed -i -e 's,@SBINDIR@,${sbindir},g' \ -e 's,@SYSCONFDIR@,${sysconfdir},g' \ -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \ ${D}${systemd_system_unitdir}/*.service - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -m 0644 ${UNPACKDIR}/proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/ - install -d ${D}${systemd_system_unitdir}/sysinit.target.wants/ - ln -sf ../proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/sysinit.target.wants/proc-fs-nfsd.mount - fi + # Add compatibility symlinks for the sysvinit scripts + ln -s nfs-server.service ${D}${systemd_system_unitdir}/nfsserver.service + ln -s /dev/null ${D}${systemd_system_unitdir}/nfscommon.service # kernel code as of 3.8 hard-codes this path as a default install -d ${D}/var/lib/nfs/v4recovery From patchwork Wed Feb 12 19:12:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan McGregor X-Patchwork-Id: 57218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E503C02198 for ; Wed, 12 Feb 2025 19:16:09 +0000 (UTC) Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by mx.groups.io with SMTP id smtpd.web10.24853.1739387767722911820 for ; Wed, 12 Feb 2025 11:16:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X+/w+9nG; spf=pass (domain: gmail.com, ip: 209.85.128.174, mailfrom: danismostlikely@gmail.com) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-6f768e9be1aso10839127b3.0 for ; Wed, 12 Feb 2025 11:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739387766; x=1739992566; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xWGgWC82cgPS+UrcP/ADwvpyAqJ2x9Uai+uTCNAlOCg=; b=X+/w+9nGo8m+UaHVGz8/lDETEOXRu2uAaOEEHzlmlkL+85YyskE5HdCehnqlEI3qdD SUKff7ehxE8b4YJaq9X6ptJuPgKHbnFLNZ+0f2OyoBKIY8R2Mu+iTn2CWhknpf1Sl9r8 dQpV2x8wVnD8WGuYXpe8ZzailCBS5fenl/Glk/5HSIwQFBDTl51/fT99GvbEQo+ztvHn YTA5knvsEWwQ3wwxtVq9h723d+TuiHwjU7haumsqbUNVVUIWVm6n76wSd1P5eliRPJPT ohWp5YU7KXJPw4PiPjjfNQS9pnAVTksylAgbWFlhXXHVxR4WyqzyysfIn/uecSOYaXGr YfhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739387766; x=1739992566; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xWGgWC82cgPS+UrcP/ADwvpyAqJ2x9Uai+uTCNAlOCg=; b=X83rzsTmAPzXd8RmlUNMyufBz1Gp/agVAMQl3w2yWU9rcFBBEfy5ykoAucXymsN4K1 9fyTHWBdBth6r/Aab8O+GwyjZNR+roLpQDtntuIH2pQcr57iVrLMFTDqzkOCmjDCZNGJ m6v97WyH0t4do/414pDjD3WBJoDmR7TIfMR3aHui8vOdofJTdfrYc/7zS6DMZM6FsOJ9 HDIJHCUU4BocYERmTpuHBW3PUboNUinDNCeHm+GbvYd5ujts/QzCNPpa3Olbw+QsxRhP 7EmDPwKfNPbWOdxyp29B78sgSzV8UW5sTYLrK705UG2uqP+cmbYhvPM/1Kh2Z82U31Bg fx/g== X-Gm-Message-State: AOJu0YyrOBy2BNfaCaqisxvya+HkiVMhbGom0SFb3XGJ+MTtVWKj6LU+ ay1jn6LtsSavMeoC3S2c7rv7jRkpDSU+/M7uZ0M3x10p76PvPJDOc688Yw== X-Gm-Gg: ASbGncvIru8MTYrt23sU7TnNXx7HAvkUXTkALZMWhJti805BlER0BjFSuY07P7J0vj5 TC2/qROZgDK9yP7kPYNiE1/s0bHHKiOH9TPxAbVZ+Tp6QtTxHOi3lwenvVmtuD2Ped56xpldA8H Se1kxnlVj6cNsBGLNXyF7h9fwMTGkcCafpDBmDbpdyIKfLbGO8YGSIDs9SZ932SEiJwIhV51VIl UUTT5D0Qjv/uoXSH+fXh0fV1Bv36OsmuD13xWP6YBhaNrkSSOnW+Q81f7DRsAGf9yPCsMtwaGNt lKr4R11ztMU7KiDS0vBm+CMeBwrO1G4cCZ5G8rhQ X-Google-Smtp-Source: AGHT+IEnMc2vwmRquEaF3Ctq1wRuqNcju0vr/KuN1fhb/ftHQJV8DpiGBjqAo4ajDr6R2BArikSz2w== X-Received: by 2002:a05:690c:4a13:b0:6e5:2adf:d584 with SMTP id 00721157ae682-6fb33efaf03mr931227b3.14.1739387766350; Wed, 12 Feb 2025 11:16:06 -0800 (PST) Received: from nebuchadnezzar.home.arpa ([204.83.204.143]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f99fce16d1sm28115017b3.23.2025.02.12.11.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 11:16:05 -0800 (PST) From: Dan McGregor To: openembedded-core@lists.openembedded.org Cc: Daniel McGregor Subject: [PATCH 2/4] nfs-utils: Use upstream systemd service files Date: Wed, 12 Feb 2025 13:12:30 -0600 Message-ID: <20250212191518.1968329-2-danismostlikely@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250212191518.1968329-1-danismostlikely@gmail.com> References: <20250212191518.1968329-1-danismostlikely@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 12 Feb 2025 19:16:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/211274 From: Daniel McGregor Reduce diffs against upstream by using the service files provided by them. This reduces our dependence on patches that simply change the names of a service. This also changes the way some nfs options get set for systemd, it introduces the nfs.conf file for configuration, which all daemons already support. Signed-off-by: Daniel McGregor --- .../bugfix-adjust-statd-service-name.patch | 39 ----------------- .../nfs-utils/nfs-utils/nfs-mountd.service | 18 -------- .../nfs-utils/nfs-utils/nfs-server.service | 24 ----------- .../nfs-utils/nfs-utils/nfs-statd.service | 16 ------- .../nfs-utils-debianize-start-statd.patch | 42 ------------------- .../nfs-utils/nfs-utils/nfs-utils.conf | 35 ---------------- .../nfs-utils/nfs-utils/proc-fs-nfsd.mount | 8 ---- .../nfs-utils/nfs-utils_2.8.2.bb | 33 +++++---------- 8 files changed, 11 insertions(+), 204 deletions(-) delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/bugfix-adjust-statd-service-name.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/bugfix-adjust-statd-service-name.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/bugfix-adjust-statd-service-name.patch deleted file mode 100644 index f13d7b380ca..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/bugfix-adjust-statd-service-name.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 398fed3bb0350cb1229e54e7020ae0e044c206d1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ulrich=20=C3=96lmann?= -Date: Wed, 17 Feb 2016 08:33:45 +0100 -Subject: bugfix: adjust statd service name -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Upstream uses 'rpc-statd.service' and Yocto introduced 'nfs-statd.service' -instead but forgot to update the mount.nfs helper 'start-statd' accordingly. - -Upstream-Status: Inappropriate [other] - -Signed-off-by: Ulrich Ölmann - -Rebase it. - -Signed-off-by: Robert Yang ---- - utils/statd/start-statd | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/utils/statd/start-statd b/utils/statd/start-statd -index af5c950..df9b9be 100755 ---- a/utils/statd/start-statd -+++ b/utils/statd/start-statd -@@ -28,10 +28,10 @@ fi - # First try systemd if it's installed. - if [ -d /run/systemd/system ]; then - # Quit only if the call worked. -- if systemctl start rpc-statd.service; then -+ if systemctl start nfs-statd.service; then - # Ensure systemd knows not to stop rpc.statd or its dependencies - # on 'systemctl isolate ..' -- systemctl add-wants --runtime remote-fs.target rpc-statd.service -+ systemctl add-wants --runtime remote-fs.target nfs-statd.service - exit 0 - fi - fi diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service deleted file mode 100644 index ebfe64b9ced..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=NFS Mount Daemon -DefaultDependencies=no -After=rpcbind.socket -Requires=proc-fs-nfsd.mount -After=proc-fs-nfsd.mount -After=network.target local-fs.target -BindsTo=nfs-server.service -ConditionPathExists=@SYSCONFDIR@/exports - -[Service] -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS -LimitNOFILE=@HIGH_RLIMIT_NOFILE@ -StateDirectory=nfs - -[Install] -WantedBy=multi-user.target diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service deleted file mode 100644 index 15ceee04d0d..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service +++ /dev/null @@ -1,24 +0,0 @@ -[Unit] -Description=NFS server and services -DefaultDependencies=no -Requires=network.target proc-fs-nfsd.mount -Requires=nfs-mountd.service -Wants=rpcbind.service -After=local-fs.target -After=network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service -ConditionPathExists=@SYSCONFDIR@/exports - -[Service] -Type=oneshot -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStartPre=@SBINDIR@/exportfs -r -ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT -ExecStop=@SBINDIR@/rpc.nfsd 0 -ExecStopPost=@SBINDIR@/exportfs -au -ExecStopPost=@SBINDIR@/exportfs -f -ExecReload=@SBINDIR@/exportfs -r -RemainAfterExit=yes -StateDirectory=nfs - -[Install] -WantedBy=multi-user.target diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service deleted file mode 100644 index b519194121c..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=NFS status monitor for NFSv2/3 locking. -DefaultDependencies=no -Conflicts=umount.target -Requires=nss-lookup.target rpcbind.service -After=network.target nss-lookup.target rpcbind.service -ConditionPathExists=@SYSCONFDIR@/exports - -[Service] -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS -LimitNOFILE=@HIGH_RLIMIT_NOFILE@ -StateDirectory=nfs - -[Install] -WantedBy=multi-user.target diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch deleted file mode 100644 index ede0dcefc49..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-debianize-start-statd.patch +++ /dev/null @@ -1,42 +0,0 @@ -[PATCH] nfs-utils: debianize start-statd - -Upstream-Status: Pending - -make start-statd command to use nfscommon configure, too. - -Signed-off-by: Henrik Riomar -Signed-off-by: Li Wang -Signed-off-by: Roy Li -Signed-off-by: Wenzong Fan ---- - utils/statd/start-statd | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/utils/statd/start-statd b/utils/statd/start-statd -index 2fd6039..f591b34 100755 ---- a/utils/statd/start-statd -+++ b/utils/statd/start-statd -@@ -17,6 +17,14 @@ then - # statd already running - must have been slow to respond. - exit 0 - fi -+ -+# Read config -+DEFAULTFILE=/etc/default/nfs-common -+NEED_IDMAPD= -+if [ -f $DEFAULTFILE ]; then -+ . $DEFAULTFILE -+fi -+ - # First try systemd if it's installed. - if [ -d /run/systemd/system ]; then - # Quit only if the call worked. -@@ -25,4 +33,4 @@ fi - - cd / - # Fall back to launching it ourselves. --exec rpc.statd --no-notify -+exec rpc.statd --no-notify $STATDOPTS --- -2.6.6 - diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf deleted file mode 100644 index a1007a7fbf4..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf +++ /dev/null @@ -1,35 +0,0 @@ -# Parameters to be passed to nfs-utils (clients & server) service files. -# - -# Options to pass to rpc.nfsd. -NFSD_OPTS="" - -# Number of servers to start up; the default is 8 servers. -NFSD_COUNT="" - -# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd". -PROCNFSD_MOUNTPOINT="" - -# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid". -PROCNFSD_MOUNTOPTS="" - -# Options for rpc.mountd. -# If you have a port-based firewall, you might want to set up -# a fixed port here using the --port option. -MOUNTD_OPTS="" - -# Parameters to be passed to nfs-common (nfs clients & server) init script. -# - -# If you do not set values for the NEED_ options, they will be attempted -# autodetected; this should be sufficient for most people. Valid alternatives -# for the NEED_ options are "yes" and "no". - -# Do you want to start the statd daemon? It is not needed for NFSv4. -NEED_STATD="" - -# Options to pass to rpc.statd. -# N.B. statd normally runs on both client and server, and run-time -# options should be specified accordingly. -# STATD_OPTS="-p 32765 -o 32766" -STATD_OPTS="" diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount deleted file mode 100644 index 630801b3751..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=NFSD configuration filesystem -After=systemd-modules-load.service - -[Mount] -What=nfsd -Where=/proc/fs/nfsd -Type=nfsd diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb index df9c95a71ff..f07ed2040ad 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb @@ -21,13 +21,6 @@ USERADD_PARAM:${PN}-client = "--system --home-dir /var/lib/nfs \ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \ file://nfsserver \ file://nfscommon \ - file://nfs-utils.conf \ - file://nfs-server.service \ - file://nfs-mountd.service \ - file://nfs-statd.service \ - file://proc-fs-nfsd.mount \ - file://nfs-utils-debianize-start-statd.patch \ - file://bugfix-adjust-statd-service-name.patch \ file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ file://clang-warnings.patch \ file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ @@ -48,8 +41,8 @@ INITSCRIPT_PARAMS:${PN}-client = "defaults 19 21" inherit autotools-brokensep update-rc.d systemd pkgconfig SYSTEMD_PACKAGES = "${PN} ${PN}-client" -SYSTEMD_SERVICE:${PN} = "nfs-server.service nfs-mountd.service" -SYSTEMD_SERVICE:${PN}-client = "nfs-statd.service" +SYSTEMD_SERVICE:${PN} = "nfs-server.service" +SYSTEMD_SERVICE:${PN}-client = "nfs-client.target" # --enable-uuid is need for cross-compiling EXTRA_OECONF = "--with-statduser=rpcuser \ @@ -65,7 +58,7 @@ EXTRA_OECONF = "--with-statduser=rpcuser \ LDFLAGS += "-lsqlite3 -levent" PACKAGECONFIG ??= "tcp-wrappers \ - ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \ " PACKAGECONFIG:remove:libc-musl = "tcp-wrappers" PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" @@ -75,6 +68,7 @@ PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmap # keyutils is available in meta-oe PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core" PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline," +PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd" PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats ${PN}-rpcctl" @@ -82,14 +76,16 @@ CONFFILES:${PN}-client += "${localstatedir}/lib/nfs/etab \ ${localstatedir}/lib/nfs/rmtab \ ${localstatedir}/lib/nfs/xtab \ ${localstatedir}/lib/nfs/statd/state \ + ${sysconfdir}/nfs.conf \ ${sysconfdir}/nfsmount.conf" FILES:${PN}-client = "${sbindir}/*statd \ ${libdir}/libnfsidmap.so.* \ ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ ${sbindir}/showmount ${sbindir}/nfsstat \ + ${sbindir}/nfsconf \ ${localstatedir}/lib/nfs \ - ${sysconfdir}/nfs-utils.conf \ + ${sysconfdir}/nfs.conf \ ${sysconfdir}/nfsmount.conf \ ${sysconfdir}/init.d/nfscommon \ ${systemd_system_unitdir}/nfs-statd.service" @@ -109,7 +105,7 @@ FILES:${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/ ${nonarch_libdir}/modp do_configure:prepend() { sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ - ${S}/utils/mount/Makefile.am + ${S}/utils/mount/Makefile.am ${S}/utils/nfsdcltrack/Makefile.am } # Make clean needed because the package comes with @@ -126,18 +122,11 @@ do_install:append () { install -m 0755 ${UNPACKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver install -m 0755 ${UNPACKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon - install -m 0755 ${UNPACKDIR}/nfs-utils.conf ${D}${sysconfdir} - install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir} + install -m 0644 ${S}/nfs.conf ${D}${sysconfdir} install -d ${D}${systemd_system_unitdir} - install -m 0644 ${UNPACKDIR}/nfs-server.service ${D}${systemd_system_unitdir}/ - install -m 0644 ${UNPACKDIR}/nfs-mountd.service ${D}${systemd_system_unitdir}/ - install -m 0644 ${UNPACKDIR}/nfs-statd.service ${D}${systemd_system_unitdir}/ - install -m 0644 ${UNPACKDIR}/proc-fs-nfsd.mount ${D}${systemd_system_unitdir}/ - sed -i -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \ - ${D}${systemd_system_unitdir}/*.service + # Retain historical service name so old scripts keep working + ln -s rpc-statd.service ${D}${systemd_system_unitdir}/nfs-statd.service # Add compatibility symlinks for the sysvinit scripts ln -s nfs-server.service ${D}${systemd_system_unitdir}/nfsserver.service ln -s /dev/null ${D}${systemd_system_unitdir}/nfscommon.service From patchwork Wed Feb 12 19:12:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan McGregor X-Patchwork-Id: 57219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F99DC021A5 for ; Wed, 12 Feb 2025 19:16:09 +0000 (UTC) Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by mx.groups.io with SMTP id smtpd.web11.24834.1739387768689906898 for ; Wed, 12 Feb 2025 11:16:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kQm95vMu; spf=pass (domain: gmail.com, ip: 209.85.128.169, mailfrom: danismostlikely@gmail.com) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-6f768e9be1aso10839257b3.0 for ; Wed, 12 Feb 2025 11:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739387767; x=1739992567; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d4DFGCwOMfH9PlmYA2RgMFQpYnDeP66eor2Ltpjb8ss=; b=kQm95vMu3wIsnOpEbc/NhSml8UL241BtOqNvU+UtoY2PaZrLyr2AMMBCnXpZT+UbpY D0l90Mrjv2YMmepZF8BH4WPKDPmfjiu8CPmZ7Qpeavz/eg9IzTWtgySk7FGSN2o0wdhX l4hiqI9e/hpk8GbMNC0ikO7023ybDZotTVZGbA26qAgHy76pX/M7hDWxQCQIGuoYR/5y Qtr7MsL5hpl+17yq4wJh/Y5QaqWH35d+yvFGdcDibt4Durni/v2EtCXkUaNMpxykQKTz UbvQlVDrt+s9QwUGocMlXYnSJNAIIdM3V0WnbyxvOh71Dqr+amt8sFslDmJE/bOKq24g wvmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739387768; x=1739992568; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d4DFGCwOMfH9PlmYA2RgMFQpYnDeP66eor2Ltpjb8ss=; b=dj8diqjMnjqV4Ef3y4LxOdih4L1qczIY36n749Rjwpw+7Zv9yBeZTpAPlPdpaN8FVc /9ySD4XrFxBpMHaIdTsmmRrhaV/NrGDPCuBvrluoBJ83O4Yw5kgXews7WSoo73No03/q TXra7fKLsgUpkFbJaCdFN1gooMYRKguHbs6e2ZtpJorkEi+Ec3/6zWpZVE/1RmQ8QdPI CtXJKZtOBlvZIMLOdpKvuRiK2ld3mlcMU8DrjNGbR7t/fQDHavJMvi8iaAlPMmK8ZnKG q3bOs6xKzcVKZc33mswYlX/7hUgUhn1fcaKx5i3u+OC7SJQlQzfQ4kmwqWHcfvyz2Kb8 GowQ== X-Gm-Message-State: AOJu0YzLdnIEIjaZICsUhY/TDikW8HcdJ7TSXBiiVISh2oQ+H/p6qv0K nsrMgsIh/YDwqtd19AgwS889G7lgnDZrHNAtVHwHEAULBNpuiTy4Wd/+Mw== X-Gm-Gg: ASbGncuyRTBXbIIYZ3CF0BPGi1XjVygQW6qG2e+T0j+kRX5tsGRXgybycoiHWjJVLfk 3tKuA6LXG1ywS3YyRfNWrdV20nYQiYVU+pA099XUYD8XrQw4ngmuFNLHL2HJn76Tk8DJvZl94OA UuYBref/PC4zYqbgCTNkt7kNZf6aXySU++2Mq22GKaBq7e9R16dkcY8HyAL8M321q0NuD2iKrAg rI1zytgQFiGsHZnJTCRtLdYSr76lr/a+ejpxyGvlbUpL87kw598Ro5P3Dgp3NOSogRPtyMXmP9m LYXnhFFWv0C6UqvjIsiBay5G6WdQkUjt14EB7FuL X-Google-Smtp-Source: AGHT+IHEqhgvt2YF9CmByfk/1HtaVXvUuP2BoVLJBpVGANgxfLqStj3ZAepZiyHH5zXu05Dn77O3xQ== X-Received: by 2002:a05:690c:2e13:b0:6f9:b027:1bfc with SMTP id 00721157ae682-6fb33c5a833mr2235507b3.3.1739387767434; Wed, 12 Feb 2025 11:16:07 -0800 (PST) Received: from nebuchadnezzar.home.arpa ([204.83.204.143]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f99fce16d1sm28115017b3.23.2025.02.12.11.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 11:16:06 -0800 (PST) From: Dan McGregor To: openembedded-core@lists.openembedded.org Cc: Daniel McGregor Subject: [PATCH 3/4] nfs-utils: Configure nfsv4 ID mapping & Kerberos Date: Wed, 12 Feb 2025 13:12:31 -0600 Message-ID: <20250212191518.1968329-3-danismostlikely@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250212191518.1968329-1-danismostlikely@gmail.com> References: <20250212191518.1968329-1-danismostlikely@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 12 Feb 2025 19:16:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/211275 From: Daniel McGregor Add support for the nfsv4 user ID mapping daemon, configured with a sensible default, and add a packageconfig for Kerberos support. This is reasonably tested in production in our environment, but only systemd support. There'll be some more work to do to get GSSAPI and NFS idmapd support integreated into that. Signed-off-by: Daniel McGregor --- ...ect-warning-options-during-configure.patch | 109 +++++++ ...-fix-undefined-function-for-libnsm.a.patch | 299 ------------------ .../0004-Use-nogroup-for-nobody-group.patch | 38 +++ .../0005-find-OE-provided-Kerberos.patch | 42 +++ .../nfs-utils/nfs-utils/clang-warnings.patch | 36 --- .../nfs-utils/nfs-utils_2.8.2.bb | 39 ++- 6 files changed, 219 insertions(+), 344 deletions(-) create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch delete mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch new file mode 100644 index 00000000000..69236e8278c --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Detect-warning-options-during-configure.patch @@ -0,0 +1,109 @@ +From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 31 Dec 2019 08:15:34 -0800 +Subject: [PATCH] Detect warning options during configure + +Certain options maybe compiler specific therefore its better +to detect them before use. + +nfs_error copies the format string and appends newline to it +but compiler can forget that it was format string since its not +same fmt string that was passed. Ignore the warning + +Wdiscarded-qualifiers is gcc specific and this is no longer needed + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- + support/nfs/xcommon.c | 6 ++++++ + support/nfs/xlog.c | 6 ++++++ + support/nfsidmap/libnfsidmap.c | 3 +++ + utils/exportfs/exportfs.c | 3 +++ + 4 files changed, 18 insertions(+) + +diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c +index 3989f0bc..ff438c18 100644 +--- a/support/nfs/xcommon.c ++++ b/support/nfs/xcommon.c +@@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) { + + fmt2 = xstrconcat2 (fmt, "\n"); + va_start (args, fmt); ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" + vfprintf (stderr, fmt2, args); ++#pragma GCC diagnostic pop + va_end (args); + free (fmt2); + } +@@ -132,7 +135,10 @@ die(int err, const char *fmt, ...) { + va_list args; + + va_start(args, fmt); ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" + vfprintf(stderr, fmt, args); ++#pragma GCC diagnostic pop + fprintf(stderr, "\n"); + va_end(args); + +diff --git a/support/nfs/xlog.c b/support/nfs/xlog.c +index fa125cef..dc4c9ea1 100644 +--- a/support/nfs/xlog.c ++++ b/support/nfs/xlog.c +@@ -178,11 +178,16 @@ xlog_backend(int kind, const char *fmt, va_list args) + fprintf(stderr, "%s: ", log_name); + #endif + va_copy(args2, args); ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" + vfprintf(stderr, fmt, args2); ++#pragma GCC diagnostic pop + fprintf(stderr, "\n"); + va_end(args2); + } + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" + if (log_syslog) { + switch (kind) { + case L_FATAL: +@@ -203,6 +208,7 @@ xlog_backend(int kind, const char *fmt, va_list args) + break; + } + } ++#pragma GCC diagnostic pop + + if (kind == L_FATAL) + exit(1); +diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c +index f8c36480..1a28be0a 100644 +--- a/support/nfsidmap/libnfsidmap.c ++++ b/support/nfsidmap/libnfsidmap.c +@@ -99,7 +99,10 @@ static void default_logger(const char *fmt, ...) + va_list vp; + + va_start(vp, fmt); ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" + vsyslog(LOG_WARNING, fmt, vp); ++#pragma GCC diagnostic pop + va_end(vp); + } + +diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c +index b03a047b..eac1ff2a 100644 +--- a/utils/exportfs/exportfs.c ++++ b/utils/exportfs/exportfs.c +@@ -646,7 +646,10 @@ dumpopt(char c, char *fmt, ...) + + va_start(ap, fmt); + printf("%c", c); ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" + vprintf(fmt, ap); ++#pragma GCC diagnostic pop + va_end(ap); + return ','; + } diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch deleted file mode 100644 index 7603eb680dc..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch +++ /dev/null @@ -1,299 +0,0 @@ -From 690a90a5b7786e40b5447ad7c5f19a7657d27405 Mon Sep 17 00:00:00 2001 -From: Mingli Yu -Date: Fri, 14 Dec 2018 17:44:32 +0800 -Subject: [PATCH] Makefile.am: fix undefined function for libnsm.a - -The source file of libnsm.a uses some function -in ../support/misc/file.c, add ../support/misc/file.c -to libnsm_a_SOURCES to fix build error when run -"make -C tests statdb_dump": -| ../support/nsm/libnsm.a(file.o): In function `nsm_make_pathname': -| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' -| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' -| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:175: undefined reference to `generic_make_pathname' -| ../support/nsm/libnsm.a(file.o): In function `nsm_setup_pathnames': -| /usr/src/debug/nfs-utils/2.3.3-r0/nfs-utils-2.3.3/support/nsm/file.c:280: undefined reference to `generic_setup_basedir' -| collect2: error: ld returned 1 exit status - -As there is already one source file named file.c -as support/nsm/file.c in support/nsm/Makefile.am, -so rename ../support/misc/file.c to ../support/misc/misc.c. - -Upstream-Status: Submitted [https://marc.info/?l=linux-nfs&m=154502780423058&w=2] - -Signed-off-by: Mingli Yu - -Rebase it. - -Signed-off-by: Robert Yang ---- - support/misc/Makefile.am | 2 +- - support/misc/file.c | 115 --------------------------------------------------------------------------------------------------------------- - support/misc/misc.c | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - support/nsm/Makefile.am | 2 +- - 4 files changed, 113 insertions(+), 117 deletions(-) - -diff --git a/support/misc/Makefile.am b/support/misc/Makefile.am -index f9993e3..8b0e9db 100644 ---- a/support/misc/Makefile.am -+++ b/support/misc/Makefile.am -@@ -1,7 +1,7 @@ - ## Process this file with automake to produce Makefile.in - - noinst_LIBRARIES = libmisc.a --libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c file.c \ -+libmisc_a_SOURCES = tcpwrapper.c from_local.c mountpoint.c misc.c \ - nfsd_path.c workqueue.c xstat.c - - MAINTAINERCLEANFILES = Makefile.in -diff --git a/support/misc/file.c b/support/misc/file.c -deleted file mode 100644 -index 06f6bb2..0000000 ---- a/support/misc/file.c -+++ /dev/null -@@ -1,115 +0,0 @@ --/* -- * Copyright 2009 Oracle. All rights reserved. -- * Copyright 2017 Red Hat, Inc. All rights reserved. -- * -- * This file is part of nfs-utils. -- * -- * nfs-utils is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * nfs-utils is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with nfs-utils. If not, see . -- */ -- --#ifdef HAVE_CONFIG_H --#include --#endif -- --#include -- --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "xlog.h" --#include "misc.h" -- --/* -- * Returns a dynamically allocated, '\0'-terminated buffer -- * containing an appropriate pathname, or NULL if an error -- * occurs. Caller must free the returned result with free(3). -- */ --__attribute__((__malloc__)) --char * --generic_make_pathname(const char *base, const char *leaf) --{ -- size_t size; -- char *path; -- int len; -- -- size = strlen(base) + strlen(leaf) + 2; -- if (size > PATH_MAX) -- return NULL; -- -- path = malloc(size); -- if (path == NULL) -- return NULL; -- -- len = snprintf(path, size, "%s/%s", base, leaf); -- if ((len < 0) || ((size_t)len >= size)) { -- free(path); -- return NULL; -- } -- -- return path; --} -- -- --/** -- * generic_setup_basedir - set up basedir -- * @progname: C string containing name of program, for error messages -- * @parentdir: C string containing pathname to on-disk state, or NULL -- * @base: character buffer to contain the basedir that is set up -- * @baselen: size of @base in bytes -- * -- * This runs before logging is set up, so error messages are directed -- * to stderr. -- * -- * Returns true and sets up our basedir, if @parentdir was valid -- * and usable; otherwise false is returned. -- */ --_Bool --generic_setup_basedir(const char *progname, const char *parentdir, char *base, -- const size_t baselen) --{ -- static char buf[PATH_MAX]; -- struct stat st; -- char *path; -- -- /* First: test length of name and whether it exists */ -- if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) { -- (void)fprintf(stderr, "%s: Directory name too long: %s", -- progname, parentdir); -- return false; -- } -- if (lstat(parentdir, &st) == -1) { -- (void)fprintf(stderr, "%s: Failed to stat %s: %s", -- progname, parentdir, strerror(errno)); -- return false; -- } -- -- /* Ensure we have a clean directory pathname */ -- strncpy(buf, parentdir, sizeof(buf)-1); -- path = dirname(buf); -- if (*path == '.') { -- (void)fprintf(stderr, "%s: Unusable directory %s", -- progname, parentdir); -- return false; -- } -- -- xlog(D_CALL, "Using %s as the state directory", parentdir); -- strcpy(base, parentdir); -- return true; --} -diff --git a/support/misc/misc.c b/support/misc/misc.c -new file mode 100644 -index 0000000..e7c3819 ---- /dev/null -+++ b/support/misc/misc.c -@@ -0,0 +1,111 @@ -+/* -+ * Copyright 2009 Oracle. All rights reserved. -+ * Copyright 2017 Red Hat, Inc. All rights reserved. -+ * -+ * This file is part of nfs-utils. -+ * -+ * nfs-utils is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * nfs-utils is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with nfs-utils. If not, see . -+ */ -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "xlog.h" -+#include "misc.h" -+ -+/* -+ * Returns a dynamically allocated, '\0'-terminated buffer -+ * containing an appropriate pathname, or NULL if an error -+ * occurs. Caller must free the returned result with free(3). -+ */ -+__attribute__((__malloc__)) -+char * -+generic_make_pathname(const char *base, const char *leaf) -+{ -+ size_t size; -+ char *path; -+ int len; -+ -+ size = strlen(base) + strlen(leaf) + 2; -+ if (size > PATH_MAX) -+ return NULL; -+ -+ path = malloc(size); -+ if (path == NULL) -+ return NULL; -+ -+ len = snprintf(path, size, "%s/%s", base, leaf); -+ if ((len < 0) || ((size_t)len >= size)) { -+ free(path); -+ return NULL; -+ } -+ -+ return path; -+} -+ -+ -+/** -+ * generic_setup_basedir - set up basedir -+ * @progname: C string containing name of program, for error messages -+ * @parentdir: C string containing pathname to on-disk state, or NULL -+ * @base: character buffer to contain the basedir that is set up -+ * @baselen: size of @base in bytes -+ * -+ * This runs before logging is set up, so error messages are directed -+ * to stderr. -+ * -+ * Returns true and sets up our basedir, if @parentdir was valid -+ * and usable; otherwise false is returned. -+ */ -+_Bool -+generic_setup_basedir(const char *progname, const char *parentdir, char *base, -+ const size_t baselen) -+{ -+ static char buf[PATH_MAX]; -+ struct stat st; -+ char *path; -+ -+ /* First: test length of name and whether it exists */ -+ if ((strlen(parentdir) >= baselen) || (strlen(parentdir) >= PATH_MAX)) { -+ (void)fprintf(stderr, "%s: Directory name too long: %s", -+ progname, parentdir); -+ return false; -+ } -+ if (lstat(parentdir, &st) == -1) { -+ (void)fprintf(stderr, "%s: Failed to stat %s: %s", -+ progname, parentdir, strerror(errno)); -+ return false; -+ } -+ -+ /* Ensure we have a clean directory pathname */ -+ strncpy(buf, parentdir, sizeof(buf)-1); -+ path = dirname(buf); -+ if (*path == '.') { -+ (void)fprintf(stderr, "%s: Unusable directory %s", -+ progname, parentdir); -+ return false; -+ } -+ -+ xlog(D_CALL, "Using %s as the state directory", parentdir); -+ strcpy(base, parentdir); -+ return true; -+} -diff --git a/support/nsm/Makefile.am b/support/nsm/Makefile.am -index 8f5874e..68f1a46 100644 ---- a/support/nsm/Makefile.am -+++ b/support/nsm/Makefile.am -@@ -10,7 +10,7 @@ GENFILES = $(GENFILES_CLNT) $(GENFILES_SVC) $(GENFILES_XDR) $(GENFILES_H) - EXTRA_DIST = sm_inter.x - - noinst_LIBRARIES = libnsm.a --libnsm_a_SOURCES = $(GENFILES) file.c rpc.c -+libnsm_a_SOURCES = $(GENFILES) ../misc/misc.c file.c rpc.c - - BUILT_SOURCES = $(GENFILES) - diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch new file mode 100644 index 00000000000..bbf44d59771 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0004-Use-nogroup-for-nobody-group.patch @@ -0,0 +1,38 @@ +From 001913c5eb0aad933a93ee966252905cd46d776b Mon Sep 17 00:00:00 2001 +From: Daniel McGregor +Date: Tue, 6 Jun 2023 16:07:53 -0600 +Subject: [PATCH] Use "nogroup" for nobody group + +Upstream-Status: Inappropriate [oe-core specific, configuration] +Signed-off-by: Daniel McGregor +--- + support/nfsidmap/idmapd.conf | 2 +- + utils/idmapd/idmapd.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/support/nfsidmap/idmapd.conf b/support/nfsidmap/idmapd.conf +index 2a2f79a1..e6f3724f 100644 +--- a/support/nfsidmap/idmapd.conf ++++ b/support/nfsidmap/idmapd.conf +@@ -41,7 +41,7 @@ + [Mapping] + + #Nobody-User = nobody +-#Nobody-Group = nobody ++#Nobody-Group = nogroup + + [Translation] + +diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c +index cd9a965f..3be805e9 100644 +--- a/utils/idmapd/idmapd.c ++++ b/utils/idmapd/idmapd.c +@@ -89,7 +89,7 @@ + #endif + + #ifndef NFS4NOBODY_GROUP +-#define NFS4NOBODY_GROUP "nobody" ++#define NFS4NOBODY_GROUP "nogroup" + #endif + + /* From Niels */ diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch new file mode 100644 index 00000000000..3241e8e8598 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0005-find-OE-provided-Kerberos.patch @@ -0,0 +1,42 @@ +From a2af266f013722a64c5d04e0fe097cd711393a53 Mon Sep 17 00:00:00 2001 +From: Daniel McGregor +Date: Wed, 8 Nov 2023 16:24:20 -0600 +Subject: [PATCH] find OE provided Kerberos + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Daniel McGregor +--- + aclocal/kerberos5.m4 | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4 +index f96f0fd4..ad85fdf2 100644 +--- a/aclocal/kerberos5.m4 ++++ b/aclocal/kerberos5.m4 +@@ -22,8 +22,8 @@ AC_DEFUN([AC_KERBEROS_V5],[ + dnl This ugly hack brought on by the split installation of + dnl MIT Kerberos on Fedora Core 1 + K5CONFIG="" +- if test -f $dir/bin/krb5-config; then +- K5CONFIG=$dir/bin/krb5-config ++ if test -f $dir/bin/crossscripts/krb5-config; then ++ K5CONFIG=$dir/bin/crossscripts/krb5-config + elif test -f "/usr/kerberos/bin/krb5-config"; then + K5CONFIG="/usr/kerberos/bin/krb5-config" + elif test -f "/usr/lib/mit/bin/krb5-config"; then +@@ -72,6 +72,7 @@ AC_DEFUN([AC_KERBEROS_V5],[ + AC_MSG_RESULT($KRBDIR) + + dnl Check if -rpath=$(KRBDIR)/lib is needed ++ if false; then + echo "The current KRBDIR is $KRBDIR" + if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \ + -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then +@@ -81,6 +82,7 @@ AC_DEFUN([AC_KERBEROS_V5],[ + else + KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib" + fi ++ fi + + dnl Now check for functions within gssapi library + AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch deleted file mode 100644 index fde99b599eb..00000000000 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/clang-warnings.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1ab0c326405c6daa06f1a7eb4b0b60bf4e0584c2 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 31 Dec 2019 08:15:34 -0800 -Subject: [PATCH] Detect warning options during configure - -Certain options maybe compiler specific therefore its better -to detect them before use. - -nfs_error copies the format string and appends newline to it -but compiler can forget that it was format string since its not -same fmt string that was passed. Ignore the warning - -Wdiscarded-qualifiers is gcc specific and this is no longer needed - -Upstream-Status: Pending -Signed-off-by: Khem Raj - ---- - support/nfs/xcommon.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/support/nfs/xcommon.c b/support/nfs/xcommon.c -index 3989f0b..e080423 100644 ---- a/support/nfs/xcommon.c -+++ b/support/nfs/xcommon.c -@@ -98,7 +98,10 @@ nfs_error (const char *fmt, ...) { - - fmt2 = xstrconcat2 (fmt, "\n"); - va_start (args, fmt); -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wformat-nonliteral" - vfprintf (stderr, fmt2, args); -+#pragma GCC diagnostic pop - va_end (args); - free (fmt2); - } diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb index f07ed2040ad..abbdec7808d 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.8.2.bb @@ -21,10 +21,11 @@ USERADD_PARAM:${PN}-client = "--system --home-dir /var/lib/nfs \ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \ file://nfsserver \ file://nfscommon \ - file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \ - file://clang-warnings.patch \ file://0001-locktest-Makefile.am-Do-not-use-build-flags.patch \ file://0001-Fix-typecast-warning-with-clang.patch \ + file://0001-Detect-warning-options-during-configure.patch \ + file://0004-Use-nogroup-for-nobody-group.patch \ + file://0005-find-OE-provided-Kerberos.patch \ " SRC_URI[sha256sum] = "a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15" @@ -49,9 +50,8 @@ EXTRA_OECONF = "--with-statduser=rpcuser \ --enable-mountconfig \ --enable-libmount-mount \ --enable-uuid \ - --disable-gss \ - --disable-nfsdcltrack \ --with-statdpath=/var/lib/nfs/statd \ + --with-pluginpath=${libdir}/libnfsidmap \ --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \ " @@ -60,13 +60,16 @@ LDFLAGS += "-lsqlite3 -levent" PACKAGECONFIG ??= "tcp-wrappers \ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} \ " + PACKAGECONFIG:remove:libc-musl = "tcp-wrappers" +#krb5 is available in meta-oe +PACKAGECONFIG[gssapi] = "--with-krb5=${STAGING_EXECPREFIXDIR} --enable-gss --enable-svcgss,--disable-gss --disable-svcgss,krb5" PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers" PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," # libdevmapper is available in meta-oe PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmapper" # keyutils is available in meta-oe -PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core" +PACKAGECONFIG[nfsv4] = "--enable-nfsv4 --enable-nfsdcltrack,--disable-nfsv4 --disable-nfsdcltrack,keyutils,python3-core" PACKAGECONFIG[nfsdctl] = "--enable-nfsdctl,--disable-nfsdctl,libnl readline," PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd" @@ -76,19 +79,34 @@ CONFFILES:${PN}-client += "${localstatedir}/lib/nfs/etab \ ${localstatedir}/lib/nfs/rmtab \ ${localstatedir}/lib/nfs/xtab \ ${localstatedir}/lib/nfs/statd/state \ + ${sysconfdir}/idmapd.conf \ ${sysconfdir}/nfs.conf \ ${sysconfdir}/nfsmount.conf" FILES:${PN}-client = "${sbindir}/*statd \ - ${libdir}/libnfsidmap.so.* \ ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ ${sbindir}/showmount ${sbindir}/nfsstat \ + ${sbindir}/rpc.gssd \ ${sbindir}/nfsconf \ + ${libdir}/libnfsidmap.so.* \ + ${libdir}/libnfsidmap/*.so \ + ${libexecdir}/nfsrahead \ ${localstatedir}/lib/nfs \ + ${sysconfdir}/idmapd.conf \ + ${sysconfdir}/init.d/nfscommon \ ${sysconfdir}/nfs.conf \ ${sysconfdir}/nfsmount.conf \ - ${sysconfdir}/init.d/nfscommon \ - ${systemd_system_unitdir}/nfs-statd.service" + ${systemd_system_unitdir}/auth-rpcgss-module.service \ + ${systemd_system_unitdir}/nfs-client.target \ + ${systemd_system_unitdir}/nfs-idmapd.service \ + ${systemd_system_unitdir}/nfs-statd.service \ + ${systemd_system_unitdir}/nfscommon.service \ + ${systemd_system_unitdir}/rpc-gssd.service \ + ${systemd_system_unitdir}/rpc-statd-notify.service \ + ${systemd_system_unitdir}/rpc-statd.service \ + ${systemd_system_unitdir}/rpc_pipefs.target \ + ${systemd_system_unitdir}/var-lib-nfs-rpc_pipefs.mount \ + ${nonarch_libdir}/udev/rules.d/*" RDEPENDS:${PN}-client = "${PN}-mount rpcbind" FILES:${PN}-mount = "${base_sbindir}/*mount.nfs*" @@ -105,7 +123,9 @@ FILES:${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/ ${nonarch_libdir}/modp do_configure:prepend() { sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ - ${S}/utils/mount/Makefile.am ${S}/utils/nfsdcltrack/Makefile.am + -e 's,udev_rulesdir = /usr/lib/udev/rules.d/,udev_rulesdir = ${nonarch_base_libdir}/udev/rules.d/,g' \ + ${S}/utils/mount/Makefile.am ${S}/utils/nfsdcltrack/Makefile.am \ + ${S}/systemd/Makefile.am ${S}/tools/nfsrahead/Makefile.am } # Make clean needed because the package comes with @@ -122,6 +142,7 @@ do_install:append () { install -m 0755 ${UNPACKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver install -m 0755 ${UNPACKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon + install -m 0644 ${S}/support/nfsidmap/idmapd.conf ${D}${sysconfdir} install -m 0644 ${S}/nfs.conf ${D}${sysconfdir} install -d ${D}${systemd_system_unitdir} From patchwork Wed Feb 12 19:12:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan McGregor X-Patchwork-Id: 57220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AB28C021A4 for ; Wed, 12 Feb 2025 19:16:19 +0000 (UTC) Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) by mx.groups.io with SMTP id smtpd.web11.24835.1739387769459817279 for ; Wed, 12 Feb 2025 11:16:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YKl1DFdx; spf=pass (domain: gmail.com, ip: 209.85.128.182, mailfrom: danismostlikely@gmail.com) Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-6f768e9be1aso10839347b3.0 for ; Wed, 12 Feb 2025 11:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739387768; x=1739992568; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QK87lUR352qam2EqRfSxcY6ffBd33DJNvnThS5DFW98=; b=YKl1DFdxpOhD5NhFmj5ggnoembQBqZT6pg+YeuAFbEciCBAlnznYWT4LDCDdoErL2y 1K3kssybQojHxB5JlwbUEAZiuNc7wXPUOV4DJ+RuH7pow8tEnv9y5aA0RDZ3U9bCSGDN sYxf6M1EqZ8naYNZB6lTYE8ZwBQdhbiFil29hX2tWz+dEDdrv9BhNdkwblukPk8ZvBNA iTG0u1egc51+iOvScNQlhUBs5HIfr/gnNSrXLmYEDNgZkO64+VuT9C2uFKz6pJ5PNe3Z RsmS8i0OyOBvT4+Nq6CjOTtfLSzq9HUF1rVKHL6BsvncZkkm8i6Wc7hcekvs9RZ/2epX JPxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739387768; x=1739992568; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QK87lUR352qam2EqRfSxcY6ffBd33DJNvnThS5DFW98=; b=gEh6I+2ssI1ciBxFrJZ8CKcLJzr3vher0MDp94/yKqjkv4C3F+vIzNuWDottKfGNA2 42UaDZ67fShxfGSsaS8vCHwkwyOn1hpqkaTdqZ3qtI9oufAlsCjtHzSnMGIms/mkX8mp ZOdAl0SyXwnJb0e8eehkWes55vZI471KEgQfNs6+3hvpukqXbE7jl87zF3jpH1zrCRYu J5wXI0YB6z2i0sFeejD1qNwMk25dMmJTjpaXB6KTEKvBNsGLZimYiJIiozGNQNWMOwD6 /3OQT32LGBMaSqx6vKZKN+aZPY6J79okFWgh27SA8g0KKe9XycXnmhBobSJZTr9SuzMS +ZcA== X-Gm-Message-State: AOJu0Yz6HZWjkdNYKcvOC9Cj5LKxFgjY+Klr8SxcXJGtOjBDqI7KZq4T kvNxja/bKKeXqcH3aNzqEksLbj3g1rFw/Vuj0jdja07PuT90RDmvnKBXUQ== X-Gm-Gg: ASbGncunm+EXNTD/b7QD1TsTzZUjt+0c1xsDtXAqmJwHD/8tnE16hcs+evaEbNmfuon uNMzF6qUcsnySnefH3fYIh5BkDVBjOswDzQVbrVsvzXFV45jsX8KgrDgdioXFcD2mqZa7isqHLU 0J8gXWRRGGjsWsI2yz+iXu4VDxruSsJ/avXPcoU5WhL6sI/rvp8IJaJTG9iKqTR/HiULCbap3KC vkGlL0jQERiYbEy9oj0xYsmo6EVFByMdkFxicU1QI450SiD2d1FH4CLW94+iTGFJfUSYp8rD5Gf JPpTKZ/fQ+e+2VHzGWLSTdWIdv+cHaEUCh0ED9Ec X-Google-Smtp-Source: AGHT+IHsnO92prgvx4kPdoqdo65IV4zvte5kKXO4b6UKs/hlDJAGadpKxcJgtMsyhrtsQyvYuMYlMQ== X-Received: by 2002:a05:690c:2a45:b0:6f9:5a36:577d with SMTP id 00721157ae682-6fb33c9fac9mr1508357b3.9.1739387768372; Wed, 12 Feb 2025 11:16:08 -0800 (PST) Received: from nebuchadnezzar.home.arpa ([204.83.204.143]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f99fce16d1sm28115017b3.23.2025.02.12.11.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 11:16:07 -0800 (PST) From: Dan McGregor To: openembedded-core@lists.openembedded.org Cc: Daniel McGregor Subject: [PATCH 4/4] nfs-utils: Start nfsv4 utilities with sysvinit Date: Wed, 12 Feb 2025 13:12:32 -0600 Message-ID: <20250212191518.1968329-4-danismostlikely@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250212191518.1968329-1-danismostlikely@gmail.com> References: <20250212191518.1968329-1-danismostlikely@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 12 Feb 2025 19:16:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/211276 From: Daniel McGregor Rewrite the nfs sysvinit scripts to start the services required by nfsv4: gssd, idmapd, and statd. Signed-off-by: Daniel McGregor --- .../nfs-utils/nfs-utils/nfscommon | 294 +++++++++++++++--- .../nfs-utils/nfs-utils/nfsserver | 43 ++- 2 files changed, 289 insertions(+), 48 deletions(-) diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon index 4f07324a21f..6c7b92bdb1b 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon @@ -1,63 +1,279 @@ #!/bin/sh + ### BEGIN INIT INFO # Provides: nfs-common # Required-Start: $portmap $time # Required-Stop: $portmap $time # Default-Start: S # Default-Stop: 0 1 6 -# Short-Description: NFS support for both client and server +# Short-Description: NFS support files common to client and server # Description: NFS is a popular protocol for file sharing across -# TCP/IP networks. This service provides various +# TCP/IP networks. This service provides various # support functions for NFS mounts. ### END INIT INFO -# -# Startup script for nfs-utils -# -# -# Location of executables: -# Source function library. +# What is this? +DESC="NFS common utilities" + +# Read config +DEFAULTFILE=/etc/default/nfs-utils +NEED_STATD= +NEED_GSSD= +if nfsconf --isset general pipefs-directory; then + PIPEFS_MOUNTPOINT=$(nfsconf --get general pipefs-directory) +else + PIPEFS_MOUNTPOINT=/var/lib/nfs/rpc_pipefs +fi +if [ -f $DEFAULTFILE ]; then + . $DEFAULTFILE +fi + . /etc/init.d/functions -test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd -test -z "$STATD_PID" && STATD_PID=/run/rpc.statd.pid +# Exit if required binaries are missing. +[ -x /usr/sbin/rpc.statd ] || exit 0 + # -# The default state directory is /var/lib/nfs -test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs +# Parse the fstab file, and determine whether we need gssd. (The +# /etc/defaults settings, if any, will override our autodetection.) This code +# is partially adapted from the mountnfs.sh script in the sysvinit package. # -#---------------------------------------------------------------------- -# Startup and shutdown functions. -# Actual startup/shutdown is at the end of this file. - -start_statd(){ - echo -n "starting statd: " - start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID" - echo done +AUTO_NEED_GSSD=no + +if [ -f /etc/fstab ]; then + exec 9<&0 /dev/null 2>&1 + RET=$? + if [ $RET != 0 ]; then + echo + echo "Not starting: portmapper is not running" + exit 0 + fi + fi + start-stop-daemon --start --oknodo --quiet \ + --pidfile /run/rpc.statd.pid \ + --exec /sbin/rpc.statd + RET=$? + if [ $RET != 0 ]; then + echo " failed" $RET + exit $RET + else + if [ -d /run/sendsigs.omit.d ]; then + rm -f /run/sendsigs.omit.d/statd + ln -s /run/rpc.statd.pid /run/sendsigs.omit.d/statd + fi + fi + fi + + # Don't start idmapd and gssd if we don't have them (say, if /usr is not + # up yet). + [ -x /usr/sbin/rpc.idmapd ] || NEED_IDMAPD=no + [ -x /usr/sbin/rpc.gssd ] || NEED_GSSD=no + + if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ] + then + do_modprobe sunrpc + do_modprobe nfs + do_modprobe nfsd + mkdir -p "$PIPEFS_MOUNTPOINT" + if do_mount rpc_pipefs $PIPEFS_MOUNTPOINT + then + if [ "$NEED_IDMAPD" = yes ] + then + ecno -n " idmapd" + start-stop-daemon --start --oknodo --quiet \ + --exec /usr/sbin/rpc.idmapd + RET=$? + if [ $RET != 0 ]; then + echo " failed" $RET + exit $RET + fi + fi + if [ "$NEED_GSSD" = yes ] + then + do_modprobe rpcsec_gss_krb5 + echo -n " gssd" + + start-stop-daemon --start --oknodo --quiet \ + --exec /usr/sbin/rpc.gssd + RET=$? + if [ $RET != 0 ]; then + echo " failed" $RET + exit $RET + fi + fi + fi + fi + echo " done" + ;; + stop) - stop_statd;; + echo -n "Stopping $DESC ..." + + if [ "$NEED_GSSD" = yes ] + then + echo -n " gssd" + start-stop-daemon --stop --oknodo --quiet \ + --name rpc.gssd + RET=$? + if [ $RET != 0 ]; then + echo " failed" $RET + exit $RET + fi + fi + if [ "$NEED_IDMAPD" = yes ] + then + echo -n " idmapd" + start-stop-daemon --stop --oknodo --quiet \ + --name rpc.idmapd + RET=$? + if [ $RET != 0 ]; then + echo " failed" $RET + exit $RET + fi + fi + if [ "$NEED_STATD" = yes ] + then + echo -n " statd" + start-stop-daemon --stop --oknodo --quiet \ + --name rpc.statd + RET=$? + if [ $RET != 0 ]; then + echo " failed" $RET + exit $RET + fi + fi + do_umount $PIPEFS_MOUNTPOINT 2>/dev/null || true + echo " done" + ;; + status) - status $NFS_STATD - exit $?;; - restart) + if [ "$NEED_STATD" = yes ] + then + if ! pidof rpc.statd >/dev/null + then + echo "rpc.statd not running" + exit 3 + fi + fi + + if [ "$NEED_GSSD" = yes ] + then + if ! pidof rpc.gssd >/dev/null + then + echo "rpc.gssd not running" + exit 3 + fi + fi + + if [ "$NEED_IDMAPD" = yes ] + then + if ! pidof rpc.idmapd >/dev/null + then + echo "rpc.idmapd not running" + exit 3 + fi + fi + + echo "all daemons running" + exit 0 + ;; + + restart | force-reload) $0 stop - $0 start;; + sleep 1 + $0 start + ;; + *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1;; + echo "Usage: nfscommon {start|stop|status|restart}" + exit 1 + ;; esac + +exit 0 diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver index 0f5747cc6db..cb6c1b4d08d 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver @@ -1,8 +1,10 @@ #!/bin/sh + ### BEGIN INIT INFO # Provides: nfs-kernel-server -# Required-Start: $remote_fs nfs-common $portmap hwclock -# Required-Stop: $remote_fs nfs-common $portmap hwclock +# Required-Start: $remote_fs nfs-common $portmap $time +# Required-Stop: $remote_fs nfs-common $portmap $time +# Should-Start: $named # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Kernel NFS server support @@ -19,20 +21,25 @@ # # The environment variable NFS_SERVERS may be set in /etc/default/nfsd # Other control variables may be overridden here too -test -r /etc/default/nfsd && . /etc/default/nfsd +test -r /etc/default/nfs-utils && . /etc/default/nfs-utils # # Location of executables: test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd +test -x "$NFS_SVCGSSD" || NFS_SVCGSSD=/usr/sbin/rpc.svcgssd # # The user mode program must also exist (it just starts the kernel # threads using the kernel module code). test -x "$NFS_MOUNTD" || exit 0 test -x "$NFS_NFSD" || exit 0 -# -# Default is 8 threads, value is settable between 1 and the truely -# ridiculous 99 -test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 + +case "$NEED_SVCGSSD" in + yes|no) + ;; + *) + NEED_SVCGSSD=no + ;; +esac # #---------------------------------------------------------------------- # Startup and shutdown functions. @@ -49,6 +56,22 @@ stop_mountd(){ echo done } # +#svcgssd +start_svcgssd(){ + modprobe -q rpcsec_gss_krb5 + if [ "$NEED_SVCGSSD" = "yes" ]; then + echo -n "starting svcgssd: " + start-stop-daemon --start --exec "$NFS_SVCGSSD" -- "$@" + echo done + fi +} +stop_svcgssd(){ + if [ "$NEED_SVCGSSD" = "yes" ]; then + echo -n "stop svcgssd: " + start-stop-daemon --stop --exec "$NFS_SVCGSSD" + echo done + fi +} #nfsd start_nfsd(){ modprobe -q nfsd @@ -62,7 +85,7 @@ start_nfsd(){ exit 1 } - echo -n "starting $1 nfsd kernel threads: " + echo -n "starting nfsd: " start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" echo done } @@ -108,11 +131,13 @@ stop_nfsd(){ case "$1" in start) test -r /etc/exports && exportfs -r - start_nfsd "$NFS_SERVERS" + start_nfsd + start_svcgssd start_mountd test -r /etc/exports && exportfs -a;; stop) exportfs -ua stop_mountd + stop_svcgssd stop_nfsd;; status) status /usr/sbin/rpc.mountd