From fbe47cd3338e6782b83fa7c735d580567c26b7bf Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 6 Apr 2006 18:31:14 +0000 Subject: [PATCH] patch from janlana adding an x86 bootable iso9660 CD-ROM target --- target/Config.in | 1 + target/iso9660/Config.in | 18 ++++++++ target/iso9660/iso9660.mk | 90 +++++++++++++++++++++++++++++++++++++++ target/iso9660/menu.lst | 11 +++++ 4 files changed, 120 insertions(+) create mode 100644 target/iso9660/Config.in create mode 100644 target/iso9660/iso9660.mk create mode 100644 target/iso9660/menu.lst diff --git a/target/Config.in b/target/Config.in index 315499a6d4..f59f7de5f4 100644 --- a/target/Config.in +++ b/target/Config.in @@ -8,6 +8,7 @@ source "target/ext2/Config.in" source "target/jffs2/Config.in" source "target/squashfs/Config.in" source "target/tar/Config.in" +source "target/iso9660/Config.in" comment "bootloader for target device" diff --git a/target/iso9660/Config.in b/target/iso9660/Config.in new file mode 100644 index 0000000000..56e25cb0fa --- /dev/null +++ b/target/iso9660/Config.in @@ -0,0 +1,18 @@ +config BR2_TARGET_ROOTFS_ISO9660 + bool "iso image" + default n + depends on BR2_i386 + select BR2_TARGET_ROOTFS_EXT2 + select BR2_PACKAGE_GRUB + help + Build a bootable iso9660 image + +config BR2_TARGET_ROOTFS_ISO9660_OUTPUT + string "Output File" + depends on BR2_TARGET_ROOTFS_ISO9660 + default "$(IMAGE).iso" + +config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU + string "Boot menu.lst file" + depends on BR2_TARGET_ROOTFS_ISO9660 + default "target/iso9660/menu.lst" diff --git a/target/iso9660/iso9660.mk b/target/iso9660/iso9660.mk new file mode 100644 index 0000000000..a0b074000c --- /dev/null +++ b/target/iso9660/iso9660.mk @@ -0,0 +1,90 @@ +############################################################# +# +# mkisofs to build to target iso9660 filesystems +# +############################################################# +MKISOFS_SOURCE:=cdrtools-2.01.tar.bz2 +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): + $(WGET) -P $(DL_DIR) $(MKISOFS_SITE)/$(MKISOFS_SOURCE) + +mkisofs-source: $(DL_DIR)/$(MKISOFS_SOURCE) + +$(MKISOFS_DIR)/.unpacked: $(DL_DIR)/$(MKISOFS_SOURCE) + bzcat $(DL_DIR)/$(MKISOFS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + toolchain/patch-kernel.sh $(MKISOFS_DIR) target/iso9660/ \*.patch + touch $(MKISOFS_DIR)/.unpacked + +$(MKISOFS_DIR)/.configured: $(MKISOFS_DIR)/.unpacked + (cd $(MKISOFS_DIR); rm -rf config.cache; \ + ); + touch $(MKISOFS_DIR)/.configured + +$(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)) +ISO9660_BOOT_MENU:=$(subst ",,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU)) + +ISO9660_OPTS:= + +ifeq ($(strip $(BR2_TARGET_ROOTFS_ISO9660_SQUASH)),y) +ISO9660_OPTS+=-U +endif + +$(ISO9660_TARGET): host-fakeroot $(STAGING_DIR)/fakeroot.env $(EXT2_TARGET) grub mkisofs + 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 + -$(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + chown -R root:root $(ISO9660_TARGET_DIR) + -$(MKISOFS_TARGET) \ + -R \ + -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table \ + -o $(ISO9660_TARGET) \ + $(ISO9660_TARGET_DIR) + +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 +# +############################################################# +ifeq ($(strip $(BR2_TARGET_ROOTFS_ISO9660)),y) +TARGETS+=iso9660root +endif diff --git a/target/iso9660/menu.lst b/target/iso9660/menu.lst new file mode 100644 index 0000000000..d78caebe15 --- /dev/null +++ b/target/iso9660/menu.lst @@ -0,0 +1,11 @@ +default 0 +timeout 10 +color cyan/blue white/blue + +title Hard Drive (first partition) +rootnoverify (hd0) +chainloader +1 + +title BuildRoot ISO9660 image +kernel /kernel +initrd /initrd -- 2.30.2