linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Silbe <x-linux@se-silbe.de>
To: Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] kbuild: deb-pkg: set dependencies for kernel image package
Date: Sun, 24 Oct 2021 15:58:37 +0200	[thread overview]
Message-ID: <20211024135838.647689-2-x-linux@se-silbe.de> (raw)
In-Reply-To: <20211024135838.647689-1-x-linux@se-silbe.de>

From: Sascha Silbe <x-linux@infra-silbe.de>

When built with module support, we'll need the kmod package to handle
the user space side of kernel module management.

When built with initramfs support but not building an initramfs
directly into the kernel, we'll need initramfs-tools to build the
initramfs that will be loaded.

If a the official kernel package of the distribution was installed
first the dependencies are already installed and it will happen to
work. However on a fresh install base system with just the kernel
package built by deb-pkg installed the dependencies will be missing
and the system will fail to boot.

Signed-off-by: Sascha Silbe <x-linux@infra-silbe.de>
---
 scripts/package/mkdebian | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 60a2a63a5e900..a3becd9d402e1 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -132,6 +132,14 @@ else
         echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly"
 fi
 
+image_depends=
+if is_enabled MODULES; then
+    image_depends=kmod
+fi
+if is_enabled BLK_DEV_INITRD && ! is_enabled INITRAMFS_SOURCE; then
+    image_depends="${image_depends}${image_depends:+, }initramfs-tools | linux-initramfs-tool"
+fi
+
 mkdir -p debian/source/
 echo "1.0" > debian/source/format
 
@@ -180,6 +188,7 @@ Homepage: https://www.kernel.org/
 
 Package: $packagename-$version
 Architecture: $debarch
+Depends: $image_depends
 Description: Linux kernel, version $version
  This package contains the Linux kernel, modules and corresponding other
  files, version: $version.
-- 
2.30.2


  reply	other threads:[~2021-10-24 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-24 13:58 [PATCH 0/2] kbuild: deb-pkg: fixes for use on Debian systems Sascha Silbe
2021-10-24 13:58 ` Sascha Silbe [this message]
2021-10-24 13:58 ` [PATCH 2/2] kbuild: deb-pkg: invoke linux-base scripts if installed Sascha Silbe

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=20211024135838.647689-2-x-linux@se-silbe.de \
    --to=x-linux@se-silbe.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).