diff options
Diffstat (limited to 'meta/classes/bootimg.bbclass')
-rw-r--r-- | meta/classes/bootimg.bbclass | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass index bd211fbdc3..fdd4ea9561 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass | |||
@@ -32,6 +32,7 @@ EXCLUDE_FROM_WORLD = "1" | |||
32 | 32 | ||
33 | HDDDIR = "${S}/hddimg" | 33 | HDDDIR = "${S}/hddimg" |
34 | ISODIR = "${S}/iso" | 34 | ISODIR = "${S}/iso" |
35 | EFIIMGDIR = "${S}/efi_img" | ||
35 | 36 | ||
36 | BOOTIMG_VOLUME_ID ?= "boot" | 37 | BOOTIMG_VOLUME_ID ?= "boot" |
37 | BOOTIMG_EXTRA_SPACE ?= "512" | 38 | BOOTIMG_EXTRA_SPACE ?= "512" |
@@ -48,15 +49,10 @@ def pcbios(d): | |||
48 | pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d) | 49 | pcbios = base_contains("MACHINE_FEATURES", "efi", "0", "1", d) |
49 | return pcbios | 50 | return pcbios |
50 | 51 | ||
51 | def pcbios_class(d): | ||
52 | if d.getVar("PCBIOS", True) == "1": | ||
53 | return "syslinux" | ||
54 | return "" | ||
55 | |||
56 | PCBIOS = "${@pcbios(d)}" | 52 | PCBIOS = "${@pcbios(d)}" |
57 | PCBIOS_CLASS = "${@pcbios_class(d)}" | ||
58 | 53 | ||
59 | inherit ${PCBIOS_CLASS} | 54 | # The syslinux is required for the isohybrid command and boot catalog |
55 | inherit syslinux | ||
60 | inherit ${EFI_CLASS} | 56 | inherit ${EFI_CLASS} |
61 | 57 | ||
62 | populate() { | 58 | populate() { |
@@ -90,21 +86,36 @@ build_iso() { | |||
90 | fi | 86 | fi |
91 | if [ "${EFI}" = "1" ]; then | 87 | if [ "${EFI}" = "1" ]; then |
92 | grubefi_iso_populate | 88 | grubefi_iso_populate |
89 | build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img | ||
93 | fi | 90 | fi |
94 | 91 | ||
95 | if [ "${PCBIOS}" = "1" ]; then | 92 | # EFI only |
93 | if [ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ] ; then | ||
94 | # Work around bug in isohybrid where it requires isolinux.bin | ||
95 | # In the boot catalog, even though it is not used | ||
96 | mkdir -p ${ISODIR}/${ISOLINUXDIR} | ||
97 | install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR} | ||
98 | fi | ||
99 | |||
100 | if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then | ||
101 | # PCBIOS only media | ||
96 | mkisofs -V ${BOOTIMG_VOLUME_ID} \ | 102 | mkisofs -V ${BOOTIMG_VOLUME_ID} \ |
97 | -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ | 103 | -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ |
98 | -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \ | 104 | -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \ |
99 | ${MKISOFS_OPTIONS} ${ISODIR} | 105 | ${MKISOFS_OPTIONS} ${ISODIR} |
100 | else | 106 | else |
101 | bbnote "EFI-only ISO images are untested, please provide feedback." | 107 | # EFI only OR EFI+PCBIOS |
102 | mkisofs -V ${BOOTIMG_VOLUME_ID} \ | 108 | mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \ |
103 | -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ | 109 | -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ |
104 | -r ${ISODIR} | 110 | -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \ |
111 | -r ${MKISOFS_OPTIONS} \ | ||
112 | -eltorito-alt-boot -eltorito-platform efi \ | ||
113 | -b efi.img -no-emul-boot \ | ||
114 | ${ISODIR} | ||
115 | isohybrid_args="-u" | ||
105 | fi | 116 | fi |
106 | 117 | ||
107 | isohybrid ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso | 118 | isohybrid $isohybrid_args ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso |
108 | 119 | ||
109 | cd ${DEPLOY_DIR_IMAGE} | 120 | cd ${DEPLOY_DIR_IMAGE} |
110 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso | 121 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso |