2 # Copyright 2009 Luis R. Rodriguez <mcgrof@gmail.com>
4 # You can use this to make stable compat-wireless releases
6 # The assumption is you have the linux-2.6-allstable git tree on your $HOME
7 # git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-allstable.git
9 # Local branches will be created based on the remote linux-2.6.X.y branches.
10 # If your branch already exists we will nuke it for you to avoid rebasing.
12 # If no kernel is specified we use the latest rc-release, which will be on the
13 # remove master branch. Your master branch should be clean.
15 ALL_STABLE_TREE="linux-2.6-allstable"
16 STAGING=/tmp/staging/compat-wireless/
18 if [[ $# -gt 1 ]]; then
19 echo "Usage: $0 <linux-2.6.X.y>"
24 echo $0 linux-2.6.29.y
25 echo $0 linux-2.6.30.y
27 echo "If no kernel is specified we try to make a release based on the latest RC kernel."
28 echo "If a kernel release is specified X is the next stable release as 31 in 2.6.31.y."
32 # branch we want to use from hpa's tree
35 export GIT_TREE=$HOME/$ALL_STABLE_TREE
36 COMPAT_WIRELESS_DIR=$(pwd)
39 # --abbrev=0 on branch should work but I guess it doesn't on some releases
40 LOCAL_BRANCH=$(git branch | grep \* | awk '{print $2}')
43 "master") # Preparing a new stable compat-wireless release based on an RC kernel
46 # Rebase will be done automatically if our tree is clean
47 echo "On master branch on $ALL_STABLE_TREE"
49 *) # Based on a stable 2.6.x.y release, lets just move to the master branch,
50 # git pull, nuke the old branch and start a fresh new branch.
51 echo "On non-master branch on $ALL_STABLE_TREE: $LOCAL_BRANCH"
55 git branch -D $LOCAL_BRANCH
56 git checkout -b $LOCAL_BRANCH origin/$LOCAL_BRANCH
60 # We should now be on the branch we want
61 KERNEL_RELEASE=$(git describe --abbrev=0 | sed -e 's/v//g')
62 RELEASE="compat-wireless-$KERNEL_RELEASE"
63 RELEASE_TAR="$RELEASE.tar.bz2"
67 cp -a $COMPAT_WIRELESS_DIR $STAGING/$RELEASE
70 ./scripts/admin-update.sh
71 rm -rf $STAGING/$RELEASE/.git
75 echo "Cleaning up the release ..."
76 make clean 2>&1 > /dev/null
77 find ./ -type f -name *.orig | xargs rm -f
78 find ./ -type f -name *.rej | xargs rm -f
82 echo "Creating $RELEASE_TAR ..."
83 tar -jcf $RELEASE_TAR $RELEASE/
86 echo "Compat-wireles release: $RELEASE"
87 echo "Size: $(du -h $RELEASE_TAR)"
88 echo "sha1sum: $(sha1sum $RELEASE_TAR)"
90 echo "Release: ${STAGING}$RELEASE_TAR"