From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A23C11382C5 for ; Fri, 15 May 2020 06:37:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E18A7E0BFF; Fri, 15 May 2020 06:37:45 +0000 (UTC) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D9F3BE0BFF for ; Fri, 15 May 2020 06:37:45 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id 23so511559pfy.8 for ; Thu, 14 May 2020 23:37:45 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=54K4gG2ek1bJePH0Chf04EULBIbKNlyYScL4v9NsLD4=; b=rxpn9lyF1hxTNQcjjU4Hruj2nwBKUtS76itccV39EvU80LxUlUPQbEL0J28oCW+J68 w+P3YiS1vFR/CD9zUISaPkhBs/Ek9vW7eljE6vFKN/ykeyDb2+wH2elIUAJmzcjN0pn0 q8K6ITPj4daX4ijpWVKmeu4xg1Pbr5ZW4+EeaZVx274EU8qKXdp1pO+EYcxjPvyUbw47 WIO741LkGHrUpQZX5WkBnJkm/tHdS0ficG50U2yT0CoD4DxefVrmGFuMxmwPMS8jNL14 VI3xn/uZ08xpz+kkxQPhGdrnaLlfTyzkVs4f/dk7qTUPrZm9G+MWiRmqB42H/BLOxQm4 cAhA== X-Gm-Message-State: AOAM533vQh7yIGQicsO/kLLXbpfLPK+vSxC9QG783zoLYnF2APaHdECo 3xJzxdpwl4BCD2SxyfKaJPX8yKVh X-Google-Smtp-Source: ABdhPJz+ib+fq0+YP7hbhmIBwrXGA8jkyoNu28sgbP3cEhaYNm17yKLma3tzk76AFMRa59zPqxpn9w== X-Received: by 2002:a62:794c:: with SMTP id u73mr2489629pfc.56.1589524664558; Thu, 14 May 2020 23:37:44 -0700 (PDT) Received: from localhost ([134.134.139.83]) by smtp.gmail.com with ESMTPSA id x193sm1065182pfd.54.2020.05.14.23.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 23:37:43 -0700 (PDT) From: Matt Turner To: gentoo-catalyst@lists.gentoo.org Cc: Matt Turner Subject: [gentoo-catalyst] [PATCH 3/3] catalyst: Mount squashfs with -o ro Date: Thu, 14 May 2020 23:37:30 -0700 Message-Id: <20200515063730.2582596-3-mattst88@gentoo.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200515063730.2582596-1-mattst88@gentoo.org> References: <20200515063730.2582596-1-mattst88@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 01d00a8b-c2bf-4c0f-a37d-29cc774ec4d7 X-Archives-Hash: 4cac414cf01698467cbd086e4aee4b2c Even though squashfs is not writeable, it must be mounted with -o ro in order to be mounted multiple times. This allows, for example, the same snapshot to be mounted simultaneously in multiple catalyst chroots. Signed-off-by: Matt Turner --- catalyst/base/stagebase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 55d1032d..651bf4e4 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -868,7 +868,9 @@ class StageBase(TargetBase, ClearBase, GenBase): mount += ['-t', 'tmpfs', '-o', 'noexec,nosuid,nodev'] else: source_path = Path(self.mount[x]['source']) - if source_path.suffix != '.sqfs': + if source_path.suffix == '.sqfs': + mount += ['-o', 'ro'] + else: mount.append('--bind') # We may need to create the source of the bind mount. E.g., in the -- 2.26.2