From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from eddie.linux-mips.org ([148.251.95.138] helo=cvs.linux-mips.org) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1kQI58-0004Cn-LA for ptxdist@pengutronix.de; Thu, 08 Oct 2020 00:38:47 +0200 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23991197AbgJGWioVNfKp (ORCPT ); Thu, 8 Oct 2020 00:38:44 +0200 Date: Thu, 8 Oct 2020 00:38:40 +0200 From: Ladislav Michl Message-ID: <20201007223840.GA876287@lenoch> MIME-Version: 1.0 Content-Disposition: inline Subject: [ptxdist] fake-overlayfs List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Hi there, fake-overlayfs help text reads: 'fake an overlay filesystem like unionfs by copying the original content to a tmpfs.' However it does not seem to do so. Bellow is attempt to fix that. 1) /usr/sbin/fake-overlayfs does not seem to mount tmpfs 2) with MountFlags=private is tmpfs mount invisible for the rest of system 3) perhaps use /run only with systemd? Comments welcome, ladis diff --git a/projectroot/usr/lib/systemd/system/fake-overlayfs.service b/projectroot/usr/lib/systemd/system/fake-overlayfs.service index daa6fd03f..818d624b9 100644 --- a/projectroot/usr/lib/systemd/system/fake-overlayfs.service +++ b/projectroot/usr/lib/systemd/system/fake-overlayfs.service @@ -1,11 +1,10 @@ [Unit] Description=Fake Overlay Filesystem DefaultDependencies=no -After=local-fs.target +Before=local-fs.target Requires=local-fs.target [Service] Type=oneshot -RemainAfterExit=no +RemainAfterExit=yes ExecStart=/usr/sbin/fake-overlayfs -MountFlags=private diff --git a/projectroot/usr/sbin/fake-overlayfs b/projectroot/usr/sbin/fake-overlayfs index b6692c578..de852b520 100644 --- a/projectroot/usr/sbin/fake-overlayfs +++ b/projectroot/usr/sbin/fake-overlayfs @@ -2,7 +2,7 @@ OVERLAY_DIRS="@OVERLAY_DIRLIST@" -bdir=/tmp/.fake-overlay-root +bdir=/run/.fake-overlay-root mkdir $bdir mount -o bind,private / $bdir @@ -14,10 +14,9 @@ while [ $# -gt 0 ]; do shift continue fi - echo $1 src="$bdir$1" - dst="$1/" - test -e "$dst" || mkdir $dst + dst=$1 + mount -t tmpfs tmpfs $dst cp -a "$src/"* "$src/".[^.]* "$src/"..?* $dst 2> /dev/null shift done _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de