From a9cd7ba18b797d78c5baac76897c38396a6b682e Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Wed, 24 May 2023 09:28:43 +0000 Subject: [PATCH] fix: use initramfs-tools from backports only on wheezy --- distro/debian/debian.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/distro/debian/debian.go b/distro/debian/debian.go index d4e63af..6040642 100644 --- a/distro/debian/debian.go +++ b/distro/debian/debian.go @@ -236,7 +236,9 @@ func repositories(release Release) (repos []string) { repo("debian", "") repo("debian", "-updates") - repo("debian", "-backports") + if d.release <= 7 { + repo("debian", "-backports") + } repo("debian-security", "/updates") return @@ -263,17 +265,21 @@ func (d Debian) runs() (commands []string) { cmdf("apt-get update || apt-get update || apt-get update") - // by default Debian backports repositories have a lower - // priority than stable, so we should specify it manually - cmdf("apt-get -y install -t %s-backports initramfs-tools", - d.release.Name()) - pkglist := []string{ "wget", "build-essential", "libelf-dev", "git", "kmod", "linux-base", "libssl-dev", "'^(gcc-[0-9].[0-9]|gcc-[0-9]|gcc-[1-9][0-9])$'", } + if d.release >= 8 { + pkglist = append(pkglist, "initramfs-tools") + } else { + // by default Debian backports repositories have a lower + // priority than stable, so we should specify it manually + cmdf("apt-get -y install -t %s-backports initramfs-tools", + d.release.Name()) + } + if d.release < 9 { pkglist = append(pkglist, "module-init-tools") }