All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location
@ 2015-09-04 12:22 Martin Jansa
  2015-09-04 12:22 ` [RFC][PATCH 2/3] postinst_intercept: allow to pass variables with spaces Martin Jansa
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Martin Jansa @ 2015-09-04 12:22 UTC (permalink / raw)
  To: openembedded-core

* useful when we need to overlay/extend intercept scripts from oe-core

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/lib/oe/rootfs.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index c29843b..76950ec 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -164,6 +164,9 @@ class Rootfs(object):
         pre_process_cmds = self.d.getVar("ROOTFS_PREPROCESS_COMMAND", True)
         post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND", True)
 
+        postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR", True)
+        if not postinst_intercepts_dir:
+            postinst_intercepts_dir = self.d.expand("${COREBASE}/scripts/postinst-intercepts")
         intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
                                       "intercept_scripts")
 
@@ -173,8 +176,7 @@ class Rootfs(object):
 
         bb.utils.mkdirhier(self.deploy_dir_image)
 
-        shutil.copytree(self.d.expand("${COREBASE}/scripts/postinst-intercepts"),
-                        intercepts_dir)
+        shutil.copytree(postinst_intercepts_dir, intercepts_dir)
 
         shutil.copy(self.d.expand("${COREBASE}/meta/files/deploydir_readme.txt"),
                     self.deploy_dir_image +
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC][PATCH 2/3] postinst_intercept: allow to pass variables with spaces
  2015-09-04 12:22 [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
@ 2015-09-04 12:22 ` Martin Jansa
  2015-09-04 12:22 ` [RFC][PATCH 3/3] fontcache: allow to pass extra parameters and environment to fc-cache Martin Jansa
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Martin Jansa @ 2015-09-04 12:22 UTC (permalink / raw)
  To: openembedded-core

* trying to pass foo="a b" through postinst_intercept ends
  with the actual script header to containing:
  b
  foo=a
  which fails because "b" command doesn't exist.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 scripts/postinst-intercepts/postinst_intercept | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/postinst-intercepts/postinst_intercept b/scripts/postinst-intercepts/postinst_intercept
index a257198..b18e806 100755
--- a/scripts/postinst-intercepts/postinst_intercept
+++ b/scripts/postinst-intercepts/postinst_intercept
@@ -48,7 +48,7 @@ if [ -n "$pkgs_line" ]; then
 		sed -i -e "s/##PKGS:.*/\0${package_name} /" $intercept_script
 	fi
 else
-	for var in $@; do
+	for var in "$@"; do
 		sed -i -e "\%^#\!/bin/.*sh%a $var" $intercept_script
 	done
 	echo "##PKGS: ${package_name} " >> $intercept_script
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC][PATCH 3/3] fontcache: allow to pass extra parameters and environment to fc-cache
  2015-09-04 12:22 [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
  2015-09-04 12:22 ` [RFC][PATCH 2/3] postinst_intercept: allow to pass variables with spaces Martin Jansa
@ 2015-09-04 12:22 ` Martin Jansa
  2015-09-10 14:31   ` [PATCHv2] " Martin Jansa
  2015-09-04 12:27 ` [RFC][dizzy][fido][master][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Martin Jansa @ 2015-09-04 12:22 UTC (permalink / raw)
  To: openembedded-core

* this can be useful for passing extra parameters, pass
  -v by default to see what's going on in do_rootfs
* we need to use this for extra parameter we implemented
  in fontconfig:
  --ignore-mtime always use cache file regardless of font directory mtime
  because the checksum of fontcache generated in do_rootfs
  doesn't match with /usr/share/fonts directory as seen on
  target device causing fontconfig to re-create the cache
  when fontconfig is used for first time or worse create
  new cache in every user's home directory when /usr/
  filesystem is read only and cache cannot be updated.

  Running FC_DEBUG=16 fc-cache -v on such device shows:
  FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1441207803 dir checksum 1441206149
* my guess is that the checksum is different, because pseudo
  (which is unloaded when running qemuwrapper) or because some
  influence of running the rootfs under qemu.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/fontcache.bbclass                | 19 +++++++++++++++----
 scripts/postinst-intercepts/update_font_cache |  4 ++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
index d122387..1dd1418 100644
--- a/meta/classes/fontcache.bbclass
+++ b/meta/classes/fontcache.bbclass
@@ -9,12 +9,23 @@ inherit qemu
 FONT_PACKAGES ??= "${PN}"
 FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
 FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+FONTCONFIG_CACHE_PARAMS ?= "-v"
+# You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues,
+# something has to be set, because qemuwrapper is using this variable after -E
+# multiple variables aren't allowed because for qemu they are separated
+# by comma and in -n "$D" case they should be separated by space
+FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
 fontcache_common() {
-if [ "x$D" != "x" ] ; then
-	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
-		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
+if [ -n "$D" ] ; then
+	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} \
+		'bindir="${bindir}'" \
+		'libdir="${libdir}'" \
+		'base_libdir="${base_libdir}'" \
+		'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}'" \
+		'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}'" \
+		'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}'"
 else
-	fc-cache
+	${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
 fi
 }
 
diff --git a/scripts/postinst-intercepts/update_font_cache b/scripts/postinst-intercepts/update_font_cache
index c8c6018..0deab3c 100644
--- a/scripts/postinst-intercepts/update_font_cache
+++ b/scripts/postinst-intercepts/update_font_cache
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
-					$D${bindir}/fc-cache --sysroot=$D
+PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir} \
+					-E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D ${fontconfigcacheparams}
 chown -R root:root $D${fontconfigcachedir}
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [RFC][dizzy][fido][master][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location
  2015-09-04 12:22 [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
  2015-09-04 12:22 ` [RFC][PATCH 2/3] postinst_intercept: allow to pass variables with spaces Martin Jansa
  2015-09-04 12:22 ` [RFC][PATCH 3/3] fontcache: allow to pass extra parameters and environment to fc-cache Martin Jansa
@ 2015-09-04 12:27 ` Martin Jansa
  2015-09-10 16:07   ` akuster808
  2015-09-04 18:56 ` [RFC][PATCH] rootfs.py: show intercept script output in log.do_rootfs Martin Jansa
  2015-09-15 16:04 ` [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Joshua Lock
  4 siblings, 1 reply; 10+ messages in thread
From: Martin Jansa @ 2015-09-04 12:27 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1848 bytes --]

On Fri, Sep 04, 2015 at 02:22:26PM +0200, Martin Jansa wrote:
> * useful when we need to overlay/extend intercept scripts from oe-core

2/3 and 3/3 could be a bit dangerous or controversial (main reason why
this was sent as RFC), but this one is really useful for us to apply
these fixes in advance (and without backporting them all to fido and
dizzy) - so if you agree please merge 1/3 to master, fido and dizzy.

> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/lib/oe/rootfs.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index c29843b..76950ec 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -164,6 +164,9 @@ class Rootfs(object):
>          pre_process_cmds = self.d.getVar("ROOTFS_PREPROCESS_COMMAND", True)
>          post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND", True)
>  
> +        postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR", True)
> +        if not postinst_intercepts_dir:
> +            postinst_intercepts_dir = self.d.expand("${COREBASE}/scripts/postinst-intercepts")
>          intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
>                                        "intercept_scripts")
>  
> @@ -173,8 +176,7 @@ class Rootfs(object):
>  
>          bb.utils.mkdirhier(self.deploy_dir_image)
>  
> -        shutil.copytree(self.d.expand("${COREBASE}/scripts/postinst-intercepts"),
> -                        intercepts_dir)
> +        shutil.copytree(postinst_intercepts_dir, intercepts_dir)
>  
>          shutil.copy(self.d.expand("${COREBASE}/meta/files/deploydir_readme.txt"),
>                      self.deploy_dir_image +
> -- 
> 2.5.0
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [RFC][PATCH] rootfs.py: show intercept script output in log.do_rootfs
  2015-09-04 12:22 [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
                   ` (2 preceding siblings ...)
  2015-09-04 12:27 ` [RFC][dizzy][fido][master][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
@ 2015-09-04 18:56 ` Martin Jansa
  2015-09-15 16:04 ` [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Joshua Lock
  4 siblings, 0 replies; 10+ messages in thread
From: Martin Jansa @ 2015-09-04 18:56 UTC (permalink / raw)
  To: openembedded-core

* without this the output wasn't shown anywhere even when the bb.warn
  says:
  "See log for details!"

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/lib/oe/rootfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 76950ec..2372226 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -279,7 +279,7 @@ class Rootfs(object):
             bb.note("> Executing %s intercept ..." % script)
 
             try:
-                subprocess.check_output(script_full)
+                subprocess.check_call(script_full)
             except subprocess.CalledProcessError as e:
                 bb.warn("The postinstall intercept hook '%s' failed (exit code: %d)! See log for details!" %
                         (script, e.returncode))
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCHv2] fontcache: allow to pass extra parameters and environment to fc-cache
  2015-09-04 12:22 ` [RFC][PATCH 3/3] fontcache: allow to pass extra parameters and environment to fc-cache Martin Jansa
@ 2015-09-10 14:31   ` Martin Jansa
  2015-09-29 15:50     ` Martin Jansa
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Jansa @ 2015-09-10 14:31 UTC (permalink / raw)
  To: openembedded-core

* this can be useful for passing extra parameters, pass
  -v by default to see what's going on in do_rootfs
* we need to use this for extra parameter we implemented
  in fontconfig:
  --ignore-mtime always use cache file regardless of font directory mtime
  because the checksum of fontcache generated in do_rootfs
  doesn't match with /usr/share/fonts directory as seen on
  target device causing fontconfig to re-create the cache
  when fontconfig is used for first time or worse create
  new cache in every user's home directory when /usr/
  filesystem is read only and cache cannot be updated.

  Running FC_DEBUG=16 fc-cache -v on such device shows:
  FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1441207803 dir checksum 1441206149
* my guess is that the checksum is different, because pseudo
  (which is unloaded when running qemuwrapper) or because some
  influence of running the rootfs under qemu.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/fontcache.bbclass                | 19 +++++++++++++++----
 scripts/postinst-intercepts/update_font_cache |  4 ++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
index d122387..8ebdfc4 100644
--- a/meta/classes/fontcache.bbclass
+++ b/meta/classes/fontcache.bbclass
@@ -9,12 +9,23 @@ inherit qemu
 FONT_PACKAGES ??= "${PN}"
 FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
 FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+FONTCONFIG_CACHE_PARAMS ?= "-v"
+# You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues,
+# something has to be set, because qemuwrapper is using this variable after -E
+# multiple variables aren't allowed because for qemu they are separated
+# by comma and in -n "$D" case they should be separated by space
+FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
 fontcache_common() {
-if [ "x$D" != "x" ] ; then
-	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
-		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
+if [ -n "$D" ] ; then
+	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} \
+		'bindir="${bindir}"' \
+		'libdir="${libdir}"' \
+		'base_libdir="${base_libdir}"' \
+		'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
+		'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
+		'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
 else
-	fc-cache
+	${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
 fi
 }
 
diff --git a/scripts/postinst-intercepts/update_font_cache b/scripts/postinst-intercepts/update_font_cache
index c8c6018..0deab3c 100644
--- a/scripts/postinst-intercepts/update_font_cache
+++ b/scripts/postinst-intercepts/update_font_cache
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
-					$D${bindir}/fc-cache --sysroot=$D
+PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir} \
+					-E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D ${fontconfigcacheparams}
 chown -R root:root $D${fontconfigcachedir}
-- 
2.5.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [RFC][dizzy][fido][master][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location
  2015-09-04 12:27 ` [RFC][dizzy][fido][master][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
@ 2015-09-10 16:07   ` akuster808
  0 siblings, 0 replies; 10+ messages in thread
From: akuster808 @ 2015-09-10 16:07 UTC (permalink / raw)
  To: Martin Jansa, openembedded-core

All 3 in master so backporting to Dizzy.

- armin

On 09/04/2015 05:27 AM, Martin Jansa wrote:
> On Fri, Sep 04, 2015 at 02:22:26PM +0200, Martin Jansa wrote:
>> * useful when we need to overlay/extend intercept scripts from oe-core
> 
> 2/3 and 3/3 could be a bit dangerous or controversial (main reason why
> this was sent as RFC), but this one is really useful for us to apply
> these fixes in advance (and without backporting them all to fido and
> dizzy) - so if you agree please merge 1/3 to master, fido and dizzy.
> 
>> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
>> ---
>>  meta/lib/oe/rootfs.py | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
>> index c29843b..76950ec 100644
>> --- a/meta/lib/oe/rootfs.py
>> +++ b/meta/lib/oe/rootfs.py
>> @@ -164,6 +164,9 @@ class Rootfs(object):
>>          pre_process_cmds = self.d.getVar("ROOTFS_PREPROCESS_COMMAND", True)
>>          post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND", True)
>>  
>> +        postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR", True)
>> +        if not postinst_intercepts_dir:
>> +            postinst_intercepts_dir = self.d.expand("${COREBASE}/scripts/postinst-intercepts")
>>          intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
>>                                        "intercept_scripts")
>>  
>> @@ -173,8 +176,7 @@ class Rootfs(object):
>>  
>>          bb.utils.mkdirhier(self.deploy_dir_image)
>>  
>> -        shutil.copytree(self.d.expand("${COREBASE}/scripts/postinst-intercepts"),
>> -                        intercepts_dir)
>> +        shutil.copytree(postinst_intercepts_dir, intercepts_dir)
>>  
>>          shutil.copy(self.d.expand("${COREBASE}/meta/files/deploydir_readme.txt"),
>>                      self.deploy_dir_image +
>> -- 
>> 2.5.0
>>
> 
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location
  2015-09-04 12:22 [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
                   ` (3 preceding siblings ...)
  2015-09-04 18:56 ` [RFC][PATCH] rootfs.py: show intercept script output in log.do_rootfs Martin Jansa
@ 2015-09-15 16:04 ` Joshua Lock
  4 siblings, 0 replies; 10+ messages in thread
From: Joshua Lock @ 2015-09-15 16:04 UTC (permalink / raw)
  To: openembedded-core

On Fri, 2015-09-04 at 14:22 +0200, Martin Jansa wrote:
> * useful when we need to overlay/extend intercept scripts from oe
> -core
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

Patch queued in my joshuagl/fido-next tree - thanks!

Joshua

http://cgit.openembedded.org/openembedded-core-contrib/log/?h=joshuagl/
fido-next

> ---
>  meta/lib/oe/rootfs.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index c29843b..76950ec 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -164,6 +164,9 @@ class Rootfs(object):
>          pre_process_cmds =
> self.d.getVar("ROOTFS_PREPROCESS_COMMAND", True)
>          post_process_cmds =
> self.d.getVar("ROOTFS_POSTPROCESS_COMMAND", True)
>  
> +        postinst_intercepts_dir =
> self.d.getVar("POSTINST_INTERCEPTS_DIR", True)
> +        if not postinst_intercepts_dir:
> +            postinst_intercepts_dir =
> self.d.expand("${COREBASE}/scripts/postinst-intercepts")
>          intercepts_dir = os.path.join(self.d.getVar('WORKDIR',
> True),
>                                        "intercept_scripts")
>  
> @@ -173,8 +176,7 @@ class Rootfs(object):
>  
>          bb.utils.mkdirhier(self.deploy_dir_image)
>  
> -        shutil.copytree(self.d.expand("${COREBASE}/scripts/postinst
> -intercepts"),
> -                        intercepts_dir)
> +        shutil.copytree(postinst_intercepts_dir, intercepts_dir)
>  
>         
>  shutil.copy(self.d.expand("${COREBASE}/meta/files/deploydir_readme.t
> xt"),
>                      self.deploy_dir_image +
> -- 
> 2.5.0
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv2] fontcache: allow to pass extra parameters and environment to fc-cache
  2015-09-10 14:31   ` [PATCHv2] " Martin Jansa
@ 2015-09-29 15:50     ` Martin Jansa
  2015-10-14 14:37       ` Martin Jansa
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Jansa @ 2015-09-29 15:50 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 3719 bytes --]

On Thu, Sep 10, 2015 at 04:31:26PM +0200, Martin Jansa wrote:
> * this can be useful for passing extra parameters, pass
>   -v by default to see what's going on in do_rootfs
> * we need to use this for extra parameter we implemented
>   in fontconfig:
>   --ignore-mtime always use cache file regardless of font directory mtime
>   because the checksum of fontcache generated in do_rootfs
>   doesn't match with /usr/share/fonts directory as seen on
>   target device causing fontconfig to re-create the cache
>   when fontconfig is used for first time or worse create
>   new cache in every user's home directory when /usr/
>   filesystem is read only and cache cannot be updated.
> 
>   Running FC_DEBUG=16 fc-cache -v on such device shows:
>   FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1441207803 dir checksum 1441206149
> * my guess is that the checksum is different, because pseudo
>   (which is unloaded when running qemuwrapper) or because some
>   influence of running the rootfs under qemu.

ping

was this postponed to 2.0? Any feedback would be nice.

But thanks for applying the other 2, now we were able to implement this in our
layer with overlayed fontcache.bbclass and intercepts scripts.

> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/classes/fontcache.bbclass                | 19 +++++++++++++++----
>  scripts/postinst-intercepts/update_font_cache |  4 ++--
>  2 files changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
> index d122387..8ebdfc4 100644
> --- a/meta/classes/fontcache.bbclass
> +++ b/meta/classes/fontcache.bbclass
> @@ -9,12 +9,23 @@ inherit qemu
>  FONT_PACKAGES ??= "${PN}"
>  FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
>  FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
> +FONTCONFIG_CACHE_PARAMS ?= "-v"
> +# You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues,
> +# something has to be set, because qemuwrapper is using this variable after -E
> +# multiple variables aren't allowed because for qemu they are separated
> +# by comma and in -n "$D" case they should be separated by space
> +FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
>  fontcache_common() {
> -if [ "x$D" != "x" ] ; then
> -	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
> -		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
> +if [ -n "$D" ] ; then
> +	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} \
> +		'bindir="${bindir}"' \
> +		'libdir="${libdir}"' \
> +		'base_libdir="${base_libdir}"' \
> +		'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
> +		'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
> +		'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
>  else
> -	fc-cache
> +	${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
>  fi
>  }
>  
> diff --git a/scripts/postinst-intercepts/update_font_cache b/scripts/postinst-intercepts/update_font_cache
> index c8c6018..0deab3c 100644
> --- a/scripts/postinst-intercepts/update_font_cache
> +++ b/scripts/postinst-intercepts/update_font_cache
> @@ -1,5 +1,5 @@
>  #!/bin/sh
>  
> -PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
> -					$D${bindir}/fc-cache --sysroot=$D
> +PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir} \
> +					-E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D ${fontconfigcacheparams}
>  chown -R root:root $D${fontconfigcachedir}
> -- 
> 2.5.1
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv2] fontcache: allow to pass extra parameters and environment to fc-cache
  2015-09-29 15:50     ` Martin Jansa
@ 2015-10-14 14:37       ` Martin Jansa
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Jansa @ 2015-10-14 14:37 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 4020 bytes --]

On Tue, Sep 29, 2015 at 05:50:55PM +0200, Martin Jansa wrote:
> On Thu, Sep 10, 2015 at 04:31:26PM +0200, Martin Jansa wrote:
> > * this can be useful for passing extra parameters, pass
> >   -v by default to see what's going on in do_rootfs
> > * we need to use this for extra parameter we implemented
> >   in fontconfig:
> >   --ignore-mtime always use cache file regardless of font directory mtime
> >   because the checksum of fontcache generated in do_rootfs
> >   doesn't match with /usr/share/fonts directory as seen on
> >   target device causing fontconfig to re-create the cache
> >   when fontconfig is used for first time or worse create
> >   new cache in every user's home directory when /usr/
> >   filesystem is read only and cache cannot be updated.
> > 
> >   Running FC_DEBUG=16 fc-cache -v on such device shows:
> >   FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1441207803 dir checksum 1441206149
> > * my guess is that the checksum is different, because pseudo
> >   (which is unloaded when running qemuwrapper) or because some
> >   influence of running the rootfs under qemu.
> 
> ping
> 
> was this postponed to 2.0? Any feedback would be nice.
> 
> But thanks for applying the other 2, now we were able to implement this in our
> layer with overlayed fontcache.bbclass and intercepts scripts.

ping2

> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> >  meta/classes/fontcache.bbclass                | 19 +++++++++++++++----
> >  scripts/postinst-intercepts/update_font_cache |  4 ++--
> >  2 files changed, 17 insertions(+), 6 deletions(-)
> > 
> > diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
> > index d122387..8ebdfc4 100644
> > --- a/meta/classes/fontcache.bbclass
> > +++ b/meta/classes/fontcache.bbclass
> > @@ -9,12 +9,23 @@ inherit qemu
> >  FONT_PACKAGES ??= "${PN}"
> >  FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
> >  FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
> > +FONTCONFIG_CACHE_PARAMS ?= "-v"
> > +# You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues,
> > +# something has to be set, because qemuwrapper is using this variable after -E
> > +# multiple variables aren't allowed because for qemu they are separated
> > +# by comma and in -n "$D" case they should be separated by space
> > +FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
> >  fontcache_common() {
> > -if [ "x$D" != "x" ] ; then
> > -	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
> > -		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
> > +if [ -n "$D" ] ; then
> > +	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} \
> > +		'bindir="${bindir}"' \
> > +		'libdir="${libdir}"' \
> > +		'base_libdir="${base_libdir}"' \
> > +		'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
> > +		'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
> > +		'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
> >  else
> > -	fc-cache
> > +	${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
> >  fi
> >  }
> >  
> > diff --git a/scripts/postinst-intercepts/update_font_cache b/scripts/postinst-intercepts/update_font_cache
> > index c8c6018..0deab3c 100644
> > --- a/scripts/postinst-intercepts/update_font_cache
> > +++ b/scripts/postinst-intercepts/update_font_cache
> > @@ -1,5 +1,5 @@
> >  #!/bin/sh
> >  
> > -PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
> > -					$D${bindir}/fc-cache --sysroot=$D
> > +PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir} \
> > +					-E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D ${fontconfigcacheparams}
> >  chown -R root:root $D${fontconfigcachedir}
> > -- 
> > 2.5.1
> > 
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-10-14 14:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04 12:22 [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
2015-09-04 12:22 ` [RFC][PATCH 2/3] postinst_intercept: allow to pass variables with spaces Martin Jansa
2015-09-04 12:22 ` [RFC][PATCH 3/3] fontcache: allow to pass extra parameters and environment to fc-cache Martin Jansa
2015-09-10 14:31   ` [PATCHv2] " Martin Jansa
2015-09-29 15:50     ` Martin Jansa
2015-10-14 14:37       ` Martin Jansa
2015-09-04 12:27 ` [RFC][dizzy][fido][master][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Martin Jansa
2015-09-10 16:07   ` akuster808
2015-09-04 18:56 ` [RFC][PATCH] rootfs.py: show intercept script output in log.do_rootfs Martin Jansa
2015-09-15 16:04 ` [RFC][PATCH 1/3] rootfs.py: Allow to override postinst-intercepts location Joshua Lock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.