<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12896</bug_id>
          
          <creation_ts>2018-08-23 14:39:54 +0000</creation_ts>
          <short_desc>&quot;qemu udevadm hwdb&quot; called from postinst instead of using intercept mechanism</short_desc>
          <delta_ts>2019-11-07 15:48:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yann Dirson">ydirson</reporter>
          <assigned_to name="Yann Dirson">ydirson</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>81421</commentid>
    <comment_count>0</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2018-08-23 14:39:54 +0000</bug_when>
    <thetext>This looks as if it could make use of the postinst-intercept mechanism.  As, it forces to modify/bbappend each recipe (eudev, systemd) if one wants to change things (eg. when target is not fully supported by qemu).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81464</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2018-08-30 23:47:39 +0000</bug_when>
    <thetext>Yann,
  If you can, a patch sent to the oe-core list would be nice. 

If you aren&apos;t able to do that Qi will work on it next week or at least before 2.6-M4 as per Richard&apos;s request.

Let us know what the plan is please.

../Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81486</commentid>
    <comment_count>2</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-09-03 02:06:39 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Yann,
&gt;   If you can, a patch sent to the oe-core list would be nice. 
&gt; 
&gt; If you aren&apos;t able to do that Qi will work on it next week or at least
&gt; before 2.6-M4 as per Richard&apos;s request.
&gt; 
&gt; Let us know what the plan is please.
&gt; 
&gt; ../Randy

I&apos;ll check it late this week or early next week.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81487</commentid>
    <comment_count>3</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-09-03 07:54:46 +0000</bug_when>
    <thetext>I just take a quick look, I think things are OK ATM.

&quot;&quot;&quot;
PACKAGE_WRITE_DEPS += &quot;qemu-native&quot;
pkg_postinst_eudev-hwdb () {
    if test -n &quot;$D&quot;; then
        if ${@bb.utils.contains(&apos;MACHINE_FEATURES&apos;, &apos;qemu-usermode&apos;, &apos;true&apos;,&apos;false&apos;, d)}; then
            ${@qemu_run_binary(d, &apos;$D&apos;, &apos;${bindir}/udevadm&apos;)} hwdb --update --root $D
            chown root:root $D${sysconfdir}/udev/hwdb.bin
        else
            $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}
        fi
    else
        udevadm hwdb --update
    fi
}
&quot;&quot;&quot;

What&apos;s the actual problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81531</commentid>
    <comment_count>4</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2018-09-10 20:21:05 +0000</bug_when>
    <thetext>The yocto project provides the postinst-intercept framework to allow working around 
the readonly constraint.  Without knowing the rationale for this framework, the
main advantage I see is that it puts all such mechanism in one place, and as many
recipes can use it without code duplication.  Combined with the ability to override
the scripts with POSTINST_INTERCEPTS_DIR, it allows overriding an intercept rule only
once to benefit many packages (here udev and systemd).

As I understand it, that would basically be moving the &quot;then&quot; part of the postinst
into a new intercept scriptlet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81532</commentid>
    <comment_count>5</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-09-11 00:56:01 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; The yocto project provides the postinst-intercept framework to allow working
&gt; around 
&gt; the readonly constraint.  Without knowing the rationale for this framework,
&gt; the
&gt; main advantage I see is that it puts all such mechanism in one place, and as
&gt; many
&gt; recipes can use it without code duplication.  Combined with the ability to
&gt; override
&gt; the scripts with POSTINST_INTERCEPTS_DIR, it allows overriding an intercept
&gt; rule only
&gt; once to benefit many packages (here udev and systemd).
&gt; 
&gt; As I understand it, that would basically be moving the &quot;then&quot; part of the
&gt; postinst
&gt; into a new intercept scriptlet.

Please just send out a patch.
I don&apos;t understand what you are talking about.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81542</commentid>
    <comment_count>6</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-09-13 05:20:18 +0000</bug_when>
    <thetext>I personally don&apos;t think the current handling has problem.
Please double check it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81572</commentid>
    <comment_count>7</comment_count>
    <who name="Yann Dirson">ydirson</who>
    <bug_when>2018-09-18 19:36:50 +0000</bug_when>
    <thetext>I&apos;ll send a patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81772</commentid>
    <comment_count>8</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2018-10-05 17:24:46 +0000</bug_when>
    <thetext>It appears that Yann has accepted this, moving out of NEEDINFO.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82735</commentid>
    <comment_count>9</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2019-01-10 16:13:41 +0000</bug_when>
    <thetext>Yann, any update? Will you be able to work on this soon?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85489</commentid>
    <comment_count>10</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-11-07 15:48:07 +0000</bug_when>
    <thetext>The current systed postinst is:

pkg_postinst_udev-hwdb () {
	if test -n &quot;$D&quot;; then
		$INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
	else
		udevadm hwdb --update
	fi
}

And eudev:

PACKAGE_WRITE_DEPS += &quot;qemu-native&quot;
pkg_postinst_eudev-hwdb () {
    if test -n &quot;$D&quot;; then
        $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
    else
        udevadm hwdb --update
    fi
}

Fixed in oe-core d6b737a31a8842cdc770b05e28503c81a691d10d.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>