2004-03-05 20:09:57 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# mksquashfs to build to target squashfs filesystems
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-03-04 12:36:20 +01:00
|
|
|
SQUASHFS_VERSION:=3.3
|
2006-05-24 20:07:33 +02:00
|
|
|
SQUASHFS_DIR:=$(BUILD_DIR)/squashfs$(SQUASHFS_VERSION)
|
|
|
|
SQUASHFS_SOURCE:=squashfs$(SQUASHFS_VERSION).tar.gz
|
|
|
|
SQUASHFS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/squashfs
|
2006-10-01 17:17:52 +02:00
|
|
|
SQUASHFS_CAT:=$(ZCAT)
|
2004-03-05 20:09:57 +01:00
|
|
|
|
|
|
|
$(DL_DIR)/$(SQUASHFS_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(SQUASHFS_SITE)/$(SQUASHFS_SOURCE)
|
|
|
|
|
2005-06-24 05:14:20 +02:00
|
|
|
$(SQUASHFS_DIR)/.unpacked: $(DL_DIR)/$(SQUASHFS_SOURCE) #$(SQUASHFS_PATCH)
|
2006-05-24 20:07:33 +02:00
|
|
|
$(SQUASHFS_CAT) $(DL_DIR)/$(SQUASHFS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
|
2005-06-24 10:36:13 +02:00
|
|
|
toolchain/patch-kernel.sh $(SQUASHFS_DIR) target/squashfs/ squashfs\*.patch
|
2007-08-21 12:40:18 +02:00
|
|
|
touch $@
|
2004-03-05 20:09:57 +01:00
|
|
|
|
2005-06-24 05:14:20 +02:00
|
|
|
$(SQUASHFS_DIR)/squashfs-tools/mksquashfs: $(SQUASHFS_DIR)/.unpacked
|
2007-08-22 11:56:41 +02:00
|
|
|
$(MAKE) -C $(SQUASHFS_DIR)/squashfs-tools
|
2004-03-05 20:09:57 +01:00
|
|
|
|
|
|
|
squashfs: $(SQUASHFS_DIR)/squashfs-tools/mksquashfs
|
|
|
|
|
|
|
|
squashfs-source: $(DL_DIR)/$(SQUASHFS_SOURCE)
|
|
|
|
|
|
|
|
squashfs-clean:
|
|
|
|
-$(MAKE) -C $(SQUASHFS_DIR)/squashfs-tools clean
|
|
|
|
|
|
|
|
squashfs-dirclean:
|
|
|
|
rm -rf $(SQUASHFS_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Build the squashfs root filesystem image
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-06-12 17:30:32 +02:00
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
2005-06-24 12:30:09 +02:00
|
|
|
SQUASHFS_ENDIANNESS=-be
|
2007-06-12 17:30:32 +02:00
|
|
|
else
|
|
|
|
SQUASHFS_ENDIANNESS=-le
|
2005-06-24 12:30:09 +02:00
|
|
|
endif
|
2004-03-05 20:09:57 +01:00
|
|
|
|
2006-04-07 22:30:43 +02:00
|
|
|
SQUASHFS_TARGET:=$(IMAGE).squashfs
|
|
|
|
|
|
|
|
squashfsroot: host-fakeroot makedevs squashfs
|
2007-10-01 18:15:31 +02:00
|
|
|
-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
|
2007-08-21 16:32:38 +02:00
|
|
|
ifneq ($(BR2_HAVE_MANPAGES),y)
|
2005-06-24 09:26:33 +02:00
|
|
|
@rm -rf $(TARGET_DIR)/usr/man
|
2007-08-21 16:32:38 +02:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_HAVE_INFOPAGES),y)
|
2005-06-24 09:26:33 +02:00
|
|
|
@rm -rf $(TARGET_DIR)/usr/info
|
2007-08-21 16:32:38 +02:00
|
|
|
endif
|
2007-08-25 13:13:20 +02:00
|
|
|
$(if $(TARGET_LDCONFIG),test -x $(TARGET_LDCONFIG) && $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null)
|
2005-06-24 07:02:00 +02:00
|
|
|
# Use fakeroot to pretend all target binaries are owned by root
|
2007-08-16 20:19:42 +02:00
|
|
|
rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
|
|
|
touch $(PROJECT_BUILD_DIR)/.fakeroot.00000
|
|
|
|
cat $(PROJECT_BUILD_DIR)/.fakeroot* > $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
|
|
|
echo "chown -R 0:0 $(TARGET_DIR)" >> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
2007-02-15 17:49:39 +01:00
|
|
|
ifneq ($(TARGET_DEVICE_TABLE),)
|
2005-06-24 07:02:00 +02:00
|
|
|
# Use fakeroot to pretend to create all needed device nodes
|
2006-04-11 00:49:48 +02:00
|
|
|
echo "$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \
|
2007-08-16 20:19:42 +02:00
|
|
|
>> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
2007-02-15 17:49:39 +01:00
|
|
|
endif
|
2005-08-04 08:32:52 +02:00
|
|
|
# Use fakeroot so mksquashfs believes the previous fakery
|
2006-04-11 00:49:48 +02:00
|
|
|
echo "$(SQUASHFS_DIR)/squashfs-tools/mksquashfs " \
|
|
|
|
"$(TARGET_DIR) $(SQUASHFS_TARGET) " \
|
|
|
|
"-noappend $(SQUASHFS_ENDIANNESS)" \
|
2007-08-16 20:19:42 +02:00
|
|
|
>> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
|
|
|
chmod a+x $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
|
|
|
$(STAGING_DIR)/usr/bin/fakeroot -- $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
2008-04-25 14:04:04 +02:00
|
|
|
chmod 0644 $(SQUASHFS_TARGET)
|
2007-08-16 20:19:42 +02:00
|
|
|
-@rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
2004-03-05 20:09:57 +01:00
|
|
|
|
|
|
|
squashfsroot-source: squashfs-source
|
|
|
|
|
|
|
|
squashfsroot-clean:
|
|
|
|
-$(MAKE) -C $(SQUASHFS_DIR) clean
|
|
|
|
|
|
|
|
squashfsroot-dirclean:
|
|
|
|
rm -rf $(SQUASHFS_DIR)
|
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_TARGET_ROOTFS_SQUASHFS)),y)
|
|
|
|
TARGETS+=squashfsroot
|
|
|
|
endif
|