]>
Commit | Line | Data |
---|---|---|
086f333f | 1 | ################################################################################ |
08782ae7 EA |
2 | # |
3 | # Build the ext2 root filesystem image | |
4 | # | |
086f333f | 5 | ################################################################################ |
08782ae7 | 6 | |
bee9e881 SM |
7 | EXT2_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_SIZE)) |
8 | ifeq ($(BR2_TARGET_ROOTFS_EXT2)-$(EXT2_SIZE),y-) | |
9 | $(error BR2_TARGET_ROOTFS_EXT2_SIZE cannot be empty) | |
10 | endif | |
11 | ||
b404b27d SS |
12 | EXT2_MKFS_OPTS = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS)) |
13 | ||
fe13efe1 GP |
14 | # qstrip results in stripping consecutive spaces into a single one. So the |
15 | # variable is not qstrip-ed to preserve the integrity of the string value. | |
16 | EXT2_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL)) | |
64cfa507 YM |
17 | #" Syntax highlighting... :-/ ) |
18 | ||
ddecc7dc | 19 | EXT2_OPTS = \ |
67aaa90d SS |
20 | -d $(TARGET_DIR) \ |
21 | -r $(BR2_TARGET_ROOTFS_EXT2_REV) \ | |
22 | -N $(BR2_TARGET_ROOTFS_EXT2_INODES) \ | |
23 | -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS) \ | |
b404b27d SS |
24 | -L "$(EXT2_LABEL)" \ |
25 | $(EXT2_MKFS_OPTS) | |
c83fa6b0 | 26 | |
67aaa90d | 27 | ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs |
0a87bc7b | 28 | |
208d06ab | 29 | define ROOTFS_EXT2_CMD |
67aaa90d | 30 | rm -f $@ |
1eb57df2 | 31 | $(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(EXT2_OPTS) $@ \ |
a67f4c3e YM |
32 | "$(EXT2_SIZE)" \ |
33 | || { ret=$$?; \ | |
34 | echo "*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)" 1>&2; \ | |
35 | exit $$ret; \ | |
36 | } | |
208d06ab | 37 | endef |
08782ae7 | 38 | |
aaefab09 | 39 | ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2) |
03b6b795 YM |
40 | define ROOTFS_EXT2_SYMLINK |
41 | ln -sf rootfs.ext2$(ROOTFS_EXT2_COMPRESS_EXT) $(BINARIES_DIR)/rootfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN)$(ROOTFS_EXT2_COMPRESS_EXT) | |
42 | endef | |
43 | ROOTFS_EXT2_POST_GEN_HOOKS += ROOTFS_EXT2_SYMLINK | |
aaefab09 YM |
44 | endif |
45 | ||
b6842c40 | 46 | $(eval $(rootfs)) |