blob: f09f5b284aba97cd9dba08a8c3e9af414b23fb35 [file] [log] [blame]
Patrick Georgif61c9e92015-07-13 22:48:46 +02001#!/bin/bash
2# $1: new version name
Patrick Georgi68e3f6d2016-01-29 23:02:56 +01003# $2: commit id (if not master)
Patrick Georgif61c9e92015-07-13 22:48:46 +02004set -e
5if [ -z "$1" ]; then
Patrick Georgi68e3f6d2016-01-29 23:02:56 +01006 echo "usage: $0 version [commit id]"
Patrick Georgif61c9e92015-07-13 22:48:46 +02007 echo "tags a new coreboot version and creates a tar archive"
8 exit 1
9fi
10git clone --recurse-submodules http://review.coreboot.org/coreboot.git coreboot-$1
11cd coreboot-$1
Patrick Georgi68e3f6d2016-01-29 23:02:56 +010012if [ -n "$2" ]; then
13 git reset --hard $2
14fi
Patrick Georgif61c9e92015-07-13 22:48:46 +020015git submodule update --init --checkout
16git tag -a --force $1 -m "coreboot version $1"
17printf "$1-$(git log --pretty=%H|head -1)\n" > .coreboot-version
Patrick Georgi68e3f6d2016-01-29 23:02:56 +010018tstamp=$(git log --pretty=format:%ci -1)
Patrick Georgif61c9e92015-07-13 22:48:46 +020019cd ..
Patrick Georgi68e3f6d2016-01-29 23:02:56 +010020tar --mtime="$tstamp" --owner=coreboot:1000 --group=coreboot:1000 --exclude-vcs --exclude=coreboot-${1}/3rdparty/blobs -cvf - coreboot-${1} |xz -9 > coreboot-${1}.tar.xz
21tar --mtime="$tstamp" --owner=coreboot:1000 --group=coreboot:1000 --exclude-vcs -cvf - coreboot-${1}/3rdparty/blobs |xz -9 > coreboot-blobs-${1}.tar.xz