From patchwork Fri May 18 14:07:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Lebleu X-Patchwork-Id: 916388 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tu60XL7A"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VsjwgHpm"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40nVPr0QkFz9s29 for ; Sat, 19 May 2018 00:08:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SiRKw4NvfgQgwiLQUndkPQ/yN5pjSbgZ9ZKlPlsO3OE=; b=tu60XL7A8UTWDM KEkwpvNKWD7rlnvxblkZBNeaOvRNuMDV/IU5IuE7NkyH4TRDD4nXxjmAh7gubbdpIutj78VRm5gHV NeCRS6BB80fjFqJ531McbR2chHM7YA3aow+4St5jnuQ6pEad59RR8VAoPyoDL5mO+qe0Ct/EUAFAW QT4JcJEdQgGO+DbbSiyIcgRm+RaglD0tKhVXg6DIlY9BxCpIjtYvbTCM44PNEPQqItbSoouE/s8t0 c1R9pnaMt9JKPhOya2N2MRCrTlXyH+tuYndGtesbddxoTOuMsTgTsfVdPcWPIDTFQLU25JIP6o3jN 2Q/PgfqH9+ot5R70RrEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJg3K-0007ng-Dr; Fri, 18 May 2018 14:08:14 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJg37-0007cV-R7 for openwrt-devel@lists.openwrt.org; Fri, 18 May 2018 14:08:05 +0000 Received: by mail-wr0-x243.google.com with SMTP id y15-v6so9340309wrg.11 for ; Fri, 18 May 2018 07:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2apNMg1qTm1tLtuNiRHSSFA1paabx/dR8osGeNlzBDo=; b=VsjwgHpmwcKNPN/JfMoBnEB4NxIUSncYyuhEcqlArEbJdVVvhxsOt968NW6x9sNKHm 13zSp4AcsTP2KJuaXk1/1h7/GSt5C/ubaBfw13v7HX2mTyF0LOn9T052muV0MfCexX06 61zkIdcKfq6xO7bJcuUIFyZ3SzVlHrFjeKNeYF8WZe3Jilks8xBXb7gWqlubGVJ5qADb seOuJvbmZ+VCoxlZhnHhIKvNT4tNrbs+AZUVu8yuxMCDwghF+MDCBKEHYf4t92Dzico8 yeSUzvxzGL1MAPfYB1ax+asP2AEWtHpoqTBdoFku3rRwWuudC3X+MKDFXgtoYqBDwEhz TG+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2apNMg1qTm1tLtuNiRHSSFA1paabx/dR8osGeNlzBDo=; b=G0uKOVQihDLzOLO24xzk558SWeHhdcrIrku1qKk9Q41iFmG0nXo4V1Ic5QZRPQ18Nf oYFmje47HG8SSWveRBBkRniPd1NZE2GGMj0QhZrCLDrkq+Kyh5evuAMk0D9JhZioNHOa K+HagPS2lJooLa8KIoOadx4fAdok+W6hoaEcfD1QQ5UAllOmr1FGYV5ziq5SpW1Bq46u qGJ+cxtxAkroh89v5hrq2XCfqaMPV3V7rBiQcd7kdiFTm7xMpGhpz/SkyVkAoPHedJ06 5bian2p8cG9uK8EHzk5Ve5lxJC52ZPS2eMdiZFg/f2rtN+dOoLFjGFtFVwfDh6POzshd AUCg== X-Gm-Message-State: ALKqPwdkBC9tB951PE3ZbGdvnXtIt4GLsSi+KbQ2a962kD0stXCDqziV ix5q7r99lvQu7fWcsWKMUiuAZg== X-Google-Smtp-Source: AB8JxZrEyjzMWC3oXuH/r3s2pGINnZXq1XAYKme0JhCF8LoIkI9Rh8bPaGw1XwV7Bso9YuFjvfZGLw== X-Received: by 2002:adf:e287:: with SMTP id v7-v6mr7311569wri.54.1526652466357; Fri, 18 May 2018 07:07:46 -0700 (PDT) Received: from localhost (14.125.146.82.ipv4.evonet.be. [82.146.125.14]) by smtp.gmail.com with ESMTPSA id f6-v6sm8180386wrj.66.2018.05.18.07.07.45 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 18 May 2018 07:07:45 -0700 (PDT) From: Pierre Lebleu To: openwrt-devel@lists.openwrt.org Date: Fri, 18 May 2018 16:07:42 +0200 Message-Id: <1526652463-27784-1-git-send-email-pme.lebleu@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180518_070801_873555_09006AB4 X-CRM114-Status: GOOD ( 10.17 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c0c:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pme.lebleu[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [OpenWrt-Devel] [PATCH 1/2] fstools: allow to customize the mount option for the overlay X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pierre Lebleu , John Crispin MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In order to give some extra options (specific to the filesystem used), a new CMake option (eg: CMAKE_OVL_MOUNT_OPTION) has been added. Example: cmake -DCMAKE_OVL_MOUNT_OPTION="compr=zlib" Signed-off-by: Pierre Lebleu --- CMakeLists.txt | 6 ++++++ libfstools/overlay.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e855bd..484d716 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,12 @@ INSTALL(FILES libubi/libubi-tiny.h libubi/libubi.h libubi/ubi-media.h DESTINATION include ) +IF(DEFINED CMAKE_OVL_MOUNT_OPTION) + ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=${CMAKE_OVL_MOUNT_OPTION}) +ELSE(DEFINED CMAKE_OVL_MOUNT_OPTION) + ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=NULL) +ENDIF(DEFINED CMAKE_OVL_MOUNT_OPTION) + ADD_EXECUTABLE(mount_root mount_root.c) TARGET_LINK_LIBRARIES(mount_root fstools) INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin) diff --git a/libfstools/overlay.c b/libfstools/overlay.c index ebc43f7..5d5a985 100644 --- a/libfstools/overlay.c +++ b/libfstools/overlay.c @@ -341,7 +341,7 @@ static int overlay_mount_fs(struct volume *v) return -1; } - if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, NULL)) { + if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, OVL_MOUNT_OPTION)) { ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n", fstype, v->blk); return -1; From patchwork Fri May 18 14:07:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Lebleu X-Patchwork-Id: 916387 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aAR2byHI"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nDxYY2DO"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40nVPg5wYnz9s33 for ; Sat, 19 May 2018 00:08:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MjeaGDZAnilDkO+OI2iMLjrhN4e0Ih4FcEFXMXypJiU=; b=aAR2byHIV8KQqD IX+8rAyxHHVFZ98IpwMGAscQ0wuk8ERZr6FyyU+KOYP+WJTPJNPxPe6HRDPwc2vsNV4Q2xhlmTtCR Pa7Qq4rMtJJRANTKE3n8De7SdgkpQDHwjJz+DljYlWf+LbsHYzkVlOO94dtfe1KXPEjVHQe2r9ksd xkx5aKpPqGHJ2e9G/3lv910LtJDT2m0+1ViFfDcLlyrJwqyOOycI5aVr+3EZ6bejt2VtE0ab4gbHx J63Cb4F8MXk14qePhG5qKJc2MBxtOf99VOxeez76xy2Q0kQFNv9ecr4yUR25M6GZgHhhPuv1FE9WO k7RtCg3MOXxj76nnfL1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJg3B-0007eW-C1; Fri, 18 May 2018 14:08:05 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJg36-0007cZ-La for openwrt-devel@lists.openwrt.org; Fri, 18 May 2018 14:08:03 +0000 Received: by mail-wm0-x243.google.com with SMTP id w194-v6so14284947wmf.2 for ; Fri, 18 May 2018 07:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0m10+G1eTwy7Lcv5J4SGcWLxgnLtYOgFukYV+PkPXDY=; b=nDxYY2DOrx/+awyGGlZbr+TZkaybGU3iimEYhqxi5wvEYVKphWvRn2N9GBE7CtsR3V 0yySJfoKLBbUYYaY6OfOWZrFDrJKB/OeOCCeKBZDFzbaJ3Gh1r3RjWIHNDSDdA7vNpjD Ahmc2jEgH84MAEjOeylm3mMyCHzf40gjuY6GzIF+Dg+EXzbcQljO5cRBTCkkfaPfYJqW RMDwSXuaT3yvf/JauECbGuuYDJhsofWX/D9q8HfhA+SXKMF8z7nlE/rukdZbzg8srDlc ScXd2mUM/uT3ybmZT5yOtdm11Uw3vLLIn+0DOA6J3onVbDACpVrke1piCfMQxcJKhk53 oUSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0m10+G1eTwy7Lcv5J4SGcWLxgnLtYOgFukYV+PkPXDY=; b=jkjBF03YEEZdKg/mLMk+rRlaknWT3YxO0uBj91P9prQjSp8DSyeKkX35HukfDz6NAg fXTw9WT7x0QZtNyMVG3eX2AJ4/xI8pGz95ZSvqrwqRIKSQcqhCwe4yf9sTwxlyC2YNvy kjfjca8y+pTBpHMjOpy12/3COsIY6cmXnete+HLKzavSozdVr4S0dRCIIHXkSy/sjdo/ ATfcGNUbBDejjbYju+BB9WBQNWVqXPr6UXNSfGjSmRjWUuIr0JaLs4uma0PjkpZaqJtP mgXVD6mqLtKeubCc9KsgUZHvGuo7NHXOzP1zGvYVH3Tp6MVtMB8TZ4L9QGkxdU800Zjg IGDg== X-Gm-Message-State: ALKqPwcZThfoGGnQjOLELhicBznqBuQzJf5YMRJM+p45yVgMZR0EVA3n 0cr5gnCAlek6K0LUyHFJ4svl/A== X-Google-Smtp-Source: AB8JxZr7xD6WBdB1ic6Ukrsgj8FXLnbasnq4Arx5a00kNJfIowyJCb6QkpwXtVoyQujBBdpciAHkrA== X-Received: by 2002:a1c:d046:: with SMTP id h67-v6mr4576028wmg.80.1526652467521; Fri, 18 May 2018 07:07:47 -0700 (PDT) Received: from localhost (14.125.146.82.ipv4.evonet.be. [82.146.125.14]) by smtp.gmail.com with ESMTPSA id 69-v6sm12270375wmi.29.2018.05.18.07.07.46 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 18 May 2018 07:07:46 -0700 (PDT) From: Pierre Lebleu To: openwrt-devel@lists.openwrt.org Date: Fri, 18 May 2018 16:07:43 +0200 Message-Id: <1526652463-27784-2-git-send-email-pme.lebleu@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1526652463-27784-1-git-send-email-pme.lebleu@gmail.com> References: <1526652463-27784-1-git-send-email-pme.lebleu@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180518_070800_730404_6489B58D X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pme.lebleu[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [OpenWrt-Devel] [PATCH 2/2] fstools: allow to customize the mount flags for the overlay X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pierre Lebleu , John Crispin MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In order to customize the mount flags, a new CMake option (eg: CMAKE_OVL_MOUNT_FLAGS) has been added. Example: cmake -DCMAKE_OVL_MOUNT_FLAGS="MS_RELATIME" Signed-off-by: Pierre Lebleu --- CMakeLists.txt | 6 ++++++ libfstools/overlay.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 484d716..4e8b502 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,12 @@ ELSE(DEFINED CMAKE_OVL_MOUNT_OPTION) ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=NULL) ENDIF(DEFINED CMAKE_OVL_MOUNT_OPTION) +IF(DEFINED CMAKE_OVL_MOUNT_FLAGS) + ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=${CMAKE_OVL_MOUNT_FLAGS}) +ELSE(DEFINED CMAKE_OVL_MOUNT_FLAGS) + ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=MS_NOATIME) +ENDIF(DEFINED CMAKE_OVL_MOUNT_FLAGS) + ADD_EXECUTABLE(mount_root mount_root.c) TARGET_LINK_LIBRARIES(mount_root fstools) INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin) diff --git a/libfstools/overlay.c b/libfstools/overlay.c index 5d5a985..b201679 100644 --- a/libfstools/overlay.c +++ b/libfstools/overlay.c @@ -341,7 +341,7 @@ static int overlay_mount_fs(struct volume *v) return -1; } - if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, OVL_MOUNT_OPTION)) { + if (mount(v->blk, "/tmp/overlay", fstype, OVL_MOUNT_FLAGS, OVL_MOUNT_OPTION)) { ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n", fstype, v->blk); return -1;