1 #############################################################
3 # tar to archive target filesystem
5 #############################################################
7 TAR_OPTS
:=$(strip $(BR2_TARGET_ROOTFS_TAR_OPTIONS
))
8 TAR_TARGET
:=$(IMAGE
).
tar
11 TAR_COMPRESSOR_EXT
:=.none
12 ifeq ($(BR2_TARGET_ROOTFS_TAR_GZIP
),y
)
13 TAR_COMPRESSOR
:=gzip
-9 -c
14 TAR_COMPRESSOR_EXT
:=gz
16 ifeq ($(BR2_TARGET_ROOTFS_TAR_BZIP2
),y
)
17 TAR_COMPRESSOR
:=bzip2
-9 -c
18 TAR_COMPRESSOR_EXT
:=bz2
20 ifeq ($(BR2_TARGET_ROOTFS_TAR_LZMA
),y
)
21 TAR_COMPRESSOR
:=lzma
-9 -c
22 TAR_COMPRESSOR_EXT
:=lzma
24 ROOTFS_TAR_COPYTO
:=$(strip $(subst ",,$(BR2_TARGET_ROOTFS_TAR_COPYTO)))
27 tarroot
: host-fakeroot makedevs
28 -@find
$(TARGET_DIR
) -type f
-perm
+111 | xargs
$(STRIPCMD
) 2>/dev
/null || true
29 ifneq ($(BR2_HAVE_MANPAGES
),y
)
30 @
rm -rf
$(TARGET_DIR
)/usr
/share
/man
32 ifneq ($(BR2_HAVE_INFOPAGES
),y
)
33 @
rm -rf
$(TARGET_DIR
)/usr
/share
/info
35 $(if
$(TARGET_LDCONFIG
),test ! -x
$(TARGET_LDCONFIG
) && true ||
$(TARGET_LDCONFIG
) -r
$(TARGET_DIR
) 2>/dev
/null
)
36 # Use fakeroot to pretend all target binaries are owned by root
37 rm -f
$(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
38 touch
$(PROJECT_BUILD_DIR
)/.fakeroot
.00000
39 cat
$(PROJECT_BUILD_DIR
)/.fakeroot
* > $(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
40 echo
"chown -R 0:0 $(TARGET_DIR)" >> $(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
41 ifneq ($(TARGET_DEVICE_TABLE
),)
42 # Use fakeroot to pretend to create all needed device nodes
43 echo
"$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \
44 >> $(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
46 # Use fakeroot so tar believes the previous fakery
47 echo
"tar -c$(TAR_OPTS)f $(TAR_TARGET) -C $(TARGET_DIR) ." \
48 >> $(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
49 chmod a
+x
$(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
50 $(STAGING_DIR
)/usr
/bin
/fakeroot
-- $(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
51 ifneq ($(TAR_COMPRESSOR
),)
52 -rm -f
$(TAR_TARGET
).
$()
53 PATH
="$(STAGING_DIR)/sbin:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/sbin:$(STAGING_DIR)/usr/bin:$(PATH)" $(TAR_COMPRESSOR
) $(TAR_TARGET
) > $(TAR_TARGET
).
$(TAR_COMPRESSOR_EXT
)
55 ifneq ($(ROOTFS_TAR_COPYTO
),)
56 $(Q
)cp
-f
$(TAR_TARGET
) $(ROOTFS_TAR_COPYTO
)
58 -@
rm -f
$(PROJECT_BUILD_DIR
)/_fakeroot.
$(notdir $(TAR_TARGET
))
60 EXT2_COPYTO
:= $(strip $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_COPYTO)))
70 #############################################################
72 # Toplevel Makefile options
74 #############################################################
75 ifeq ($(BR2_TARGET_ROOTFS_TAR
),y
)