From b7de7a0ccbd6745793554fb97088fc716293e27f Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 20 Apr 2018 13:12:57 +0200 Subject: [PATCH] cleanup: remove w flag from all read only files Signed-off-by: David Oberhollenzer --- pkg/rootfs/build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/rootfs/build b/pkg/rootfs/build index c501d0f..c67f555 100755 --- a/pkg/rootfs/build +++ b/pkg/rootfs/build @@ -30,6 +30,10 @@ build() { echo $OS_RELEASE > $PKGBUILDDIR/etc/$fname + # remove write flag from all static files/directories + find $PKGBUILDDIR/{bin,lib,share} -type f -exec chmod a-w {} \; + find $PKGBUILDDIR/{bin,lib,share} -type d -exec chmod a-w {} \; + # setup root home directory mkdir -p "$PKGBUILDDIR/cfg/preserve/usr" @@ -50,4 +54,8 @@ deploy() { mksquashfs "$PKGBUILDDIR" "$DEPLOY/rootfs.img" -comp xz \ -all-root -no-progress -no-xattrs + + # add write flag again, so we can remove the build directory + find $PKGBUILDDIR/{bin,lib,share} -type d -exec chmod u+w {} \; + find $PKGBUILDDIR/{bin,lib,share} -type f -exec chmod u+w {} \; }