2018-08-23 16:01:56 -06:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Build the btrfs root filesystem image
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
BTRFS_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_SIZE))
|
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_BTRFS)-$(BTRFS_SIZE),y-)
|
|
|
|
$(error BR2_TARGET_ROOTFS_BTRFS_SIZE cannot be empty)
|
|
|
|
endif
|
|
|
|
|
|
|
|
BTRFS_SIZE_NODE = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_SIZE_NODE))
|
|
|
|
BTRFS_SIZE_SECTOR = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_SIZE_SECTOR))
|
|
|
|
BTRFS_FEATURES = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_FEATURES))
|
|
|
|
# qstrip results in stripping consecutive spaces into a single one. So the
|
|
|
|
# variable is not qstrip-ed to preserve the integrity of the string value.
|
2019-10-26 02:45:59 -06:00
|
|
|
BTRFS_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_BTRFS_LABEL))
|
2018-08-23 16:01:56 -06:00
|
|
|
# ")
|
|
|
|
|
|
|
|
BTRFS_OPTS = \
|
|
|
|
-f \
|
|
|
|
-r '$(TARGET_DIR)' \
|
|
|
|
-L '$(BTRFS_LABEL)' \
|
|
|
|
--byte-count '$(BTRFS_SIZE)' \
|
|
|
|
$(if $(BTRFS_SIZE_NODE),--nodesize '$(BTRFS_SIZE_NODE)') \
|
|
|
|
$(if $(BTRFS_SIZE_SECTOR),--sectorsize '$(BTRFS_SIZE_SECTOR)') \
|
|
|
|
$(if $(BTRFS_FEATURES),--features '$(BTRFS_FEATURES)')
|
|
|
|
|
|
|
|
ROOTFS_BTRFS_DEPENDENCIES = host-btrfs-progs
|
|
|
|
|
|
|
|
define ROOTFS_BTRFS_CMD
|
2018-08-25 11:47:14 -06:00
|
|
|
$(RM) -f $@
|
2018-08-23 16:01:56 -06:00
|
|
|
$(HOST_DIR)/bin/mkfs.btrfs $(BTRFS_OPTS) $@
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(rootfs))
|