<div dir="ltr">An even easier solution would  be to use oe.path.join, which solely exists to join paths without the &quot;interesting&quot; absolute path quirk of os.path.join.<div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 8 December 2017 at 10:48, André Draszik <span dir="ltr">&lt;<a href="mailto:git@andred.net" target="_blank">git@andred.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, 2017-12-07 at 16:16 -0500, Gaël PORTAY wrote:<br>
&gt; The opkg custom config feature has moved to the package_manager python<br>
&gt; module. This feature is broken since commit 19c538f57c.<br>
&gt;<br>
&gt; The python function os.path.join joins path components. If a component<br>
&gt; is an absolute path, all previous components are thrown away.<br>
&gt;<br>
&gt; The sysconfdir variable is an absolute path component. It causes the<br>
&gt; leading target rootfs component to be removed. As a result, the<br>
&gt; package-manager module tries to write in the real root filesystem<br>
&gt; instead of the temporary work directory for the rootfs image.<br>
&gt;<br>
&gt; This fixes the issue by prepending the target rootfs component using the<br>
&gt; string concatenation operator when the file is opened (without using<br>
&gt; os.path module).<br>
&gt;<br>
&gt; Cc: Ash Charles &lt;<a href="mailto:ash.charles@savoirfairelinux.com">ash.charles@savoirfairelinux.<wbr>com</a>&gt;<br>
&gt; Signed-off-by: Gaël PORTAY &lt;<a href="mailto:gael.portay@savoirfairelinux.com">gael.portay@savoirfairelinux.<wbr>com</a>&gt;<br>
&gt; ---<br>
&gt;  meta/lib/oe/package_manager.py | 5 ++---<br>
&gt;  1 file changed, 2 insertions(+), 3 deletions(-)<br>
&gt;<br>
&gt; diff --git a/meta/lib/oe/package_manager.<wbr>py<br>
&gt; b/meta/lib/oe/package_manager.<wbr>py<br>
&gt; index 6cbb61fd84..ac29593f88 100644<br>
&gt; --- a/meta/lib/oe/package_manager.<wbr>py<br>
&gt; +++ b/meta/lib/oe/package_manager.<wbr>py<br>
&gt; @@ -953,12 +953,11 @@ class OpkgPM(OpkgDpkgPM):<br>
&gt;              &quot;&quot;&quot;<br>
&gt;              if (self.d.getVar(&#39;FEED_<wbr>DEPLOYDIR_BASE_URI&#39;) or &quot;&quot;) != &quot;&quot;:<br>
&gt;                  for arch in self.pkg_archs.split():<br>
&gt; -                    cfg_file_name = os.path.join(self.target_<wbr>rootfs,<br>
&gt; -                                                 self.d.getVar(&quot;sysconfdi<br>
&gt; r&quot;),<br>
&gt; +                    cfg_file_name =<br>
&gt; os.path.join(self.d.getVar(&quot;<wbr>sysconfdir&quot;, True),<br>
<br>
</div></div>The &#39;True&#39; argument has been removed from all getVar() calls, please don&#39;t<br>
re-introduce it.<br>
<span class=""><br>
<br>
&gt;                                                   &quot;opkg&quot;,<br>
&gt;                                                   &quot;local-%s-feed.conf&quot; %<br>
&gt; arch)<br>
&gt;<br>
&gt; -                    with open(cfg_file_name, &quot;w+&quot;) as cfg_file:<br>
&gt; +                    with open(self.target_rootfs + cfg_file_name, &quot;w+&quot;)<br>
&gt; as cfg_file:<br>
&gt;                          cfg_file.write(&quot;src/gz local-%s %s/%s&quot; %<br>
&gt;                                         (arch,<br>
&gt;                                          self.d.getVar(&#39;FEED_DEPLOYDIR_<wbr>BAS<br>
&gt; E_URI&#39;),<br>
&gt; --<br>
&gt; 2.15.0<br>
&gt;<br>
<br>
</span>Also, a simpler solution would be to simply strip the leading &#39;/&#39; from<br>
sysconfdir:<br>
<span class=""><br>
                     cfg_file_name = os.path.join(self.target_<wbr>rootfs,<br>
-                                                 self.d.getVar(&quot;sysconfdir&quot;),<br>
</span>+                                                 self.d.getVar(&quot;sysconfdir&quot;).<wbr>lstrip(&quot;/&quot;),<br>
<span class="">                                                  &quot;opkg&quot;,<br>
                                                  &quot;local-%s-feed.conf&quot; % arch)<br>
<br>
</span>would be the only change needed.<br>
<br>
<br>
Cheers,<br>
Andre&#39;<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</div></div></blockquote></div><br></div>