Makefile.inc: Remove workaround ACPI warnings
[coreboot.git] / util / release / build-release
blobf609bf194e40a32950dfcf1fb9c57139b10e39ec
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: GPL-2.0-only
3 # ${VERSION_NAME}: new version name
4 # ${COMMIT_ID}: commit id (if not master)
5 # ${USERNAME}: username (if not default to https)
6 # ${GPG_KEY_ID}: gpg key id (if not don't sign)
7 VERSION_NAME=$1
8 COMMIT_ID=$2
9 USERNAME=$3
10 GPG_KEY_ID=$4
12 set -e
14 if [ -z "$GPG_TTY" ]; then
15 export GPG_TTY=$(tty)
18 # set local + tz to be reproducible
19 LC_ALL=C
20 LANG=C
21 TZ=UTC0
22 export LC_ALL LANG TZ
24 if [ -z "$VERSION_NAME" ] || [ "$VERSION_NAME" = "--help" ] || [ -z "$COMMIT_ID" ]; then
25 echo "usage: $0 <version> <commit id> [username] [gpg key id]"
26 echo "Tags a new coreboot version and creates a tar archive"
27 echo
28 echo "version: New version name to tag the tree with"
29 echo "commit id: check out this commit-id after cloning the coreboot tree"
30 echo "username: clone the tree using ssh://USERNAME - defaults to https://"
31 echo "gpg key id: used to tag the version, and generate a gpg signature"
32 exit 1
35 # Verify that tar supports --sort
36 if ! tar --sort=name -cf /dev/null /dev/null 2>/dev/null ; then
37 echo "Error: The installed version of tar does not support --sort"
38 echo " GNU tar version 1.28 or greater is required. Exiting."
39 exit 1
42 if [ ! -d "coreboot-${VERSION_NAME}" ]; then
43 declare -a GIT_REF_OPTS
44 if [ -d .git ]; then
45 GIT_REF_OPTS=("--reference" "." "--dissociate")
46 elif [ -d ../../.git ]; then
47 GIT_REF_OPTS=("--reference" "../.." "--dissociate")
49 if [ -n "${USERNAME}" ]; then
50 git clone "${GIT_REF_OPTS[@]}" "ssh://${USERNAME}@review.coreboot.org:29418/coreboot.git" "coreboot-${VERSION_NAME}" --
51 else
52 git clone "${GIT_REF_OPTS[@]}" https://review.coreboot.org/coreboot.git "coreboot-${VERSION_NAME}" --
56 cd "coreboot-${VERSION_NAME}" || exit 1
57 if [ -n "$COMMIT_ID" ]; then
58 git reset --hard "$COMMIT_ID"
61 util/crossgcc/buildgcc -W > .crossgcc-version
63 git submodule update --init --checkout
64 if [ -n "$GPG_KEY_ID" ]; then
65 git tag -a -s -u "$GPG_KEY_ID" --force "$VERSION_NAME" -m "coreboot version $VERSION_NAME"
66 else
67 git tag -a --force "$VERSION_NAME" -m "coreboot version $VERSION_NAME"
70 printf "%s-%s\n" "$VERSION_NAME" "$(git log --pretty=%h -1)" > .coreboot-version
71 tstamp=$(git log --pretty=format:%ci -1)
72 cd ..
74 exclude_paths="3rdparty/blobs "
75 exclude_paths+="3rdparty/fsp "
76 exclude_paths+="3rdparty/intel-microcode "
77 exclude_paths+="3rdparty/amd_blobs "
78 exclude_paths+="3rdparty/qc_blobs "
80 declare -a blobs_paths
81 declare -a exclude_opts
82 for i in ${exclude_paths}; do
83 blobs_paths+=("coreboot-${VERSION_NAME}/${i}")
84 exclude_opts+=("--exclude=coreboot-${VERSION_NAME}/${i}")
85 done
87 tar --sort=name --mtime="${tstamp}" --owner=coreboot:1000 --group=coreboot:1000 --exclude=*/.git --exclude=*/.gitignore "${exclude_opts[@]}" -cvf - "coreboot-${VERSION_NAME}" |xz -9 > "coreboot-${VERSION_NAME}.tar.xz"
88 tar --sort=name --mtime="${tstamp}" --owner=coreboot:1000 --group=coreboot:1000 --exclude=*/.git --exclude=*/.gitignore -cvf - "${blobs_paths[@]}" |xz -9 > "coreboot-blobs-${VERSION_NAME}.tar.xz"
90 if [ -n "${GPG_KEY_ID}" ]; then
91 gpg --armor --local-user "$GPG_KEY_ID" --output "coreboot-${VERSION_NAME}.tar.xz.sig" --detach-sig "coreboot-${VERSION_NAME}.tar.xz"
92 gpg --armor --local-user "$GPG_KEY_ID" --output "coreboot-blobs-${VERSION_NAME}.tar.xz.sig" --detach-sig "coreboot-blobs-${VERSION_NAME}.tar.xz"