Patrick Georgi | f61c9e9 | 2015-07-13 22:48:46 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # $1: new version name |
Patrick Georgi | 68e3f6d | 2016-01-29 23:02:56 +0100 | [diff] [blame] | 3 | # $2: commit id (if not master) |
Patrick Georgi | f61c9e9 | 2015-07-13 22:48:46 +0200 | [diff] [blame] | 4 | set -e |
| 5 | if [ -z "$1" ]; then |
Patrick Georgi | 68e3f6d | 2016-01-29 23:02:56 +0100 | [diff] [blame] | 6 | echo "usage: $0 version [commit id]" |
Patrick Georgi | f61c9e9 | 2015-07-13 22:48:46 +0200 | [diff] [blame] | 7 | echo "tags a new coreboot version and creates a tar archive" |
| 8 | exit 1 |
| 9 | fi |
| 10 | git clone --recurse-submodules http://review.coreboot.org/coreboot.git coreboot-$1 |
| 11 | cd coreboot-$1 |
Patrick Georgi | 68e3f6d | 2016-01-29 23:02:56 +0100 | [diff] [blame] | 12 | if [ -n "$2" ]; then |
| 13 | git reset --hard $2 |
| 14 | fi |
Patrick Georgi | f61c9e9 | 2015-07-13 22:48:46 +0200 | [diff] [blame] | 15 | git submodule update --init --checkout |
| 16 | git tag -a --force $1 -m "coreboot version $1" |
| 17 | printf "$1-$(git log --pretty=%H|head -1)\n" > .coreboot-version |
Patrick Georgi | 68e3f6d | 2016-01-29 23:02:56 +0100 | [diff] [blame] | 18 | tstamp=$(git log --pretty=format:%ci -1) |
Patrick Georgi | f61c9e9 | 2015-07-13 22:48:46 +0200 | [diff] [blame] | 19 | cd .. |
Patrick Georgi | 68e3f6d | 2016-01-29 23:02:56 +0100 | [diff] [blame] | 20 | tar --mtime="$tstamp" --owner=coreboot:1000 --group=coreboot:1000 --exclude-vcs --exclude=coreboot-${1}/3rdparty/blobs -cvf - coreboot-${1} |xz -9 > coreboot-${1}.tar.xz |
| 21 | tar --mtime="$tstamp" --owner=coreboot:1000 --group=coreboot:1000 --exclude-vcs -cvf - coreboot-${1}/3rdparty/blobs |xz -9 > coreboot-blobs-${1}.tar.xz |