2004-03-05 20:09:57 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# mksquashfs to build to target squashfs filesystems
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
SQUASHFS_DIR=$(BUILD_DIR)/squashfs1.3r3
|
|
|
|
SQUASHFS_SOURCE=squashfs1.3r3.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 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
|
|
|
|
# Use fakeroot to munge permissions and do root-like things
|
2005-06-24 07:02:00 +02:00
|
|
|
rm -f $(STAGING_DIR)/fakeroot.env
|
|
|
|
touch $(STAGING_DIR)/fakeroot.env
|
|
|
|
# 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 \
|
|
|
|
-r $(TARGET_DIR) \
|
|
|
|
-d target/generic/device_table.txt
|
2005-06-24 07:02:00 +02:00
|
|
|
# Use fakeroot to fake out mksquashfs per 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 07:02:00 +02:00
|
|
|
$(SQUASHFS_DIR)/squashfs-tools/mksquashfs $(TARGET_DIR) \
|
|
|
|
$(IMAGE).squashfs -noappend
|
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
|