From patchwork Thu Sep 17 12:24:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 518819 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C9BB114017E for ; Thu, 17 Sep 2015 22:24:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=wk7+GgnR; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E4D7A28B43B; Thu, 17 Sep 2015 14:23:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BE32A28A5E2 for ; Thu, 17 Sep 2015 14:23:30 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 17 Sep 2015 14:23:30 +0200 (CEST) Received: by wicgb1 with SMTP id gb1so115522936wic.1 for ; Thu, 17 Sep 2015 05:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=oX0U+C+6iwgOl1BG6vlG02e/47bd3j1QM8j7Cza8nCs=; b=wk7+GgnRlEwGyNM0Gn8psUUvhPmJff7OHU6YyNQVInh9N9gnTYsdi0G0S1qh3eBYSg EE4JDLuHMHH/onrdESPTS7KpZd4SrnIQwWy4qBWjZ5iWNoDgi4IpMgJ4oOYvY/N7AORN m6AcuTkFuS9X/ZSo8PyHqUjaTOS1aATbRBXlWzshI3BoXDu8QLPIvUowBZaY2LTGYrtQ LQ83O5V6YUdTI4R3eGhy6gVbZhPvG7qgQHR6hcXJ5fCMQgSaqAyAuoMxYltaTL9x+q7A QazZrc+hATXwFVtIa9kB7eo03vON/dzyL7MXOUf2ZXXSnwpbU/aYVmo/MLtZCCLrZC1U tRlA== X-Received: by 10.180.23.194 with SMTP id o2mr16648794wif.48.1442492681203; Thu, 17 Sep 2015 05:24:41 -0700 (PDT) Received: from hschaa-desktop.site (HSI-KBW-217-008-059-040.hsi.kabelbw.de. [217.8.59.40]) by smtp.gmail.com with ESMTPSA id jq10sm3140057wjc.40.2015.09.17.05.24.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 05:24:40 -0700 (PDT) From: Helmut Schaa To: openwrt-devel@lists.openwrt.org Date: Thu, 17 Sep 2015 14:24:16 +0200 Message-Id: <1442492656-19792-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.8.4.5 Subject: [OpenWrt-Devel] [PATCH] base-files: fix ramoverlay function with kernels 3.18+ X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Even though there are not many users left within the OpenWrt tree it seems this function broke during the kernel 3.18 transition. Fix it by providing a workdir as required by overlayfs. Signed-off-by: Helmut Schaa --- package/base-files/files/lib/functions/preinit.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/lib/functions/preinit.sh b/package/base-files/files/lib/functions/preinit.sh index db1f298..57862a1 100644 --- a/package/base-files/files/lib/functions/preinit.sh +++ b/package/base-files/files/lib/functions/preinit.sh @@ -75,13 +75,14 @@ pivot() { # } } -fopivot() { # - /bin/mount -o noatime,lowerdir=/,upperdir=$1 -t overlayfs "overlayfs:$1" /mnt - pivot /mnt $2 +fopivot() { # + /bin/mount -o noatime,lowerdir=/,upperdir=$1,workdir=$2 -t overlay "overlayfs:$1" /mnt + pivot /mnt $3 } ramoverlay() { mkdir -p /tmp/root /bin/mount -t tmpfs -o noatime,mode=0755 root /tmp/root - fopivot /tmp/root /rom 1 + mkdir -p /tmp/root/root /tmp/root/work + fopivot /tmp/root/root /tmp/root/work /rom 1 }