kumquat-buildroot/fs/ext2/ext2.mk
Yann E. MORIN 5ece6be60b fs/ext2: fir (again) namespace for variables
As reported by Jens [0], commit db7d786140 (fs/ext2: fix namespace for
variables) forgot to rename one variable expansion, resulting in the
ext2 label as set by the user to be ignored, with an empty label set.

[0] https://github.com/buildroot/buildroot/commit/db7d78614098#commitcomment-57918423

Reported-by: Jens Maus <mail@jens-maus.de>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2021-10-13 18:01:34 +02:00

47 lines
1.5 KiB
Makefile

################################################################################
#
# Build the ext2 root filesystem image
#
################################################################################
ROOTFS_EXT2_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_SIZE))
ifeq ($(BR2_TARGET_ROOTFS_EXT2)-$(ROOTFS_EXT2_SIZE),y-)
$(error BR2_TARGET_ROOTFS_EXT2_SIZE cannot be empty)
endif
ROOTFS_EXT2_MKFS_OPTS = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS))
# 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.
ROOTFS_EXT2_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
#" Syntax highlighting... :-/ )
ROOTFS_EXT2_OPTS = \
-d $(TARGET_DIR) \
-r $(BR2_TARGET_ROOTFS_EXT2_REV) \
-N $(BR2_TARGET_ROOTFS_EXT2_INODES) \
-m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \
-L "$(ROOTFS_EXT2_LABEL)" \
$(ROOTFS_EXT2_MKFS_OPTS)
ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs
define ROOTFS_EXT2_CMD
rm -f $@
$(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(ROOTFS_EXT2_OPTS) $@ \
"$(ROOTFS_EXT2_SIZE)" \
|| { ret=$$?; \
echo "*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)" 1>&2; \
exit $$ret; \
}
endef
ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2)
define ROOTFS_EXT2_SYMLINK
ln -sf rootfs.ext2$(ROOTFS_EXT2_COMPRESS_EXT) $(BINARIES_DIR)/rootfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN)$(ROOTFS_EXT2_COMPRESS_EXT)
endef
ROOTFS_EXT2_POST_GEN_HOOKS += ROOTFS_EXT2_SYMLINK
endif
$(eval $(rootfs))