diff options
author | Darren Hart <dvhart@linux.intel.com> | 2011-11-23 16:01:21 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-30 22:18:07 +0000 |
commit | 4cdd02fe10fb31c6506db1d29b82afb210b94b8a (patch) | |
tree | c16a3ddf068ae9b4281db0c80651387a1f5a604a /meta/classes/bootimg.bbclass | |
parent | fcde2d65a76667a2d925fe5752dcc750b137f99a (diff) | |
download | poky-4cdd02fe10fb31c6506db1d29b82afb210b94b8a.tar.gz |
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.
(From OE-Core rev: 2da25c7c6649757350782a939bcc7553c5c86570)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/bootimg.bbclass')
-rw-r--r-- | meta/classes/bootimg.bbclass | 85 |
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" | |||
47 | 47 | ||
48 | inherit syslinux | 48 | inherit syslinux |
49 | 49 | ||
50 | build_boot_bin() { | 50 | build_iso() { |
51 | # Only create an ISO if we have an INITRD and NOISO was not set | ||
52 | if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then | ||
53 | bbnote "ISO image will not be created." | ||
54 | return | ||
55 | fi | ||
56 | |||
57 | install -d ${ISODIR} | ||
58 | |||
59 | # Install the kernel | ||
60 | install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \ | ||
61 | ${ISODIR}/vmlinuz | ||
62 | |||
63 | # Install the configuration files | ||
64 | cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg | ||
65 | |||
66 | if [ -f ${SYSLINUXMENU} ]; then | ||
67 | cp ${SYSLINUXMENU} ${ISODIR} | ||
68 | fi | ||
69 | |||
70 | install -m 0644 ${INITRD} ${ISODIR}/initrd | ||
71 | |||
72 | if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then | ||
73 | install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img | ||
74 | fi | ||
75 | |||
76 | # And install the syslinux stuff | ||
77 | cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR} | ||
78 | |||
79 | mkisofs -V ${BOOTIMG_VOLUME_ID} \ | ||
80 | -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ | ||
81 | -b isolinux/isolinux.bin -c isolinux/boot.cat -r \ | ||
82 | -no-emul-boot -boot-load-size 4 -boot-info-table \ | ||
83 | ${S}/cd/ | ||
84 | |||
85 | cd ${DEPLOY_DIR_IMAGE} | ||
86 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso | ||
87 | ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso | ||
88 | } | ||
89 | |||
90 | build_hddimg() { | ||
51 | # Create an HDD image | 91 | # Create an HDD image |
52 | if [ "${NOHDD}" != "1" ] ; then | 92 | if [ "${NOHDD}" != "1" ] ; then |
53 | install -d ${HDDDIR} | 93 | install -d ${HDDDIR} |
@@ -78,51 +118,12 @@ build_boot_bin() { | |||
78 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg | 118 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg |
79 | ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg | 119 | ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg |
80 | fi | 120 | fi |
81 | |||
82 | #Create an ISO if we have an INITRD | ||
83 | if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then | ||
84 | install -d ${ISODIR} | ||
85 | |||
86 | # Install the kernel | ||
87 | |||
88 | install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \ | ||
89 | ${ISODIR}/vmlinuz | ||
90 | |||
91 | # Install the configuration files | ||
92 | |||
93 | cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg | ||
94 | |||
95 | if [ -f ${SYSLINUXMENU} ]; then | ||
96 | cp ${SYSLINUXMENU} ${ISODIR} | ||
97 | fi | ||
98 | |||
99 | install -m 0644 ${INITRD} ${ISODIR}/initrd | ||
100 | |||
101 | if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then | ||
102 | install -m 0644 ${ROOTFS} ${ISODIR}/rootfs.img | ||
103 | fi | ||
104 | |||
105 | # And install the syslinux stuff | ||
106 | cp ${STAGING_LIBDIR}/syslinux/isolinux.bin ${ISODIR} | ||
107 | |||
108 | mkisofs -V ${BOOTIMG_VOLUME_ID} \ | ||
109 | -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ | ||
110 | -b isolinux/isolinux.bin -c isolinux/boot.cat -r \ | ||
111 | -no-emul-boot -boot-load-size 4 -boot-info-table \ | ||
112 | ${S}/cd/ | ||
113 | |||
114 | isohybrid ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso | ||
115 | |||
116 | cd ${DEPLOY_DIR_IMAGE} | ||
117 | rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso | ||
118 | ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso | ||
119 | |||
120 | fi | ||
121 | } | 121 | } |
122 | 122 | ||
123 | python do_bootimg() { | 123 | python do_bootimg() { |
124 | bb.build.exec_func('build_syslinux_cfg', d) | 124 | bb.build.exec_func('build_syslinux_cfg', d) |
125 | bb.build.exec_func('build_boot_bin', d) | 125 | bb.build.exec_func('build_hddimg', d) |
126 | bb.build.exec_func('build_iso', d) | ||
126 | } | 127 | } |
127 | 128 | ||
128 | addtask bootimg before do_build | 129 | addtask bootimg before do_build |