summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"
47 47
48inherit syslinux 48inherit syslinux
49 49
50build_boot_bin() { 50build_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
90build_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
123python do_bootimg() { 123python 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
128addtask bootimg before do_build 129addtask bootimg before do_build