[disco:linux-azure, xenial:linux-azure][PATCH 1/3] UBUNTU: SAUCE: sgx-update: Add script to fetch SGX from Intel repo

Connor Kuehl connor.kuehl at canonical.com
Tue Sep 24 15:53:04 UTC 2019


On 9/17/19 4:05 AM, Marcelo Henrique Cerri wrote:
> BugLink: https://bugs.launchpad.net/bugs/1844245
> 
> Add a script to simplify the process of fetching the new version of
> the SGX driver source code.
> 
> The user is still responsible for reviewing the new changes and
> tagging the commit with a proper launchpad bug.
> 
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri at canonical.com>
> ---
>   ubuntu/Makefile   |  4 ++++
>   ubuntu/sgx-update | 33 +++++++++++++++++++++++++++++++++
>   2 files changed, 37 insertions(+)
>   create mode 100755 ubuntu/sgx-update
> 
> diff --git a/ubuntu/Makefile b/ubuntu/Makefile
> index c499b2112dec..3230b018df8c 100644
> --- a/ubuntu/Makefile
> +++ b/ubuntu/Makefile
> @@ -31,6 +31,10 @@ endif
>   ##
>   ##
>   ##
> +obj-y += sgx/
> +##
> +##
> +##
>   ##
>   ##
>   ##
> diff --git a/ubuntu/sgx-update b/ubuntu/sgx-update
> new file mode 100755
> index 000000000000..3f701040337f
> --- /dev/null
> +++ b/ubuntu/sgx-update
> @@ -0,0 +1,33 @@
> +#!/bin/bash -eu
> +remote_repo="${1:-https://github.com/haimc-intel/SGXDataCenterAttestationPrimitives}"
> +remote_branch="${2:-inker-ph1}"
> +driver_path=driver/linux/
> +
> +# Get the latest version of the driver
> +tmp=$(mktemp -d)
> +trap "rm -rf '$tmp'" 0
> +git clone "$remote_repo" ${remote_branch:+-b "$remote_branch"} "$tmp"
> +commit_id="$(cd "$tmp" && git rev-parse HEAD)"
> +
> +# Sync the new files
> +here="$(readlink -f "$(dirname "$0")")"
> +intree_path="$here/sgx/"
> +include_path="$here/../arch/x86/include/"
> +git rm -rf "$intree_path" || true
> +mkdir "$intree_path"
> +rsync -av "$tmp/$driver_path/"* "$intree_path/" \
> +      --exclude 'include' \
> +      --exclude '*.conf' \
> +      --exclude '*.rules'
> +rsync -av "$tmp/$driver_path/include/"* "$include_path/"

Could we investigate a way to do this by using git-format-patch on the 
Github repository and then 'sed' the proper file paths into the patches 
that result? Then we apply them onto our tree. This might make it easier 
for possible bisections.



More information about the kernel-team mailing list