From patchwork Sat Jul 11 14:48:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Hadjinlian X-Patchwork-Id: 494016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 532841402C3 for ; Sun, 12 Jul 2015 00:48:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=OU+hqYuR; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 67E4A32EDE; Sat, 11 Jul 2015 14:48:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0xXaHtPXzs-Y; Sat, 11 Jul 2015 14:48:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 76A3032ECF; Sat, 11 Jul 2015 14:48:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id C96901C0FE9 for ; Sat, 11 Jul 2015 14:48:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BC23732EC0 for ; Sat, 11 Jul 2015 14:48:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ymCpMeE0q-Sn for ; Sat, 11 Jul 2015 14:48:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by silver.osuosl.org (Postfix) with ESMTPS id 58A0F32E73 for ; Sat, 11 Jul 2015 14:48:29 +0000 (UTC) Received: by wicmv11 with SMTP id mv11so32421904wic.1 for ; Sat, 11 Jul 2015 07:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XVyCcuf8PoOlln+7gepB4i4UTO6eInYWaMmYEN4jqh0=; b=OU+hqYuRXfm5NLH+mdL7y6bYmN4+V+uZdeehIoS9Imo1Omn2rQRaKIV/Thyx+HEuXh kpJbZt3MoSKKnwsc7FrF5DwiWr0bBBKJ6pT1kcmUefYJ0oyL8BEnJR+MXkc3DLstOucy QQUZGCZ//OnFl7CCoAg8H39xW8BEUfrz0gnKeom6Is3pFq6oU376d+rEy1xDcH8C1g+v EHw1P8aUwGqje3U0w8G/0cLL/odHNIrwCxy4Bl7fmjEaobVvnZMHmv73IkZdptY7AozF CFt3Umk1SKyrXQKyMDrgSQvO18ycWQG7Knlo2v+c5f76PHzU8MapBgQy1SyvgoyxkfHy Lp0Q== X-Received: by 10.194.109.36 with SMTP id hp4mr52888905wjb.4.1436626107880; Sat, 11 Jul 2015 07:48:27 -0700 (PDT) Received: from cerise.home (AToulouse-657-1-1031-128.w92-134.abo.wanadoo.fr. [92.134.9.128]) by smtp.gmail.com with ESMTPSA id qq1sm18455266wjc.0.2015.07.11.07.48.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 Jul 2015 07:48:27 -0700 (PDT) From: Maxime Hadjinlian To: buildroot@buildroot.org Date: Sat, 11 Jul 2015 16:48:20 +0200 Message-Id: <1436626101-3598-2-git-send-email-maxime.hadjinlian@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436626101-3598-1-git-send-email-maxime.hadjinlian@gmail.com> References: <1436626101-3598-1-git-send-email-maxime.hadjinlian@gmail.com> Subject: [Buildroot] [PATCH 2/3] nfs_utils: Fix for read-only rootfs X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to work on a read-only rootfs, nfs_utils would like to write stuff to /var/lib/nfs, since it's not a tmpfs, it won't work. Instead of doing little dances around the filesystem, tell nfs_utils to use /run/nfs for everyone. Modify the startup script accordingly. Signed-off-by: Maxime Hadjinlian --- package/nfs-utils/S60nfs | 14 ++------------ package/nfs-utils/nfs-utils.mk | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/package/nfs-utils/S60nfs b/package/nfs-utils/S60nfs index 4afee55..91410ee 100755 --- a/package/nfs-utils/S60nfs +++ b/package/nfs-utils/S60nfs @@ -8,19 +8,9 @@ [ -x /usr/sbin/rpc.mountd ] || exit 0 [ -x /usr/sbin/exportfs ] || exit 0 -# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue. -[ -r /etc/exports ] || \ - { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \ - { echo "/etc/exports does not exist" ; exit 0 ; } - -# The /var/lib/nfs directory is actually on a tmpfs filesystem. -mkdir -p /var/lib/nfs/sm -mkdir -p /var/lib/nfs/sm.bak mkdir -p /var/lock/subsys -touch /var/lib/nfs/etab -touch /var/lib/nfs/rmtab -touch /var/lib/nfs/state -touch /var/lib/nfs/xtab +mkdir -p /run/nfs/sm +touch /run/nfs/rmtab start() { # Start daemons. diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk index cec21e8..115a133 100644 --- a/package/nfs-utils/nfs-utils.mk +++ b/package/nfs-utils/nfs-utils.mk @@ -21,6 +21,7 @@ NFS_UTILS_CONF_OPTS = \ --disable-uuid \ --disable-ipv6 \ --without-tcp-wrappers \ + --with-statedir=/run/nfs \ --with-rpcgen=internal NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPCDEBUG) += usr/sbin/rpcdebug @@ -36,8 +37,8 @@ endif define NFS_UTILS_INSTALL_FIXUP rm -f $(NFS_UTILS_TARGETS_) + touch $(TARGET_DIR)/etc/exports endef - NFS_UTILS_POST_INSTALL_TARGET_HOOKS += NFS_UTILS_INSTALL_FIXUP define NFS_UTILS_INSTALL_INIT_SYSV