Patchwork [1/1] qemugl: make postinst run at first boot

login
register
mail settings
Submitter Scott Garman
Date April 17, 2012, 11:33 p.m.
Message ID <41a0ab8337b5d29e4fe1d114bf678cb601956e1e.1334705370.git.scott.a.garman@intel.com>
Download mbox | patch
Permalink /patch/26109/
State New
Headers show

Comments

Scott Garman - April 17, 2012, 11:33 p.m.
The previous postinst script was not working for images which use
RPM because do_rootfs could allow qemugl to be installed after
libgl1, and the postinst needs to run after libgl1 is installed.

Hence, it's being changed to run at first boot instead of during
do_rootfs.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
 meta/recipes-graphics/mesa/qemugl_git.bb |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
Henning Heinold - April 18, 2012, 8:15 a.m.
On Tue, Apr 17, 2012 at 04:33:29PM -0700, Scott Garman wrote:
> The previous postinst script was not working for images which use
> RPM because do_rootfs could allow qemugl to be installed after
> libgl1, and the postinst needs to run after libgl1 is installed.
> 
> Hence, it's being changed to run at first boot instead of during
> do_rootfs.
> 
> Signed-off-by: Scott Garman <scott.a.garman@intel.com>
> ---
>  meta/recipes-graphics/mesa/qemugl_git.bb |   16 +++++++++++-----
>  1 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/recipes-graphics/mesa/qemugl_git.bb b/meta/recipes-graphics/mesa/qemugl_git.bb
> index 378aa65..32980d3 100644
> --- a/meta/recipes-graphics/mesa/qemugl_git.bb
> +++ b/meta/recipes-graphics/mesa/qemugl_git.bb
> @@ -19,7 +19,7 @@ S = "${WORKDIR}/git"
>  SRCREV = "d888bbc723c00d197d34a39b5b7448660ec1b1c0"
>  
>  PV = "0.0+git${SRCPV}"
> -PR = "r10"
> +PR = "r11"
>  
>  DEFAULT_PREFERENCE = "-1"
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Is this still needed?

Bye Henning

Patch

diff --git a/meta/recipes-graphics/mesa/qemugl_git.bb b/meta/recipes-graphics/mesa/qemugl_git.bb
index 378aa65..32980d3 100644
--- a/meta/recipes-graphics/mesa/qemugl_git.bb
+++ b/meta/recipes-graphics/mesa/qemugl_git.bb
@@ -19,7 +19,7 @@  S = "${WORKDIR}/git"
 SRCREV = "d888bbc723c00d197d34a39b5b7448660ec1b1c0"
 
 PV = "0.0+git${SRCPV}"
-PR = "r10"
+PR = "r11"
 
 DEFAULT_PREFERENCE = "-1"
 
@@ -34,11 +34,17 @@  do_install () {
     fi
 }
 
+# This cannot be converted to run at pacakge install time, because
+# it depends on being run after the libgl1 package is installed,
+# and RPM cannot guarantee the order of pacakge insallation.
 pkg_postinst_${PN} () {
-    if [ "${PN}" != "qemugl-nativesdk" ]; then
-        rm -f $D${libdir}/libGL.so.1.2
-        ln -s libGL-qemu.so.1.2 $D${libdir}/libGL.so.1.2
-    fi
+#!/bin/sh -e
+if [ x"$D" = "x" ]; then
+	rm -f ${libdir}/libGL.so.1.2
+	ln -s libGL-qemu.so.1.2 ${libdir}/libGL.so.1.2
+else
+	exit 1
+fi
 }
 
 BBCLASSEXTEND = "nativesdk"