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 } ################################################################################