Patchwork [1/8] rootfs_rpm: Add 50Meg to image size for zypper

login
register
mail settings
Submitter Saul Wold
Date July 7, 2011, 11:31 p.m.
Message ID <c55e57619344a0ddff4444e1a4403c9516089e5b.1310081443.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/7199/
State New, archived
Headers show

Comments

Saul Wold - July 7, 2011, 11:31 p.m.
[YOCTO #1171]

Add /var space for zypper due to its space usage for db maintence

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/classes/image_types.bbclass |    2 +-
 meta/classes/rootfs_rpm.bbclass  |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)
Richard Purdie - July 7, 2011, 11:38 p.m.
On Thu, 2011-07-07 at 16:31 -0700, Saul Wold wrote:
> [YOCTO #1171]
> 
> Add /var space for zypper due to its space usage for db maintence

This hasn't been tested for opkg/deb and is missing something like:

ZYPPER_VAR_DB_SPACE ??= 0

I'd suggest we just change this to append " + 51200" to
IMAGE_ROOTFS_EXTRA_SPACE. I'd also like this only to happen when we're
actually installing zypper so the minimal images are unaffected...

Cheers,

Richard





> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>  meta/classes/image_types.bbclass |    2 +-
>  meta/classes/rootfs_rpm.bbclass  |    5 +++++
>  2 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> index 8c86227..505342d 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -13,7 +13,7 @@ def get_imagecmds(d):
>  
>  runimagecmd () {
>  	# Image generation code for image type ${type}
> -	ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_EXTRA_SPACE}; OFMT = "%.0f" ; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
> +	ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_EXTRA_SPACE} + ${ZYPPER_VAR_DB_SPACE}; OFMT = "%.0f" ; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
>  	${cmd}
>  	cd ${DEPLOY_DIR_IMAGE}/
>  	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}
> diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
> index 3a11858..67c547f 100644
> --- a/meta/classes/rootfs_rpm.bbclass
> +++ b/meta/classes/rootfs_rpm.bbclass
> @@ -3,6 +3,10 @@
>  #
>  
>  ROOTFS_PKGMANAGE = "rpm zypper"
> +
> +# Add 50Meg of extra space for zypper database space
> +ZYPPER_VAR_DB_SPACE = "51200"
> +
>  # Postinstalls on device are handled within this class at present
>  ROOTFS_PKGMANAGE_BOOTSTRAP = ""
>  
> @@ -101,6 +105,7 @@ EOF
>  	export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
>  	export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
>  
> +
>  	${ROOTFS_POSTINSTALL_COMMAND}
>  
>  	mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/
Saul Wold - July 8, 2011, 5:42 a.m.
On 07/07/2011 04:38 PM, Richard Purdie wrote:
> On Thu, 2011-07-07 at 16:31 -0700, Saul Wold wrote:
>> [YOCTO #1171]
>>
>> Add /var space for zypper due to its space usage for db maintence
>
> This hasn't been tested for opkg/deb and is missing something like:
>
> ZYPPER_VAR_DB_SPACE ??= 0
>
> I'd suggest we just change this to append " + 51200" to
> IMAGE_ROOTFS_EXTRA_SPACE. I'd also like this only to happen when we're
> actually installing zypper so the minimal images are unaffected...
>
I can do the + 51200, but I have not figured out how to do the check for 
zypper, maybe it's something straight forward, but I am not finding a 
way to do it easily.

Sau!

> Cheers,
>
> Richard
>
>
>
>
>
>> Signed-off-by: Saul Wold<sgw@linux.intel.com>
>> ---
>>   meta/classes/image_types.bbclass |    2 +-
>>   meta/classes/rootfs_rpm.bbclass  |    5 +++++
>>   2 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
>> index 8c86227..505342d 100644
>> --- a/meta/classes/image_types.bbclass
>> +++ b/meta/classes/image_types.bbclass
>> @@ -13,7 +13,7 @@ def get_imagecmds(d):
>>
>>   runimagecmd () {
>>   	# Image generation code for image type ${type}
>> -	ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_EXTRA_SPACE}; OFMT = "%.0f" ; print (size>  ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
>> +	ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_EXTRA_SPACE} + ${ZYPPER_VAR_DB_SPACE}; OFMT = "%.0f" ; print (size>  ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
>>   	${cmd}
>>   	cd ${DEPLOY_DIR_IMAGE}/
>>   	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}
>> diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
>> index 3a11858..67c547f 100644
>> --- a/meta/classes/rootfs_rpm.bbclass
>> +++ b/meta/classes/rootfs_rpm.bbclass
>> @@ -3,6 +3,10 @@
>>   #
>>
>>   ROOTFS_PKGMANAGE = "rpm zypper"
>> +
>> +# Add 50Meg of extra space for zypper database space
>> +ZYPPER_VAR_DB_SPACE = "51200"
>> +
>>   # Postinstalls on device are handled within this class at present
>>   ROOTFS_PKGMANAGE_BOOTSTRAP = ""
>>
>> @@ -101,6 +105,7 @@ EOF
>>   	export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
>>   	export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
>>
>> +
>>   	${ROOTFS_POSTINSTALL_COMMAND}
>>
>>   	mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Richard Purdie - July 8, 2011, 2:52 p.m.
On Thu, 2011-07-07 at 22:42 -0700, Saul Wold wrote:
> On 07/07/2011 04:38 PM, Richard Purdie wrote:
> > On Thu, 2011-07-07 at 16:31 -0700, Saul Wold wrote:
> >> [YOCTO #1171]
> >>
> >> Add /var space for zypper due to its space usage for db maintence
> >
> > This hasn't been tested for opkg/deb and is missing something like:
> >
> > ZYPPER_VAR_DB_SPACE ??= 0
> >
> > I'd suggest we just change this to append " + 51200" to
> > IMAGE_ROOTFS_EXTRA_SPACE. I'd also like this only to happen when we're
> > actually installing zypper so the minimal images are unaffected...
> >
> I can do the + 51200, but I have not figured out how to do the check for 
> zypper, maybe it's something straight forward, but I am not finding a 
> way to do it easily.

How about something like:

IMAGE_ROOTFS_EXTRA_SPACE += "${@base_contains("PACKAGE_INSTALL", "zypper", " + 51200", "" ,d)}"

?

Not perfect but should basically work for what we need until we find a
bettr fix for zypper itself.

Cheers,

Richard

Patch

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 8c86227..505342d 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -13,7 +13,7 @@  def get_imagecmds(d):
 
 runimagecmd () {
 	# Image generation code for image type ${type}
-	ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_EXTRA_SPACE}; OFMT = "%.0f" ; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
+	ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_EXTRA_SPACE} + ${ZYPPER_VAR_DB_SPACE}; OFMT = "%.0f" ; print (size > ${IMAGE_ROOTFS_SIZE} ? size : ${IMAGE_ROOTFS_SIZE}) }'`
 	${cmd}
 	cd ${DEPLOY_DIR_IMAGE}/
 	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.${type}
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 3a11858..67c547f 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -3,6 +3,10 @@ 
 #
 
 ROOTFS_PKGMANAGE = "rpm zypper"
+
+# Add 50Meg of extra space for zypper database space
+ZYPPER_VAR_DB_SPACE = "51200"
+
 # Postinstalls on device are handled within this class at present
 ROOTFS_PKGMANAGE_BOOTSTRAP = ""
 
@@ -101,6 +105,7 @@  EOF
 	export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
 	export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
 
+
 	${ROOTFS_POSTINSTALL_COMMAND}
 
 	mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/