StablePatchApplication
Contents |
How to prepare the git repo master branch for a kernel release
Description
This wiki page describes how to prepare the master branch of a git repository before releasing a new version of an Ubuntu kernel. The intended audience is Ubuntu Kernel Core Developers performing this task, or others interested in the process.
Repository Branch Structure
First, a word about the kernel branches:
- master
- master branch is the branch that should reflect exactly the release history of the package. The master branch should not be force pushed or rebased except to fix mistakes, and then only very rarely and carefully and after consultation with another kernel stable coredev
- master-next
- The master-next branch is where patches accumulate to be applied to the next release of the package. The master-next branch must have a common commit with master that is the previous tagged release, so that all new patches accumulate on top of what is released.
Preparing a release
A release is usually prepared using the master-next branch, pulling everything into master once everything's ready for release. It is necessary to make sure that the master-next branch is in a sane state. For example, it must contain the 'start new release' commit and, if required, the 'ABI bump' commit.
- Check out a clean copy of the master-next branch
git checkout master-next git fetch origin; git fetch origin master-next; git reset --hard FETCH_HEAD git clean -dxf
- Review master-next commits Verify that the 'Start new release' and 'ABI Bump' commits have been correctly done in the master-next branch.
- Clean
fakeroot debian/rules clean
- Update the changelog to include all the added commits by running:
fakeroot debian/rules insertchanges
- Add the tracking bug using the tools from kteam tools:
create-release-tracker
Warning: This will create a (visible) release tracking bug; use with care.
- Review the changelog
Edit debian.master/changelog
replace UNRELEASED with <seriesname>
update the packagers line with your name and email address and the current time
- Commit the changelog with
git add debian.master/changelog git commit -s -m "UBUNTU: Ubuntu-<changelog-version>"
where <version> is copy and paste from head debian.master/changelog
- Tag the release commit
git tag -s -m Ubuntu-<changelog-version> Ubuntu-<changelog-version>
where <version> is copy and paste from head debian.master/changelog. Note that in rare cases there may be commits on master-next that you choose to not release, in which case these commits will be on the master-next branch _after_ this most recent release tag Ubuntu-<version>.
Switch to master branch
. Make sure the local master branch is in sync with the origin/mastergit checkout -f master git fetch origin; git fetch origin master; git reset --hard FETCH_HEAD
This resets the master branch to the the last commit in origin/master. Verify that HEAD is the same SHA1 as the prior release tag and that it is in common with master-next.- Reset master to the release tag. If you are not carrying any unreleased commits on master-next then you can do a simple rebase to bring master up to date:
git rebase master-next
Otherwise, you'll need to set HEAD for master to the release tag:git reset --hard Ubuntu-<changelog-version>
Note that in either case modifications to the master branch must be a simple fast-forward operation. If the prior release tag SHA1 has not remained the same, then something has gone wrong. Run the verify-release-ready script to make sure everything is OK
.If it's not then you can fix it and force commit or force tag your local tree, making sure it's right before you push to the master repo
- Test build it and do a quick test boot
- Push your git branch to the origin master branch, explicitly including the tag
git push origin master <tagname>