Created
May 29, 2020 23:20
-
-
Save joestringer/9601fb6f01b6756131a7e66225ad3ba8 to your computer and use it in GitHub Desktop.
Build linux .deb packages from kernel git tree
This file contains hidden or 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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FWIW
gcn
is my local git alias to switch to branchfoo_v1.N
tofoo_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