Skip to content

Commit

Permalink
fs: make it behave a bit more like the package infra
Browse files Browse the repository at this point in the history
Currently, to register a filesystem, one has to call:

    $(eval $(call ROOTFS_TARGET,blabla))

This is very unlike the package infrastructure, where the name of the
package is automatically guessed by the infra.

It turns out that we can now do that for the filesystem infra too.

Signed-off-by: "Yann E. MORIN" <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
  • Loading branch information
yann-morin-1998 authored and tpetazzoni committed Jan 3, 2018
1 parent 9fc2166 commit b6842c4
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion fs/axfs/axfs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ define ROOTFS_AXFS_CMD
$(HOST_DIR)/bin/mkfs.axfs -s -a $(TARGET_DIR) $@
endef

$(eval $(call ROOTFS_TARGET,axfs))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/cloop/cloop.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ define ROOTFS_CLOOP_CMD
$(HOST_DIR)/bin/create_compressed_fs - 65536 > $@
endef

$(eval $(call ROOTFS_TARGET,cloop))
$(eval $(rootfs))
7 changes: 3 additions & 4 deletions fs/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ROOTFS_USERS_TABLES = $(call qstrip,$(BR2_ROOTFS_USERS_TABLES))

# Since this function will be called from within an $(eval ...)
# all variable references except the arguments must be $$-quoted.
define ROOTFS_TARGET_INTERNAL
define inner-rootfs

# extra deps
ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \
Expand Down Expand Up @@ -128,8 +128,7 @@ endif

endef

define ROOTFS_TARGET
$(call ROOTFS_TARGET_INTERNAL,$(1),$(call UPPERCASE,$(1)))
endef
# $(pkgname) also works well to return the filesystem name
rootfs = $(call inner-rootfs,$(pkgname),$(call UPPERCASE,$(pkgname)))

include $(sort $(wildcard fs/*/*.mk))
2 changes: 1 addition & 1 deletion fs/cpio/cpio.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ endef
ROOTFS_CPIO_POST_GEN_HOOKS += ROOTFS_CPIO_UBOOT_MKIMAGE
endif

$(eval $(call ROOTFS_TARGET,cpio))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/cramfs/cramfs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ endef

ROOTFS_CRAMFS_DEPENDENCIES = host-cramfs

$(eval $(call ROOTFS_TARGET,cramfs))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/ext2/ext2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ endef
ROOTFS_EXT2_POST_GEN_HOOKS += ROOTFS_EXT2_SYMLINK
endif

$(eval $(call ROOTFS_TARGET,ext2))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/iso9660/iso9660.mk
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ endef
ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
endif

$(eval $(call ROOTFS_TARGET,iso9660))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/jffs2/jffs2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ define ROOTFS_JFFS2_CMD
endef
endif

$(eval $(call ROOTFS_TARGET,jffs2))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/romfs/romfs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ define ROOTFS_ROMFS_CMD
$(HOST_DIR)/bin/genromfs -d $(TARGET_DIR) -f $@
endef

$(eval $(call ROOTFS_TARGET,romfs))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/squashfs/squashfs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ define ROOTFS_SQUASHFS_CMD
$(HOST_DIR)/bin/mksquashfs $(TARGET_DIR) $@ $(ROOTFS_SQUASHFS_ARGS)
endef

$(eval $(call ROOTFS_TARGET,squashfs))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/tar/tar.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ define ROOTFS_TAR_CMD
tar $(TAR_OPTS) -cf $@ --null --no-recursion -T - --numeric-owner)
endef

$(eval $(call ROOTFS_TARGET,tar))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/ubi/ubi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ define ROOTFS_UBI_CMD
rm $(BUILD_DIR)/ubinize.cfg
endef

$(eval $(call ROOTFS_TARGET,ubi))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/ubifs/ubifs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ define ROOTFS_UBIFS_CMD
$(HOST_DIR)/sbin/mkfs.ubifs -d $(TARGET_DIR) $(UBIFS_OPTS) -o $@
endef

$(eval $(call ROOTFS_TARGET,ubifs))
$(eval $(rootfs))
2 changes: 1 addition & 1 deletion fs/yaffs2/yaffs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ define ROOTFS_YAFFS2_CMD
$(HOST_DIR)/bin/mkyaffs2 --all-root $(TARGET_DIR) $@
endef

$(eval $(call ROOTFS_TARGET,yaffs2))
$(eval $(rootfs))

0 comments on commit b6842c4

Please sign in to comment.