From 71332f591af7a73fd38fa5c8b4fcb7eaf5355212 Mon Sep 17 00:00:00 2001 From: Jean-Yves Vet Date: Tue, 25 Aug 2020 18:24:14 +0200 Subject: [PATCH] Add -p option to cherry-pick a patchset This patch adds the -p/--patchset option to cherry-pick a patchset on the top of a coreboot tag or commit. The patchset should be submitted for review (not necessarily merged) to the gerrit owned by coreboot.org. --- build.sh | 5 +++++ common/download_coreboot.sh | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/build.sh b/build.sh index f73b3ed..42934ed 100755 --- a/build.sh +++ b/build.sh @@ -25,6 +25,7 @@ usage() echo " -c, --commit Git commit hash" echo " -h, --help Show this help" echo " -i, --config Execute with interactive make config" + echo " -p, --patchset Cherry-pick a patch set which is not merged yet" echo " -t, --tag Git tag/version" echo echo "If a tag, commit or bleeding-edge flag is not given, the latest Coreboot release will be built." @@ -55,6 +56,9 @@ do -i | --config) COREBOOT_CONFIG=true shift 1;; + -p | --patchset) + COREBOOT_PATCHSET="$2" + shift 2;; -t | --tag) COREBOOT_TAG="$2" shift 2;; @@ -93,6 +97,7 @@ docker run --rm -it \ -v "$PWD/$MODEL:$DOCKER_SCRIPT_DIR" \ -v "$PWD/common:$DOCKER_COMMON_SCRIPT_DIR" \ -e COREBOOT_COMMIT="$COREBOOT_COMMIT" \ + -e COREBOOT_PATCHSET="$COREBOOT_PATCHSET" \ -e COREBOOT_TAG="$COREBOOT_TAG" \ -e COREBOOT_CONFIG="$COREBOOT_CONFIG" \ coreboot/coreboot-sdk:"$COREBOOT_SDK_VERSION" \ diff --git a/common/download_coreboot.sh b/common/download_coreboot.sh index 7e06c45..34d4c37 100755 --- a/common/download_coreboot.sh +++ b/common/download_coreboot.sh @@ -60,6 +60,20 @@ function checkoutCommit() { } ################################################################################ +################################################################################ +## Cherry-pick a patchset +################################################################################ +function cherryPickPatchset() { + cd "$DOCKER_COREBOOT_DIR" || exit + + # Workaround git complaining about unset email + git config --global user.email "dummys@docker.com" && git config --global user.name "skull.docker" + + git fetch "https://review.coreboot.org/coreboot" "$COREBOOT_PATCHSET" || exit + git cherry-pick FETCH_HEAD || exit + + git submodule update --recursive --remote +} ################################################################################ ## Download the latest released version of Coreboot @@ -100,5 +114,9 @@ function downloadOrUpdateCoreboot() { gitUpdate checkoutTag fi + + if [ "$COREBOOT_PATCHSET" ]; then + cherryPickPatchset + fi } ################################################################################