Patchwork [1/4] bootimg.bbclass: add support to disable HDD image building

login
register
mail settings
Submitter Otavio Salvador
Date Oct. 21, 2011, 3:31 a.m.
Message ID <5980062f84b228fa8977cf3f14c064192ba91eee.1319167843.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/13655/
State Accepted
Commit 23c5a83e877efe6d86618898dd181bb75f44aa71
Headers show

Comments

Otavio Salvador - Oct. 21, 2011, 3:31 a.m.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 21 deletions(-)
Khem Raj - Oct. 21, 2011, 6:07 a.m.
On Thu, Oct 20, 2011 at 8:31 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
>  1 files changed, 23 insertions(+), 21 deletions(-)
>
> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
> index a5ba3cf..eecc2bf 100644
> --- a/meta/classes/bootimg.bbclass
> +++ b/meta/classes/bootimg.bbclass
> @@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu"
>  inherit syslinux
>
>  build_boot_bin() {
> -       install -d ${HDDDIR}
> -       install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
> -       ${HDDDIR}/vmlinuz
> +       # Create an HDD image
> +       if [ "${NOHDD}" != "1" ] ; then

please document this new variable NOHDD somewhere so people know how
and when to use it

> +               install -d ${HDDDIR}
> +               install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
> +               ${HDDDIR}/vmlinuz
>
> -       if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
> -               install -m 0644 ${INITRD} ${HDDDIR}/initrd
> -       fi
> +               if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
> +                               install -m 0644 ${INITRD} ${HDDDIR}/initrd
> +               fi
>
> -       if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
> -               install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
> -       fi
> +               if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
> +                               install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
> +               fi
>
> -       install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
> +               install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
>
> -       # Do a little math, bash style
> -       #BLOCKS=`du -s ${HDDDIR} | cut -f 1`
> -       BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
> -       SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
> +               # Do a little math, bash style
> +               BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
> +               SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
>
> -       mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
> -       -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
> +               mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
> +               -C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
>
> -       syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
> -       chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
> +               syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
> +               chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
>
> -       cd ${DEPLOY_DIR_IMAGE}
> -       rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
> -       ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
> +               cd ${DEPLOY_DIR_IMAGE}
> +               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
> --
> 1.7.2.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Otavio Salvador - Oct. 21, 2011, 12:27 p.m.
On Fri, Oct 21, 2011 at 04:07, Khem Raj <raj.khem@gmail.com> wrote:
> On Thu, Oct 20, 2011 at 8:31 PM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
>>  1 files changed, 23 insertions(+), 21 deletions(-)
>>
>> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
>> index a5ba3cf..eecc2bf 100644
>> --- a/meta/classes/bootimg.bbclass
>> +++ b/meta/classes/bootimg.bbclass
>> @@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu"
>>  inherit syslinux
>>
>>  build_boot_bin() {
>> -       install -d ${HDDDIR}
>> -       install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
>> -       ${HDDDIR}/vmlinuz
>> +       # Create an HDD image
>> +       if [ "${NOHDD}" != "1" ] ; then
>
> please document this new variable NOHDD somewhere so people know how
> and when to use it

What do you suggests.
Khem Raj - Oct. 21, 2011, 3:57 p.m.
On Fri, Oct 21, 2011 at 5:27 AM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Fri, Oct 21, 2011 at 04:07, Khem Raj <raj.khem@gmail.com> wrote:
>> On Thu, Oct 20, 2011 at 8:31 PM, Otavio Salvador
>> <otavio@ossystems.com.br> wrote:
>>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>>> ---
>>>  meta/classes/bootimg.bbclass |   44 +++++++++++++++++++++--------------------
>>>  1 files changed, 23 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
>>> index a5ba3cf..eecc2bf 100644
>>> --- a/meta/classes/bootimg.bbclass
>>> +++ b/meta/classes/bootimg.bbclass
>>> @@ -48,34 +48,36 @@ SYSLINUXMENU = "${HDDDIR}/menu"
>>>  inherit syslinux
>>>
>>>  build_boot_bin() {
>>> -       install -d ${HDDDIR}
>>> -       install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
>>> -       ${HDDDIR}/vmlinuz
>>> +       # Create an HDD image
>>> +       if [ "${NOHDD}" != "1" ] ; then
>>
>> please document this new variable NOHDD somewhere so people know how
>> and when to use it
>
> What do you suggests.

Either OE manual or local.conf.sample.extended may be

>
> --
> Otavio Salvador                             O.S. Systems
> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>

Patch

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index a5ba3cf..eecc2bf 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -48,34 +48,36 @@  SYSLINUXMENU = "${HDDDIR}/menu"
 inherit syslinux
 		
 build_boot_bin() {
-	install -d ${HDDDIR}
-	install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
-	${HDDDIR}/vmlinuz
+	# Create an HDD image
+	if [ "${NOHDD}" != "1" ] ; then
+		install -d ${HDDDIR}
+		install -m 0644 ${STAGING_DIR_HOST}/kernel/bzImage \
+		${HDDDIR}/vmlinuz
 
-	if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then 
-    		install -m 0644 ${INITRD} ${HDDDIR}/initrd
-	fi
+		if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
+				install -m 0644 ${INITRD} ${HDDDIR}/initrd
+		fi
 
-	if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then 
-    		install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
-	fi
+		if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+				install -m 0644 ${ROOTFS} ${HDDDIR}/rootfs.img
+		fi
 
-	install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
+		install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
 
-	# Do a little math, bash style
-	#BLOCKS=`du -s ${HDDDIR} | cut -f 1`
-	BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
-	SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`	
+		# Do a little math, bash style
+		BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
+		SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
 
-	mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
-	-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE 
+		mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
+		-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
 
-	syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-	chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+		syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+		chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
 
-	cd ${DEPLOY_DIR_IMAGE}
-	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
-	ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
+		cd ${DEPLOY_DIR_IMAGE}
+		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