]>
Commit | Line | Data |
---|---|---|
0aade4df RH |
1 | ################################################################################ |
2 | # | |
3 | # Build the btrfs root filesystem image | |
4 | # | |
5 | ################################################################################ | |
6 | ||
7 | BTRFS_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_SIZE)) | |
8 | ifeq ($(BR2_TARGET_ROOTFS_BTRFS)-$(BTRFS_SIZE),y-) | |
9 | $(error BR2_TARGET_ROOTFS_BTRFS_SIZE cannot be empty) | |
10 | endif | |
11 | ||
12 | BTRFS_SIZE_NODE = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_SIZE_NODE)) | |
13 | BTRFS_SIZE_SECTOR = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_SIZE_SECTOR)) | |
14 | BTRFS_FEATURES = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_FEATURES)) | |
15 | # qstrip results in stripping consecutive spaces into a single one. So the | |
16 | # variable is not qstrip-ed to preserve the integrity of the string value. | |
9bdc27d8 | 17 | BTRFS_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_BTRFS_LABEL)) |
0aade4df RH |
18 | # ") |
19 | ||
20 | BTRFS_OPTS = \ | |
21 | -f \ | |
22 | -r '$(TARGET_DIR)' \ | |
23 | -L '$(BTRFS_LABEL)' \ | |
24 | --byte-count '$(BTRFS_SIZE)' \ | |
25 | $(if $(BTRFS_SIZE_NODE),--nodesize '$(BTRFS_SIZE_NODE)') \ | |
26 | $(if $(BTRFS_SIZE_SECTOR),--sectorsize '$(BTRFS_SIZE_SECTOR)') \ | |
27 | $(if $(BTRFS_FEATURES),--features '$(BTRFS_FEATURES)') | |
28 | ||
29 | ROOTFS_BTRFS_DEPENDENCIES = host-btrfs-progs | |
30 | ||
31 | define ROOTFS_BTRFS_CMD | |
f023810f | 32 | $(RM) -f $@ |
0aade4df RH |
33 | $(HOST_DIR)/bin/mkfs.btrfs $(BTRFS_OPTS) $@ |
34 | endef | |
35 | ||
36 | $(eval $(rootfs)) |