Created
May 4, 2023 18:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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