Skip to contentSkip to conversation

boot-directdisk: add the support of vmdk

PATCH In review Zhu Yanjun 2 participants 2 messages Dec 4, 2013 – Dec 13, 2013

lore
Share & tools
lore

Zhu Yanjun

author
#0 lore raw

PATCH 1/1 boot-directdisk: add the support of vmdk

---
 meta/classes/boot-directdisk.bbclass |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
meta/classes/boot-directdisk.bbclass +19 -5
index 5535728..b2bd210 100644
@@ -88,6 +88,15 @@ build_boot_dd() {
 		grubefi_hddimg_populate $HDDDIR
 	fi
 
+	if [ ${IMAGE_FSTYPE} = "vmdk" ]; then
+		if [ x${AUTO_SYSLINUXMENU} = x1 ] ; then
+			install -m 0644 ${STAGING_DIR}/${MACHINE}/usr/share/syslinux/vesamenu.c32 ${HDDDIR}${SYSLINUXDIR}/vesamenu.c32
+			if [ x${SYSLINUX_SPLASH} != x ] ; then
+				install -m 0644 ${SYSLINUX_SPLASH} ${HDDDIR}${SYSLINUXDIR}/splash.lss
+			fi
+		fi
+	fi
+
 	BLOCKS=`du -bks $HDDDIR | cut -f 1`
 	BLOCKS=`expr $BLOCKS + ${BOOTDD_EXTRA_SPACE}`
 
@@ -119,17 +128,22 @@ build_boot_dd() {
 	parted $IMAGE mkpart primary fat16 0 ${END1}B
 	parted $IMAGE unit B mkpart primary ext2 ${END2}B ${END3}B
 	parted $IMAGE set 1 boot on 
-	parted $IMAGE print
+
+	if [ ${IMAGE_FSTYPE} != "vmdk" ]; then
+		parted $IMAGE print
+	fi
 
 	awk "BEGIN { printf \"$(echo ${DISK_SIGNATURE} | fold -w 2 | tac | paste -sd '' | sed 's/\(..\)/\\x&/g')\" }" | \
 		dd of=$IMAGE bs=1 seek=440 conv=notrunc
 
 	OFFSET=`expr $END2 / 512`
-	if [ "${PCBIOS}" = "1" ]; then
-		dd if=${STAGING_DATADIR}/syslinux/mbr.bin of=$IMAGE conv=notrunc
+	if [ ${IMAGE_FSTYPE} != "vmdk" ]; then
+		if [ "${PCBIOS}" = "1" ]; then
+			dd if=${STAGING_DATADIR}/syslinux/mbr.bin of=$IMAGE conv=notrunc
+		fi
+		dd if=$HDDIMG of=$IMAGE conv=notrunc seek=1 bs=512
 	fi
-	dd if=$HDDIMG of=$IMAGE conv=notrunc seek=1 bs=512
-	dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512	
+	dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512      
 
 	cd ${DEPLOY_DIR_IMAGE}
 	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
Signature · 1 line
1.7.9.5
#1 lore raw

Hi,

Is ${IMAGE_FSTYPE} correct?

I can't find this variable.

Maybe IMAGE_FSTYPES ?

Thanks.

Quoted 67 lines · Zhu Yanjun
---
 meta/classes/boot-directdisk.bbclass |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
meta/classes/boot-directdisk.bbclass +3 -0
index 5535728..b2bd210 100644
@@ -88,6 +88,15 @@ build_boot_dd() {
                grubefi_hddimg_populate $HDDDIR
        fi
 
+       if [ ${IMAGE_FSTYPE} = "vmdk" ]; then
+               if [ x${AUTO_SYSLINUXMENU} = x1 ] ; then
+                       install -m 0644

${STAGING_DIR}/${MACHINE}/usr/share/syslinux/vesamenu.c32 ${HDDDIR}${SYSLINUXDIR}/vesamenu.c32

meta/classes/boot-directdisk.bbclass +2 -0
+                       if [ x${SYSLINUX_SPLASH} != x ] ; then
+                               install -m 0644 ${SYSLINUX_SPLASH}

${HDDDIR}${SYSLINUXDIR}/splash.lss

meta/classes/boot-directdisk.bbclass +8 -3
+                       fi
+               fi
+       fi
+
        BLOCKS=`du -bks $HDDDIR | cut -f 1`
        BLOCKS=`expr $BLOCKS + ${BOOTDD_EXTRA_SPACE}`
@@ -119,17 +128,22 @@ build_boot_dd() {
        parted $IMAGE mkpart primary fat16 0 ${END1}B
        parted $IMAGE unit B mkpart primary ext2 ${END2}B ${END3}B
        parted $IMAGE set 1 boot on
-       parted $IMAGE print
+
+       if [ ${IMAGE_FSTYPE} != "vmdk" ]; then
+               parted $IMAGE print
+       fi
 
        awk "BEGIN { printf \"$(echo ${DISK_SIGNATURE} | fold -w 2 | tac |
 paste -sd '' | sed 's/\(..\)/\\x&/g')\" }" | \
                dd of=$IMAGE bs=1 seek=440 conv=notrunc
 
        OFFSET=`expr $END2 / 512`
-       if [ "${PCBIOS}" = "1" ]; then
-               dd if=${STAGING_DATADIR}/syslinux/mbr.bin of=$IMAGE

conv=notrunc

meta/classes/boot-directdisk.bbclass +3 -0
+       if [ ${IMAGE_FSTYPE} != "vmdk" ]; then
+               if [ "${PCBIOS}" = "1" ]; then
+                       dd if=${STAGING_DATADIR}/syslinux/mbr.bin

of=$IMAGE conv=notrunc

meta/classes/boot-directdisk.bbclass +3 -3
+               fi
+               dd if=$HDDIMG of=$IMAGE conv=notrunc seek=1 bs=512
        fi
-       dd if=$HDDIMG of=$IMAGE conv=notrunc seek=1 bs=512
-       dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512
+       dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512
 
        cd ${DEPLOY_DIR_IMAGE}
        rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
--

1.7.9.5

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
João Henrique Ferreira de Freitas - joaohf_at_gmail.com
Campinas-SP-Brasil