2004-03-05 20:09:57 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# mksquashfs to build to target squashfs filesystems
|
|
|
|
#
|
|
|
|
#############################################################
|
2005-06-24 12:30:09 +02:00
|
|
|
SQUASHFS_DIR=$(BUILD_DIR)/squashfs2.1-r2
|
|
|
|
SQUASHFS_SOURCE=squashfs2.1-r2.tar.gz
|
2005-06-09 14:15:00 +02:00
|
|
|
SQUASHFS_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/squashfs
|
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)
|
2004-03-05 20:09:57 +01:00
|
|
|
zcat $(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
|
|
|
|
#
|
|
|
|
#############################################################
|
2005-06-24 12:30:09 +02:00
|
|
|
SQUASHFS_ENDIANNESS=-le
|
|
|
|
ifeq ($(strip $(BR2_armeb)),y)
|
|
|
|
SQUASHFS_ENDIANNESS=-be
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(BR2_mips)),y)
|
|
|
|
SQUASHFS_ENDIANNESS=-be
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(BR2_powerpc)),y)
|
|
|
|
SQUASHFS_ENDIANNESS=-be
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(BR2_sh3eb)),y)
|
|
|
|
SQUASHFS_ENDIANNESS=-be
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(BR2_sh4eb)),y)
|
|
|
|
SQUASHFS_ENDIANNESS=-be
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(BR2_sparc)),y)
|
|
|
|
SQUASHFS_ENDIANNESS=-be
|
|
|
|
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
|
2005-08-08 08:57:43 +02:00
|
|
|
-/sbin/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-10 19:48:53 +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-10 19:48:53 +02:00
|
|
|
cat $(STAGING_DIR)/.fakeroot* > $(STAGING_DIR)/_fakeroot.$(notdir $SQUASHFS_TARGET)
|
2006-04-11 00:49:48 +02:00
|
|
|
echo "chown -R root:root $(TARGET_DIR)" >> $(STAGING_DIR)/_fakeroot.$(notdir $SQUASHFS_TARGET)
|
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)" \
|
|
|
|
>> $(STAGING_DIR)/_fakeroot.$(notdir $SQUASHFS_TARGET)
|
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)" \
|
|
|
|
>> $(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)
|
2006-04-10 19:48:53 +02:00
|
|
|
-@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
|