aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2018-08-25 19:47:14 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2018-08-25 23:59:23 +0200
commitf023810f04ea0cf4633465e838cb2f7eae2b1727 (patch)
treef06497498446db7bacaf23f9cb80bfbc221f5b91 /fs
parentb743cb408a357a330f76410c82c8f2fcaa850a6f (diff)
downloadbuildroot-f023810f04ea0cf4633465e838cb2f7eae2b1727.tar.gz
buildroot-f023810f04ea0cf4633465e838cb2f7eae2b1727.tar.bz2
fs/btrfs: remove destination file before generation
btrfs will happily use an existing destination file if it already exists, increasing its size if needed. Hoever, it will never decrease the size, even if the requested size is smaller than the existing file. So, remove any previously existing destination file before generating the new filesystem. Note: the original submission by Robert did that, but as this case was not obvious, the removal was dropped by a refactoring when the patch was initially applied. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Robert J. Heywood <robert.heywood@codethink.co.uk> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> [Thomas: use $@ instead of $(@), use $(RM) instead of rm.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/btrfs.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/btrfs.mk b/fs/btrfs/btrfs.mk
index ad00153c26..388516389b 100644
--- a/fs/btrfs/btrfs.mk
+++ b/fs/btrfs/btrfs.mk
@@ -29,6 +29,7 @@ BTRFS_OPTS = \
ROOTFS_BTRFS_DEPENDENCIES = host-btrfs-progs
define ROOTFS_BTRFS_CMD
+ $(RM) -f $@
$(HOST_DIR)/bin/mkfs.btrfs $(BTRFS_OPTS) $@
endef