Skip to content

Instantly share code, notes, and snippets.

@sambrightman
Last active December 10, 2016 14:50
Show Gist options
  • Save sambrightman/3dc8455486e7824b9cf9169d778966cb to your computer and use it in GitHub Desktop.
Save sambrightman/3dc8455486e7824b9cf9169d778966cb to your computer and use it in GitHub Desktop.
# https://wiki.ubuntu.com/Kernel/Dev/KernelGitGuide
# https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
# https://wiki.ubuntu.com/Kernel/Handbook/ReleaseManagement/MaintainingRelease
release=yakkety
base_tag=v4.8
#git clone git://kernel.ubuntu.com/ubuntu/linux.git
#git clone --reference linux git://kernel.ubuntu.com/ubuntu/ubuntu-${release}.git
git fetch
feature=disablepmp
git checkout -b ${feature}
current_release=$(git describe --tags --abbrev=0)
new_release=$(git describe --tags --abbrev=0 origin/master-next)
alias fdr='fakeroot debian/rules'
# jump to rebase if desired
# LOOP
fdr editconfigs
# do stuff
git add stuff
git commit -m "SABR: stuff"
# ensure we have the tag in the ubuntu repo
cd ../linux
base_rev=$(git rev-parse ${base_tag})
cd -
git tag $base_tag $base_rev
fdr clean
fdr startnewrelease
git add debian.master/changelog
git commit -s -F debian/commit-templates/newrelease
git rebase --interactive new_release
# move startnewrelease commit behind the commits
version=$(sed -e '1s/^.* (\(.*\)) .*/\1/p;d' debian.master/changelog)
release=$(echo ${version} | awk -F- '{ print $2 }')
fdr insertchanges
sed -i "1s/UNRELEASED/${release}/" debian.master/changelog
# don't let it bump the version
sed -i "1s/^\(.*\) (\(.*\)-.*) \(.*\)/\1 (\2-1000${release}+${feature}) \3/" debian.master/changelog
git add debian.master/changelog
git commit -s -m "SABR: port ${feature} to -${version}"
# maybe avoid clean? see below
#fdr clean
# parallelization is taken care of (see fdr printenv)
fdr binary-headers binary-generic binary-perarch do_tools_hyperv=false #skipmodule=true skipabi=true
# sudo dpkg -i ../*someversion*.deb
# GOTO LOOP
# UPDATE REPO
cd ../linux
git pull --rebase
git repack
cd -
git pull --rebase
git gc
# REBASE METHOD
git rebase ${current_release} --onto ${new_release}
# fix merges
git commit --amend # change version
# how to remake initial files without clean?
git clean -f *.log
fdr debian/control
cp -f debian.master/{copyright,changelog,control.stub} debian/
mv debian/control.stub debian/control
bash debian.master/reconstruct
rm -f debian.master/control.stub debian/files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment