wl1251: use DRIVER_NAME macro in wl1251_spi_driver
[pandora-wifi.git] / scripts / gen-stable-release.sh
1 #!/bin/bash
2 # Copyright 2009  Luis R. Rodriguez <mcgrof@gmail.com>
3 #
4 # You can use this to make stable compat-wireless releases
5 #
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
8 #
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.
11 #
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.
14
15 ALL_STABLE_TREE="linux-2.6-allstable"
16 STAGING=/tmp/staging/compat-wireless/
17
18 if [[ $# -gt 1 ]]; then
19         echo "Usage: $0 <linux-2.6.X.y>"
20         echo
21         echo Examples usages:
22         echo
23         echo  $0
24         echo  $0 linux-2.6.29.y
25         echo  $0 linux-2.6.30.y
26         echo
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."
29         exit
30 fi
31
32 # branch we want to use from hpa's tree
33 BRANCH="$1"
34
35 export GIT_TREE=$HOME/$ALL_STABLE_TREE
36 COMPAT_WIRELESS_DIR=$(pwd)
37
38 cd $GIT_TREE
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}')
41
42 case $LOCAL_BRANCH in
43 "master") # Preparing a new stable compat-wireless release based on an RC kernel
44         git checkout -f
45         git pull
46         # Rebase will be done automatically if our tree is clean
47         echo "On master branch on $ALL_STABLE_TREE"
48         ;;
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"
52         git checkout -f
53         git checkout master
54         git pull
55         git branch -D $LOCAL_BRANCH
56         git checkout -b $LOCAL_BRANCH origin/$LOCAL_BRANCH
57         ;;
58 esac
59
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"
64
65 rm -rf $STAGING
66 mkdir -p $STAGING
67 cp -a $COMPAT_WIRELESS_DIR $STAGING/$RELEASE
68 cd $STAGING/$RELEASE
69
70 ./scripts/admin-update.sh
71 rm -rf $STAGING/$RELEASE/.git
72
73 # Remove any gunk
74 echo
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
79
80 cd $STAGING/
81
82 echo "Creating $RELEASE_TAR ..."
83 tar -jcf $RELEASE_TAR $RELEASE/
84
85 echo
86 echo "Compat-wireles release: $RELEASE"
87 echo "Size: $(du -h $RELEASE_TAR)"
88 echo "sha1sum: $(sha1sum $RELEASE_TAR)"
89 echo
90 echo "Release: ${STAGING}$RELEASE_TAR"