aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-05-13 03:19:29 +0300
committerCem Keylan <cem@ckyln.com>2020-05-13 03:19:29 +0300
commitbaa1cfb1e2f9a3d9443c481028f9499bcfbe6e93 (patch)
treeebb96219f8d23e74b6d136e5c301d55197e2c2be
parenta66138085195d4c9f2b7a9b33c34f983e7afcc5f (diff)
downloadmkrootfs-baa1cfb1e2f9a3d9443c481028f9499bcfbe6e93.tar.gz
change directory in a subshell
-rwxr-xr-xmkrootfs.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/mkrootfs.sh b/mkrootfs.sh
index db59291..a65d2aa 100755
--- a/mkrootfs.sh
+++ b/mkrootfs.sh
@@ -91,7 +91,8 @@ msg "Removing root cache"
rm -rf "$MNTDIR/root/.cache"
msg "Generating rootfs to $BASEDIR"
-cd "$MNTDIR" || die "Could not change directory to $MNTDIR"
-tar -cpvJf "$BASEDIR/carbs-rootfs-$(date +%Y%m%d).tar.xz" .
-cd "$BASEDIR" || die "Could not change directory to $BASEDIR"
+(
+ cd "$MNTDIR" || die "Could not change directory to $MNTDIR"
+ tar -cpvJf "$BASEDIR/carbs-rootfs-$(date +%Y%m%d)-$(uname -m).tar.xz" .
+)
msg "Done!"