[Unstable][PATCH 1/6] UBUNTU: [Debian]: Remove hardcoded $(pkgdir) in debug symbols handling

Mauricio Faria de Oliveira mfo at canonical.com
Thu Sep 5 18:02:58 UTC 2019


On Thu, Sep 5, 2019 at 1:06 PM Seth Forshee <seth.forshee at canonical.com> wrote:
>
> On Wed, Aug 28, 2019 at 09:25:59AM -0300, Mauricio Faria de Oliveira wrote:
> > BugLink: https://bugs.launchpad.net/bugs/1840704
> >
> > The 'find .ko | sed | while read module' loop has the $(pkgdir) path
> > hardcoded in a couple places to reconstruct the path 'sed' destroyed.
> >
> > Remove that 'sed' expression to destroy the first components of the
> > absolute pathname and get its '/lib/modules/'-based path with shell.
> >
> > This is needed for the next patch.
> >
> > Signed-off-by: Mauricio Faria de Oliveira <mfo at canonical.com>
> > ---
> >  debian/rules.d/2-binary-arch.mk | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> > index 083b64772439..730373e93e53 100644
> > --- a/debian/rules.d/2-binary-arch.mk
> > +++ b/debian/rules.d/2-binary-arch.mk
> > @@ -282,16 +282,17 @@ ifneq ($(skipdbg),true)
> >               INSTALL_MOD_PATH=$(dbgpkgdir)/usr/lib/debug
> >       # Add .gnu_debuglink sections to each stripped .ko
> >       # pointing to unstripped verson
> > -     find $(pkgdir) -name '*.ko' | sed 's|$(pkgdir)||'| while read module ; do \
> > +     find $(pkgdir) -name '*.ko' | while read path_module ; do \
> > +             module="/lib/modules/$${path_module#*/lib/modules/}"; \
>
> Why not do this instead?
>
>   module=$${path_module#$(pkgdir)}
>

This would again depend on $(pkgdir) inside the loop,
and the intention is to generalize that for the next patch.

The next patch needs this dependency not to exist,
so that $(dbgpkgdir) can be iterated over too in the loop.

Hope this clarifies things.  Thanks for reviewing!

> I don't think it makes a difference in practice, I just find it easier
> to parse. I had to stare at what you wrote for a bit to convince myself
> that the result was the same as what sed was doing previously, whereas
> the above is more obviously equivalent.
>
> Thanks,
> Seth



-- 
Mauricio Faria de Oliveira



More information about the kernel-team mailing list