summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-11-23 16:01:21 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-30 22:11:27 +0000
commit2da25c7c6649757350782a939bcc7553c5c86570 (patch)
tree013b1c46a88b3410ef528b13b0a0b42671c9b7a9 /meta
parentf9518a368f041ceccb4a36061d91ae64cd4dabd4 (diff)
downloadopenembedded-core-2da25c7c6649757350782a939bcc7553c5c86570.tar.gz
openembedded-core-2da25c7c6649757350782a939bcc7553c5c86570.tar.bz2
openembedded-core-2da25c7c6649757350782a939bcc7553c5c86570.zip
bootimg: Refactor build_hddimg and build_iso routines
Separate the construction of the ISO image from that of the hddimg. This is part of the groundwork for creating a much more flexible live image builder. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/bootimg.bbclass85
1 files changed, 43 insertions, 42 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 3914311254..dbaa677600 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -47,7 +47,47 @@ SYSLINUXMENU = "${HDDDIR}/menu"
inherit syslinux
-build_boot_bin() {
+build_iso() {
+ # Only create an ISO if we have an INITRD and NOISO was not set
+ if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
+ bbnote "ISO image will not be created."
+ return
+ fi
+
+ install -d ${ISODIR}
+
+ # Install the kernel
+ install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
+ ${ISODIR}/vmlinuz
+
+ # Install the configuration files
+ cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
+
+ if [ -f ${SYSLINUXMENU} ]; then
+ cp ${SYSLINUXMENU} ${ISODIR}
+ fi
+
+ install -m 0644 ${INITRD} ${ISODIR}/initrd
+
+ if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+ install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img
+ fi
+
+ # And install the syslinux stuff
+ cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}
+
+ mkisofs -V ${BOOTIMG_VOLUME_ID} \
+ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
+ -b isolinux/isolinux.bin -c isolinux/boot.cat -r \
+ -no-emul-boot -boot-load-size 4 -boot-info-table \
+ ${S}/cd/
+
+ cd ${DEPLOY_DIR_IMAGE}
+ rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
+ ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
+}
+
+build_hddimg() {
# Create an HDD image
if [ "${NOHDD}" != "1" ] ; then
install -d ${HDDDIR}
@@ -78,51 +118,12 @@ build_boot_bin() {
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
fi
-
- #Create an ISO if we have an INITRD
- if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
- install -d ${ISODIR}
-
- # Install the kernel
-
- install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
- ${ISODIR}/vmlinuz
-
- # Install the configuration files
-
- cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
-
- if [ -f ${SYSLINUXMENU} ]; then
- cp ${SYSLINUXMENU} ${ISODIR}
- fi
-
- install -m 0644 ${INITRD} ${ISODIR}/initrd
-
- if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
- install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img
- fi
-
- # And install the syslinux stuff
- cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR}
-
- mkisofs -V ${BOOTIMG_VOLUME_ID} \
- -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
- -b isolinux/isolinux.bin -c isolinux/boot.cat -r \
- -no-emul-boot -boot-load-size 4 -boot-info-table \
- ${S}/cd/
-
- isohybrid ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
-
- cd ${DEPLOY_DIR_IMAGE}
- rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
- ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
-
- fi
}
python do_bootimg() {
bb.build.exec_func('build_syslinux_cfg', d)
- bb.build.exec_func('build_boot_bin', d)
+ bb.build.exec_func('build_hddimg', d)
+ bb.build.exec_func('build_iso', d)
}
addtask bootimg before do_build