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
|
|
|
|
2005-06-24 07:02:00 +02:00
|
|
|
squashfsroot: squashfs host-fakeroot makedevs
|
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-07-15 01:30:39 +02:00
|
|
|
/sbin/ldconfig -r $(TARGET_DIR)
|
2005-06-24 07:02:00 +02:00
|
|
|
# Use fakeroot to pretend all target binaries are owned by root
|
2005-06-24 09:26:33 +02:00
|
|
|
$(STAGING_DIR)/usr/bin/fakeroot \
|
|
|
|
-i $(STAGING_DIR)/fakeroot.env \
|
2005-06-24 07:02:00 +02:00
|
|
|
-s $(STAGING_DIR)/fakeroot.env -- \
|
2005-06-24 09:26:33 +02:00
|
|
|
chown -R root:root $(TARGET_DIR)
|
2005-06-24 07:02:00 +02:00
|
|
|
# Use fakeroot to pretend to create all needed device nodes
|
2005-06-24 09:26:33 +02:00
|
|
|
$(STAGING_DIR)/usr/bin/fakeroot \
|
|
|
|
-i $(STAGING_DIR)/fakeroot.env \
|
2005-06-24 07:02:00 +02:00
|
|
|
-s $(STAGING_DIR)/fakeroot.env -- \
|
2005-06-24 09:26:33 +02:00
|
|
|
$(STAGING_DIR)/bin/makedevs \
|
2005-08-04 08:32:52 +02:00
|
|
|
-d $(TARGET_DEVICE_TABLE) \
|
2005-06-24 10:48:06 +02:00
|
|
|
$(TARGET_DIR)
|
2005-08-04 08:32:52 +02:00
|
|
|
# Use fakeroot so mksquashfs believes the previous fakery
|
2005-06-24 09:26:33 +02:00
|
|
|
$(STAGING_DIR)/usr/bin/fakeroot \
|
|
|
|
-i $(STAGING_DIR)/fakeroot.env \
|
|
|
|
-s $(STAGING_DIR)/fakeroot.env -- \
|
2005-06-24 12:30:09 +02:00
|
|
|
$(SQUASHFS_DIR)/squashfs-tools/mksquashfs \
|
|
|
|
$(TARGET_DIR) \
|
|
|
|
$(IMAGE).squashfs \
|
2005-06-24 16:29:10 +02:00
|
|
|
-noappend $(SQUASHFS_ENDIANNESS)
|
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
|