cab66a5e2458cd231c9b6519a1f3b325d084eeb2
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / fs / ext2 / ext2.mk
1 ################################################################################
2 #
3 # Build the ext2 root filesystem image
4 #
5 ################################################################################
6
7 EXT2_OPTS = -G $(BR2_TARGET_ROOTFS_EXT2_GEN) -R $(BR2_TARGET_ROOTFS_EXT2_REV)
8
9 ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0)
10 EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)
11 endif
12
13 ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_INODES)),0)
14 EXT2_OPTS += -i $(BR2_TARGET_ROOTFS_EXT2_INODES)
15 endif
16
17 ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),0)
18 EXT2_OPTS += -r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
19 endif
20
21 # Not qstrip-ing the variable, because it may contain spaces, but we must
22 # qstrip it when checking. Furthermore, we need to further quote it, so
23 # that the quotes do not get eaten by the echo statement when creating the
24 # fakeroot script
25 ifneq ($(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_LABEL)),)
26 EXT2_OPTS += -l '$(BR2_TARGET_ROOTFS_EXT2_LABEL)'
27 endif
28
29 ROOTFS_EXT2_DEPENDENCIES = host-mke2img
30
31 define ROOTFS_EXT2_CMD
32         PATH=$(BR_PATH) mke2img -d $(TARGET_DIR) $(EXT2_OPTS) -o $@
33 endef
34
35 rootfs-ext2-symlink:
36         ln -sf rootfs.ext2$(ROOTFS_EXT2_COMPRESS_EXT) $(BINARIES_DIR)/rootfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN)$(ROOTFS_EXT2_COMPRESS_EXT)
37
38 .PHONY: rootfs-ext2-symlink
39
40 ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2)
41 ROOTFS_EXT2_POST_TARGETS += rootfs-ext2-symlink
42 endif
43
44 $(eval $(call ROOTFS_TARGET,ext2))