2004-03-05 20:09:57 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# mksquashfs to build to target squashfs filesystems
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-01-18 13:39:05 +01:00
|
|
|
SQUASHFS_VERSION:=3.2-r2
|
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
|
2005-06-24 05:14:20 +02:00
|
|
|
touch $(SQUASHFS_DIR)/.unpacked
|
2004-03-05 20:09:57 +01:00
|
|
|
|
2005-06-24 05:14:20 +02:00
|
|
|
$(SQUASHFS_DIR)/squashfs-tools/mksquashfs: $(SQUASHFS_DIR)/.unpacked
|
2004-03-05 20:09:57 +01:00
|
|
|
$(MAKE) -C $(SQUASHFS_DIR)/squashfs-tools;
|
|
|
|
|
|
|
|
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
|
2005-06-24 09:26:33 +02:00
|
|
|
-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
|
|
|
|
@rm -rf $(TARGET_DIR)/usr/man
|
|
|
|
@rm -rf $(TARGET_DIR)/usr/info
|
2007-08-08 16:58:47 +02:00
|
|
|
$(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
|
2006-04-21 03:23:35 +02:00
|
|
|
rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
2006-04-08 00:42:15 +02:00
|
|
|
touch $(STAGING_DIR)/.fakeroot.00000
|
2006-04-21 03:23:35 +02:00
|
|
|
cat $(STAGING_DIR)/.fakeroot* > $(STAGING_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
2007-03-20 17:52:44 +01:00
|
|
|
echo "chown -R 0:0 $(TARGET_DIR)" >> $(STAGING_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)" \
|
2006-04-21 03:23:35 +02:00
|
|
|
>> $(STAGING_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)" \
|
2006-04-21 03:23:35 +02:00
|
|
|
>> $(STAGING_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
|
|
|
chmod a+x $(STAGING_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
|
|
|
$(STAGING_DIR)/usr/bin/fakeroot -- $(STAGING_DIR)/_fakeroot.$(notdir $(SQUASHFS_TARGET))
|
|
|
|
-@rm -f $(STAGING_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
|