Skip to content

Instantly share code, notes, and snippets.

@joestringer
Created May 29, 2020 23:20
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 joestringer/9601fb6f01b6756131a7e66225ad3ba8 to your computer and use it in GitHub Desktop.
Save joestringer/9601fb6f01b6756131a7e66225ad3ba8 to your computer and use it in GitHub Desktop.
Build linux .deb packages from kernel git tree
#!/bin/bash
version="$(git rev-parse --abbrev-ref HEAD \
| sed 's/^[^/]*\///' \
| sed 's/\//-/' \
| sed 's/_/-/')"
if [ "$version" == "" ] || [ "$version" == HEAD ]; then
version="$(git rev-parse --short HEAD)"
fi
echo $version
if make -j$(getconf _NPROCESSORS_ONLN) bindeb-pkg LOCALVERSION="-$version"; then
echo "Build done. Consider running 'gcn'"
fi
@joestringer
Copy link
Author

joestringer commented May 29, 2020

FWIW gcn is my local git alias to switch to branch foo_v1.N to foo_v1.N+1 so I'm always versioning the exact commit I tested out and not recompiling debs with different content but same version:

https://github.com/joestringer/config/blob/1c050f3807e03cb8ba283c90b05416767f493576/.bashrc#L272-L290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment