2006-04-06 20:31:14 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# mkisofs to build to target iso9660 filesystems
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
MKISOFS_SOURCE:=cdrtools-2.01.tar.bz2
|
2006-11-17 16:43:51 +01:00
|
|
|
MKISOFS_CAT:=$(BZCAT)
|
2006-04-06 20:31:14 +02:00
|
|
|
MKISOFS_SITE:=ftp://ftp.berlios.de/pub/cdrecord/
|
|
|
|
MKISOFS_DIR:=$(BUILD_DIR)/cdrtools-2.01
|
|
|
|
MKISOFS_TARGET:=$(MKISOFS_DIR)/mkisofs/OBJ/i686-linux-cc/mkisofs
|
|
|
|
|
|
|
|
$(DL_DIR)/$(MKISOFS_SOURCE):
|
2009-01-16 12:48:43 +01:00
|
|
|
$(call DOWNLOAD,$(MKISOFS_SITE),$(MKISOFS_SOURCE))
|
2006-04-06 20:31:14 +02:00
|
|
|
|
|
|
|
mkisofs-source: $(DL_DIR)/$(MKISOFS_SOURCE)
|
|
|
|
|
|
|
|
$(MKISOFS_DIR)/.unpacked: $(DL_DIR)/$(MKISOFS_SOURCE)
|
2006-11-17 16:43:51 +01:00
|
|
|
$(MKISOFS_CAT) $(DL_DIR)/$(MKISOFS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2006-04-06 20:31:14 +02:00
|
|
|
toolchain/patch-kernel.sh $(MKISOFS_DIR) target/iso9660/ \*.patch
|
2007-08-28 23:42:44 +02:00
|
|
|
touch $@
|
2006-04-06 20:31:14 +02:00
|
|
|
|
|
|
|
$(MKISOFS_DIR)/.configured: $(MKISOFS_DIR)/.unpacked
|
|
|
|
(cd $(MKISOFS_DIR); rm -rf config.cache; \
|
2007-08-28 23:42:44 +02:00
|
|
|
);
|
|
|
|
touch $@
|
2006-04-06 20:31:14 +02:00
|
|
|
|
|
|
|
$(MKISOFS_TARGET): $(MKISOFS_DIR)/.configured
|
|
|
|
$(MAKE) -C $(MKISOFS_DIR)
|
|
|
|
touch -c $(MKISOFS_DIR)/mkisofs
|
|
|
|
|
|
|
|
mkisofs: $(MKISOFS_TARGET)
|
|
|
|
|
|
|
|
mkisofs-clean:
|
|
|
|
-$(MAKE) -C $(MKISOFS_DIR) clean
|
|
|
|
|
|
|
|
mkisofs-dirclean:
|
|
|
|
rm -rf $(MKISOFS_DIR)
|
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Build the iso96600 root filesystem image
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
ISO9660_TARGET_DIR=$(BUILD_DIR)/iso9660
|
|
|
|
ISO9660_TARGET:=$(subst ",,$(BR2_TARGET_ROOTFS_ISO9660_OUTPUT))
|
2007-01-29 09:45:36 +01:00
|
|
|
#")
|
2006-04-06 20:31:14 +02:00
|
|
|
ISO9660_BOOT_MENU:=$(subst ",,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
|
2007-01-29 09:45:36 +01:00
|
|
|
#")
|
2006-04-06 20:31:14 +02:00
|
|
|
ISO9660_OPTS:=
|
|
|
|
|
2008-12-08 09:15:58 +01:00
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_ISO9660_SQUASH),y)
|
2006-04-06 20:31:14 +02:00
|
|
|
ISO9660_OPTS+=-U
|
|
|
|
endif
|
|
|
|
|
2007-07-08 13:25:25 +02:00
|
|
|
$(ISO9660_TARGET): host-fakeroot $(LINUX_KERNEL) $(EXT2_TARGET) grub mkisofs
|
2006-04-06 20:31:14 +02:00
|
|
|
mkdir -p $(ISO9660_TARGET_DIR)
|
|
|
|
mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
|
|
|
|
cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
|
|
|
|
cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
|
|
|
|
cp $(LINUX_KERNEL) $(ISO9660_TARGET_DIR)/kernel
|
|
|
|
cp $(EXT2_TARGET) $(ISO9660_TARGET_DIR)/initrd
|
2006-04-07 22:30:43 +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 $(ISO9660_TARGET))
|
|
|
|
touch $(PROJECT_BUILD_DIR)/.fakeroot.00000
|
|
|
|
cat $(PROJECT_BUILD_DIR)/.fakeroot* > $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET))
|
|
|
|
echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET))
|
2006-04-07 22:30:43 +02:00
|
|
|
# Use fakeroot so mkisofs believes the previous fakery
|
2006-04-11 00:49:48 +02:00
|
|
|
echo "$(MKISOFS_TARGET) -R -b boot/grub/stage2_eltorito -no-emul-boot " \
|
|
|
|
"-boot-load-size 4 -boot-info-table -o $(ISO9660_TARGET) $(ISO9660_TARGET_DIR)" \
|
2007-08-16 20:19:42 +02:00
|
|
|
>> $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET))
|
|
|
|
chmod a+x $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET))
|
2009-04-01 16:15:19 +02:00
|
|
|
$(HOST_DIR)/usr/bin/fakeroot -- $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET))
|
2007-08-16 20:19:42 +02:00
|
|
|
-@rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(ISO9660_TARGET))
|
2006-04-06 20:31:14 +02:00
|
|
|
|
|
|
|
iso9660root: $(ISO9660_TARGET)
|
|
|
|
echo $(ISO9660_TARGET)
|
|
|
|
@ls -l $(ISO9660_TARGET)
|
|
|
|
|
|
|
|
iso9660root-source: mkisofs-source
|
|
|
|
|
|
|
|
iso9660root-clean: mkisofs-clean
|
|
|
|
|
|
|
|
iso9660root-dirclean: mkisofs-dirclean
|
|
|
|
rm -rf $(ISO9660_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:58 +01:00
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
|
2006-04-06 20:31:14 +02:00
|
|
|
TARGETS+=iso9660root
|
|
|
|
endif
|