All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Matthew Wilcox <willy@infradead.org>, Peter Jones <pjones@redhat.com>
Cc: linux-efi <linux-efi@vger.kernel.org>,
	debian-efi@lists.debian.org, debian-kernel@lists.debian.org,
	efi@lists.einval.com, mjg59@srcf.ucam.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH] builddeb: Support signing kernels with a Machine Owner Key
Date: Thu, 6 May 2021 19:38:28 +0200	[thread overview]
Message-ID: <CAMj1kXFMwt+VGbvMeS+Ew1uGDMbJpGi6ALRj1NW2yZcM2CuwEw@mail.gmail.com> (raw)
In-Reply-To: <20210506133623.GB388843@casper.infradead.org>

(+ Peter)

On Thu, 6 May 2021 at 15:37, Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, May 06, 2021 at 02:01:53PM +0200, Ard Biesheuvel wrote:
> > On Thu, 6 May 2021 at 14:00, Matthew Wilcox (Oracle)
> > <willy@infradead.org> wrote:
> > >
> > > If the config file specifies a signing key, use it to sign
> > > the kernel so that machines with SecureBoot enabled can boot.
> > > See https://wiki.debian.org/SecureBoot
> > >
> > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> > > ---
> > >  scripts/package/builddeb | 10 +++++++++-
> > >  1 file changed, 9 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> > > index 91a502bb97e8..4fa6ff2b5cac 100755
> > > --- a/scripts/package/builddeb
> > > +++ b/scripts/package/builddeb
> > > @@ -147,7 +147,15 @@ else
> > >         cp System.map "$tmpdir/boot/System.map-$version"
> > >         cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
> > >  fi
> > > -cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path"
> > > +
> > > +vmlinux=$($MAKE -s -f $srctree/Makefile image_name)
> > > +if is_enabled CONFIG_MODULE_SIG; then
> >
> > Shouldn't this be conditional on CONFIG_EFI as well?
>
> Maybe!  We're a long way outside my area of expertise.  I'm just chuffed
> I thought of using cut -d\" -f2.
>
> There should probably also be something conditional on sbsign actually
> being in $PATH, I guess?
>
> And I wasn't sure about putting all of this in builddeb -- does make
> rpm-pkg already have its own way of doing the same thing, or should this
> be somewhere more generic?
>

No, sbsign is Debian/Ubuntu specific. Fedora/Redhat uses something
else IIRC. But yes, it obviously helps if the tool exists.


> > > +       cert=$srctree/$(grep ^CONFIG_MODULE_SIG_KEY= include/config/auto.conf | cut -d\" -f2)
> > > +       key=${cert%pem}priv
> > > +       sbsign --key $key --cert $cert "$vmlinux" --output "$tmpdir/$installed_image_path"
> > > +else
> > > +       cp "$vmlinux" "$tmpdir/$installed_image_path"
> > > +fi
> > >
> > >  if is_enabled CONFIG_OF_EARLY_FLATTREE; then
> > >         # Only some architectures with OF support have this target
> > > --
> > > 2.30.2
> > >

  reply	other threads:[~2021-05-06 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 11:58 [PATCH] builddeb: Support signing kernels with a Machine Owner Key Matthew Wilcox (Oracle)
2021-05-06 12:01 ` Ard Biesheuvel
2021-05-06 13:36   ` Matthew Wilcox
2021-05-06 17:38     ` Ard Biesheuvel [this message]
2021-10-13 20:05 Matthew Wilcox (Oracle)
2021-10-14  9:46 ` Ard Biesheuvel
2021-11-04  9:28   ` Masahiro Yamada
2021-12-16 22:04     ` Matthew Wilcox
2021-12-17 15:29       ` Masahiro Yamada

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=CAMj1kXFMwt+VGbvMeS+Ew1uGDMbJpGi6ALRj1NW2yZcM2CuwEw@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=debian-efi@lists.debian.org \
    --cc=debian-kernel@lists.debian.org \
    --cc=efi@lists.einval.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=mjg59@srcf.ucam.org \
    --cc=pjones@redhat.com \
    --cc=willy@infradead.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.