python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / fs / iso9660 / iso9660.mk
blobd1d9cbf1a476978ad7bcee05b2790a34efaee1a8
1 ################################################################################
3 # Build the iso96600 root filesystem image
5 ################################################################################
8 # We need to handle three cases:
10 # 1. The ISO9660 filesystem will really be the real root filesystem
11 # itself. This is when BR2_TARGET_ROOTFS_ISO9660_INITRD is
12 # disabled.
14 # 2. The ISO9660 filesystem will be a filesystem with just a kernel
15 # image, initrd and grub. This is when
16 # BR2_TARGET_ROOTFS_ISO9660_INITRD is enabled, but
17 # BR2_TARGET_ROOTFS_INITRAMFS is disabled.
19 # 3. The ISO9660 filesystem will be a filesystem with just a kernel
20 # image and grub. This is like (2), except that the initrd is
21 # built into the kernel image. This is when
22 # BR2_TARGET_ROOTFS_INITRAMFS is enabled (regardless of the value
23 # of BR2_TARGET_ROOTFS_ISO9660_INITRD).
25 ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
27 ROOTFS_ISO9660_DEPENDENCIES = host-cdrkit linux
29 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
30 ROOTFS_ISO9660_USE_INITRD = YES
31 endif
33 ifeq ($(BR2_TARGET_ROOTFS_ISO9660_INITRD),y)
34 ROOTFS_ISO9660_USE_INITRD = YES
35 endif
37 ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
38 ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs.iso9660.tmp
39 define ROOTFS_ISO9660_CREATE_TEMPDIR
40 $(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
41 mkdir -p $(ROOTFS_ISO9660_TARGET_DIR)
42 endef
43 else
44 ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
45 endif
47 ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
48 ROOTFS_ISO9660_DEPENDENCIES += grub
49 ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
50 $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
51 ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/stage2_eltorito
52 define ROOTFS_ISO9660_INSTALL_BOOTLOADER
53 $(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
54 $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
55 endef
56 else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB2),y)
57 ROOTFS_ISO9660_DEPENDENCIES += grub2
58 ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
59 $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub.cfg
60 ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/grub-eltorito.img
61 define ROOTFS_ISO9660_INSTALL_BOOTLOADER
62 $(INSTALL) -D -m 0644 $(BINARIES_DIR)/grub-eltorito.img \
63 $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub-eltorito.img
64 endef
65 else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
66 ROOTFS_ISO9660_DEPENDENCIES += syslinux
67 ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
68 $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.cfg
69 ROOTFS_ISO9660_BOOT_IMAGE = isolinux/isolinux.bin
70 define ROOTFS_ISO9660_INSTALL_BOOTLOADER
71 $(INSTALL) -D -m 0644 $(BINARIES_DIR)/syslinux/* \
72 $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/
73 $(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/syslinux/ldlinux.c32 \
74 $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
75 endef
76 endif
78 define ROOTFS_ISO9660_PREPARATION
79 $(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
80 $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
81 $(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
82 $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
83 $(ROOTFS_ISO9660_INSTALL_BOOTLOADER)
84 endef
86 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
88 # Grub splash screen disabling
89 ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
90 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
91 define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
92 $(SED) '/^splashimage/d' $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
93 endef
94 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
95 endif
96 endif
98 define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
99 $(SED) '/__INITRD_PATH__/d' $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
100 endef
102 ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
104 # Copy Grub splashscreen to temporary filesystem
105 ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
106 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
107 define ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
108 $(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
109 $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
110 endef
111 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
112 endif
113 endif
115 # Copy the kernel to temporary filesystem
116 define ROOTFS_ISO9660_COPY_KERNEL
117 $(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \
118 $(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
119 endef
121 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_KERNEL
123 # If initramfs is used, disable loading the initrd as the rootfs is
124 # already inside the kernel image. Otherwise, make sure a cpio is
125 # generated and use it as the initrd.
126 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
127 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
128 else
129 ROOTFS_ISO9660_DEPENDENCIES += rootfs-cpio
130 define ROOTFS_ISO9660_COPY_INITRD
131 $(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
132 $(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd
133 $(SED) "s%__INITRD_PATH__%/boot/initrd%" \
134 $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
135 endef
136 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_INITRD
137 endif
139 else # ROOTFS_ISO9660_USE_INITRD
141 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
143 endif # ROOTFS_ISO9660_USE_INITRD
146 define ROOTFS_ISO9660_CMD
147 $(HOST_DIR)/usr/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \
148 -no-emul-boot -boot-load-size 4 -boot-info-table \
149 -o $@ $(ROOTFS_ISO9660_TARGET_DIR)
150 endef
152 ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
153 define ROOTFS_ISO9660_GEN_HYBRID
154 $(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
155 endef
157 ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
158 endif
160 $(eval $(call ROOTFS_TARGET,iso9660))