All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <petr.vorel@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Ben Hutchings <ben@decadent.org.uk>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Guillem Jover <guillem@hadrons.org>
Subject: Re: [PATCH] builddeb: Fix build on non-Debian/Ubuntu distros
Date: Mon, 2 Nov 2020 20:05:46 +0100	[thread overview]
Message-ID: <20201102190546.GA1884@pevik> (raw)
In-Reply-To: <CAK7LNATETTMobRu26yoDhinv7mWOyg5JkzL5UGBtPS4KB37r6g@mail.gmail.com>

> On Sat, Oct 31, 2020 at 3:58 AM Petr Vorel <petr.vorel@gmail.com> wrote:

> > Hi Ben,

> > first, thanks for your review.

> > > On Fri, 2020-10-30 at 17:56 +0100, Petr Vorel wrote:
> > > > This fixes make bindeb-pkg for RPM based distros, which don't have
> > > > dpkg-dev (and thus not /usr/bin/dpkg-buildpackage), which sets
> > > > $DEB_RULES_REQUIRES_ROOT.

> > > > Fixes: 3e8541803624 ("builddeb: Enable rootless builds")

> > > This doesn't seem to fix a bug, and in fact it would introduce one.

> > > > Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> > > [...]
> > > > --- a/scripts/package/builddeb
> > > > +++ b/scripts/package/builddeb
> > > > @@ -37,7 +37,7 @@ create_package() {
> > > >                 | xargs -r0 md5sum > DEBIAN/md5sums"

> > > >         # Fix ownership and permissions
> > > > -       if [ "$DEB_RULES_REQUIRES_ROOT" = "no" ]; then
> > > > +       if [ -z "$DEB_RULES_REQUIRES_ROOT" -o "$DEB_RULES_REQUIRES_ROOT" = "no" ]; then
> > > >                 dpkg_deb_opts="--root-owner-group"
> > > >         else
> > > >                 chown -R root:root "$pdir"

> > > This is the wrong default behaviour; it will cause a regression with
> > > older versions of dpkg that don't support this option.
> > Sorry for wrong report. I tested it on Debian, but only on unstable.

> > > If you invoke this script directly and do not use dpkg-buildpackage
> > > (which I don't think is really supported anyway) then you must either
> > > do so as root or use fakeroot (as dpkg-buildpackage does by default).
> > Well, both bindeb-pkg and deb-pkg use dpkg-buildpackage.
> > Thus fakeroot is used by default.

> > /bin/sh -c dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -d -b -nc -uc

> > The root cause is that while calling chown -R root:root "$pdir" is ok on Debian,
> > it's refused for fakeroot in openSUSE. I can run it with
> > DEB_RULES_REQUIRES_ROOT=no, that should fix that, but I'd prefer it were working
> > by default (although I admit not many people need it).
> > I reported it because the default setup worked before 3e8541803624.
> > I'll have a look what configuration (permission) is missing on openSUSE to allow
> > chown -R root:root for non-root user.

> > > Ben.

> > Kind regards,
> > Petr



> I do not know what is different on openSUSE, but
> my understanding is like follows:



> For old dpkg tools (which does not know "Rules-Requires-Root: no"),
> $DEB_RULES_REQUIRES_ROOT is empty.
> -> We run chown -R root:root like before.


> For new dpkg tools (which knows "Rules-Requires-Root: no"),
> $DEB_RULES_REQUIRES_ROOT is "no".
> -> We pass --root-owner-group to dpkg-deb.

Yes. I'm using dpkg 1.19.0.4, which knows "Rules-Requires-Root: no", but does
not know --rules-requires-root (added in 1.19.1). export
DEB_RULES_REQUIRES_ROOT=no fixes the problem for my version (but that does not
break the build). I just wanted to save time for the others, but 1) there are
probably not many people using OBS to build Debian packages and 2) maybe it's
just me who does not know it.

It looks to me debhelper is not used for kernel Debian packaing, right?
At least building works even I don't have it.

As a result of this I'll also update openSUSE dpkg package to latest release.

Thanks all for explanation.

Kind regards,
Petr

      reply	other threads:[~2020-11-02 19:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 16:56 [PATCH] builddeb: Fix build on non-Debian/Ubuntu distros Petr Vorel
2020-10-30 17:14 ` Ben Hutchings
2020-10-30 18:57   ` Petr Vorel
2020-11-02  8:35     ` Masahiro Yamada
2020-11-02 19:05       ` Petr Vorel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201102190546.GA1884@pevik \
    --to=petr.vorel@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=guillem@hadrons.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.