aboutsummaryrefslogtreecommitdiff
path: root/platforms-rebase-latest.sh
blob: 90ff350273c8f025852d175f715ffaac70c785c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/sh

echo "You aren't supposed to run the script directly"
echo ""
echo "You should open it in the editor and copy/paste the commands into"
echo "your terminal, making sure they complete as expected before moving"
echo "on to the next command"
echo ""
echo "There are also points in the scripts where you're expected to"
echo "do a build and test of everything to make sure you're on the"
echo "right track"
exit

WORKSPACE=${WORKSPACE:-/linaro/platforms}

cd ${WORKSPACE}/linux
git remote add armlt   ssh://git@git.linaro.org/landing-teams/working/arm/kernel-testing.git
git remote add release ssh://git@git.linaro.org/landing-teams/working/arm/kernel-release.git

# ----------------------------------------------------------------------
# This file is an example for rebasing 'latest' kernel from v4.11-rc5 to v4.11
# ----------------------------------------------------------------------

export OLD_UPSTREAM=v4.12-rc1
export NEW_UPSTREAM=v4.12
export SERIES=latest

# ----------------------------------------------------------------------
# Create a 'base' branch which we will base all of our topics on.
# Generally, this is for things that end up being changed and used by
# a lot of topics, e.g. configs and device-trees, or for anthing else
# that ends up being too much of a pain to merge with from seperate
# topics.
# ----------------------------------------------------------------------

# First remember the old base topic...
export OLD_BASE_TOPIC=`git show-ref -s armlt/${SERIES}-armlt-base`
# Construct new base topic (just the configs in this case)...
git checkout -f ${NEW_UPSTREAM}
git checkout -B ${SERIES}-armlt-base
# RMH - --allow_unrelated-histories doesn't work on my version of git
#git pull --no-ff --no-edit --allow-unrelated-histories git://git.linaro.org/kernel/configs.git config-core-tracking
#git pull --no-ff --no-edit --allow-unrelated-histories git://git.linaro.org/kernel/configs.git config-boards-tracking
git pull --no-ff --no-edit git://git.linaro.org/kernel/configs.git config-core-tracking
git pull --no-ff --no-edit git://git.linaro.org/kernel/configs.git config-boards-tracking

# ----------------------------------------------------------------------
# Rebase all of our topics onto the new base topic.
# ----------------------------------------------------------------------

export NEW_BASE_TOPIC=${SERIES}-armlt-base
git rebase --onto ${NEW_BASE_TOPIC} ${OLD_BASE_TOPIC} ${SERIES}-armlt-configs
git rebase --onto ${NEW_BASE_TOPIC} ${OLD_BASE_TOPIC} ${SERIES}-armlt-misc
git rebase --onto ${NEW_BASE_TOPIC} ${OLD_BASE_TOPIC} ${SERIES}-armlt-fvp
git rebase --onto ${NEW_BASE_TOPIC} ${OLD_BASE_TOPIC} ${SERIES}-armlt-juno
git rebase --onto ${NEW_BASE_TOPIC} ${OLD_BASE_TOPIC} ${SERIES}-armlt-hdlcd
#git rebase --onto ${NEW_BASE_TOPIC} ${OLD_BASE_TOPIC} ${SERIES}-armlt-mali

# ----------------------------------------------------------------------
# Construct integrated kernel branch with all our topics merged in
# Note, where there are merge conflicts they need resolving before
# applying the merge with 'git commit -a'. If you have git rerere setup
# it will remember the conflict resolutions and fix them next time. (You
# still need to commit the resolutions rerere does though)
# ----------------------------------------------------------------------

git checkout -f ${NEW_UPSTREAM}
git checkout -B ${SERIES}-armlt
git merge --no-ff --no-edit ${SERIES}-armlt-base
git merge --no-ff --no-edit ${SERIES}-armlt-configs
git merge --no-ff --no-edit ${SERIES}-armlt-misc
git merge --no-ff --no-edit ${SERIES}-armlt-juno
git merge --no-ff --no-edit ${SERIES}-armlt-hdlcd
git commit -a
git merge --no-ff --no-edit ${SERIES}-armlt-fvp
git commit -a
#git merge --no-ff --no-edit ${SERIES}-armlt-mali

# ----------------------------------------------------------------------
# Now test the kernel!
# ----------------------------------------------------------------------

test test test

# ----------------------------------------------------------------------
# Update ARM LT testing repo 'armlt'
# ----------------------------------------------------------------------

# Push everything...
git push -f armlt latest-armlt:testing-latest-armlt
git push -f armlt

# Push the topic branches to kernel-testing
git push -f armlt latest-armlt-base
git push -f armlt latest-armlt-configs
git push -f armlt latest-armlt-fvp
git push -f armlt latest-armlt-hdlcd
git push -f armlt latest-armlt-juno
git push -f armlt latest-armlt-misc
git push -f armlt latest-armlt-scmi

# Might be nice to keep a 'master' branch up-to-date with upstream we use
git branch -f master ${NEW_UPSTREAM}
git push -f armlt master
# Push Linus's tag out as well...
git push armlt refs/tags/${NEW_UPSTREAM}
# Or can push all tags instead in case we skipped some -rc versions...
git for-each-ref --format="%(refname)" "refs/tags/${NEW_UPSTREAM}*" |\
    (while read tag; do git push armlt $tag; done)

# ----------------------------------------------------------------------
# Update ARM LT release repo if required
# ----------------------------------------------------------------------

# Create a tag. (This is an automated set of commands which may go wrong
# and will require editing each time for tag names and description)
git checkout latest-armlt
export LINUX_TAG=`git describe --abbrev=0 --tags` # Doesn't work if we already have tags!!!
NEW_TAG=latest-armlt-`date +%Y%m%d`
GIT_COMMITTER_DATE="$(git show --format=%aD  | head -1)" git tag -a ${NEW_TAG} -m \
"Juno/vexpress/FVP kernel based on latest version of Linux (${LINUX_TAG})

Changes in this version:
- Update to latest version of Linux.

Issues:
- Mali driver omitted because it doesn't compile with latest Android
  sync APIs
"
# To delete the tag if we mess up...
#	git tag -d ${NEW_TAG}

# Push to 'release' repo
git push -f release HEAD:latest-armlt
git push release ${NEW_TAG}