[oe-commits] org.oe.dev bootimg.bbclass: import of new version (from Poky)

hrw commit openembedded-commits at lists.openembedded.org
Thu Oct 25 15:44:09 UTC 2007


bootimg.bbclass: import of new version (from Poky)
------------------------------------------------------------------------
r2867 | richard | 2007-10-11 23:46:11 +0200 (Cz, 11 X 2007) | 1 line
bootimg.bbclass: Fix taskname reference
------------------------------------------------------------------------
r1911 | hrw | 2007-06-11 12:35:28 +0200 (Pn, 11 VI 2007) | 1 line
bootimg.bbclass: get kernel from proper directory in staging
------------------------------------------------------------------------
r1899 | hrw | 2007-06-08 22:45:44 +0200 (Pt, 08 VI 2007) | 9 lines
bootimg.bbclass: fixed generation of ISO & HDD images

bootimg.bbclass supported creation of FAT filesystem images for usage with
syslinux (kernel and initrd in /boot/) and creation of ISO images with kernel
and initrd on it. ISO images contained also not needed /boot/ directory from
FAT image.

Now still two files are created as result but both contain only needed files.
------------------------------------------------------------------------
r1898 | hrw | 2007-06-08 20:22:19 +0200 (Pt, 08 VI 2007) | 1 line
bootimg: reformatted again
------------------------------------------------------------------------
r1897 | hrw | 2007-06-08 20:21:18 +0200 (Pt, 08 VI 2007) | 1 line
bootimg: reformatted
------------------------------------------------------------------------
r1894 | hrw | 2007-06-08 10:39:22 +0200 (Pt, 08 VI 2007) | 1 line
bootimg.bbclass: imported from OE, updated to recent BitBake

Author: hrw at openembedded.org
Branch: org.openembedded.dev
Revision: e4118d157e0564f051cc2f7363705a32d72577ff
ViewMTN: http://monotone.openembedded.org/revision/info/e4118d157e0564f051cc2f7363705a32d72577ff
Files:
1
classes/bootimg.bbclass
Diffs:

#
# mt diff -r11794809150bbf03740d352701866df7eb8831a0 -re4118d157e0564f051cc2f7363705a32d72577ff
#
# 
# 
# patch "classes/bootimg.bbclass"
#  from [dc2fe10037d870a84fea2e8e3f7d5175c063c1fe]
#    to [98051629daa27a049689f03008b114ce7644361a]
# 
============================================================
--- classes/bootimg.bbclass	dc2fe10037d870a84fea2e8e3f7d5175c063c1fe
+++ classes/bootimg.bbclass	98051629daa27a049689f03008b114ce7644361a
@@ -12,41 +12,48 @@
 # ${APPEND} - an override list of append strings for each label
 # ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited 
 
-DEPENDS_append=" dosfstools-native syslinux-native mtools-native cdrtools-native"
+do_bootimg[depends] += "dosfstools-native:do_populate_staging \
+                       syslinux-native:do_populate_staging \
+		       mtools-native:do_populate_staging \
+		       cdrtools-native:do_populate_staging"
 
-BDIR="${WORKDIR}/boot"
-ISODIR="${IMAGE_ROOTFS}/isolinux/"
+PACKAGES = " "
 
-BOOTIMG_VOLUME_ID ?= "oe"
+HDDDIR = "${S}/hdd/boot"
+ISODIR = "${S}/cd/isolinux"
+
+BOOTIMG_VOLUME_ID   ?= "oe"
 BOOTIMG_EXTRA_SPACE ?= "64"
 
 # Get the build_syslinux_cfg() function from the syslinux class
 
-SYSLINUXCFG="${BDIR}/syslinux.cfg"
-SYSLINUXMENU="${BDIR}/menu"
+SYSLINUXCFG  = "${HDDDIR}/syslinux.cfg"
+SYSLINUXMENU = "${HDDDIR}/menu"
+
 inherit syslinux
 		
 build_boot_bin() {
-	install -d ${BDIR}
-	install -m 0644 ${STAGING_KERNEL_DIR}/bzImage \
-	${BDIR}/vmlinuz
+	install -d ${HDDDIR}
+	install -m 0644 ${STAGING_DIR}/${MACHINE}${HOST_VENDOR}-${HOST_OS}/kernel/bzImage \
+	${HDDDIR}/vmlinuz
 
 	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then 
-    		install -m 0644 ${INITRD} ${BDIR}/initrd
+    		install -m 0644 ${INITRD} ${HDDDIR}/initrd
 	fi
 
 	install -m 444 ${STAGING_DIR}/${BUILD_SYS}/share/syslinux/ldlinux.sys \
-	${BDIR}/ldlinux.sys
+	${HDDDIR}/ldlinux.sys
 
 	# Do a little math, bash style
-	#BLOCKS=`du -s ${BDIR} | cut -f 1`
-	BLOCKS=`du -bks ${BDIR} | cut -f 1`
+	#BLOCKS=`du -s ${HDDDIR} | cut -f 1`
+	BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
 	SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`	
 
-	mkdosfs -F 12 -n ${BOOTIMG_VOLUME_ID} -d ${BDIR} \
-	-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-boot.bin $SIZE 
+	mkdosfs -F 12 -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
+	-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE 
 
-	syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-boot.bin
+	syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+	chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
 
 	#Create an ISO if we have an INITRD
 	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
@@ -54,12 +61,12 @@ build_boot_bin() {
 
 		# Install the kernel
 
-		install -m 0644 ${STAGING_KERNEL_DIR}/bzImage \
+		install -m 0644 ${STAGING_DIR}/${MACHINE}${HOST_VENDOR}-${HOST_OS}/kernel/bzImage \
 		        ${ISODIR}/vmlinuz
 
 		# Install the configuration files
 
-		cp ${BDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
+		cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
 
 		if [ -f ${SYSLINUXMENU} ]; then
 			cp ${SYSLINUXMENU} ${ISODIR}
@@ -75,14 +82,12 @@ build_boot_bin() {
 		-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 \
-		${IMAGE_ROOTFS}
+		${S}/cd/
 	fi
 } 
 
 python do_bootimg() {
-	docfg = bb.data.getVar('AUTO_SYSLINUXCFG', d, 1)
-	if docfg:
-		bb.build.exec_func('build_syslinux_cfg', d)
+	bb.build.exec_func('build_syslinux_cfg', d)
 	bb.build.exec_func('build_boot_bin', d)
 }
 






More information about the Openembedded-commits mailing list