Skip to content

Instantly share code, notes, and snippets.

@kpfleming
Created May 4, 2023 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpfleming/8ea306d2e06739200a443685d3f6f693 to your computer and use it in GitHub Desktop.
Save kpfleming/8ea306d2e06739200a443685d3f6f693 to your computer and use it in GitHub Desktop.
Script to produce linux-image and linux-headers metapackages for custom-built Debian kernels
#!/bin/bash
set -e
file=$(ls *unsigned*.deb)
declare -a seg_a="(${file//_/ })"
declare -a seg_b="(${seg_a//-/ })"
KERNEL_VER=${seg_a[1]}
PKG_VER=${seg_b[2]}-${seg_b[3]}
cat > linux-image.control <<EOF
Section: kernel
Priority: optional
Standards-Version: 3.9.2
Package: linux-image-arm64
Version: ${KERNEL_VER}
Depends: linux-image-${PKG_VER}-arm64-unsigned (= ${KERNEL_VER})
Provides: linux-image-generic, linux-latest-modules-${PKG_VER}-arm64, wireguard-modules (= 1.0.0)
Architecture: arm64
Description: meta package to manage linux-image installation
EOF
cat > linux-headers.control <<EOF
Section: kernel
Priority: optional
Standards-Version: 3.9.2
Package: linux-headers-arm64
Version: ${KERNEL_VER}
Depends: linux-headers-${PKG_VER}-arm64-unsigned (= ${KERNEL_VER})
Provides: linux-headers-generic
Architecture: arm64
Description: meta package to manage linux-headers installation
EOF
equivs-build --arch arm64 linux-image.control
equivs-build --arch arm64 linux-headers.control
rm *.buildinfo
rm *.changes
rm linux-image.control
rm linux-headers.control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment