* [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments
2021-02-11 17:46 [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages Grant Likely
@ 2021-02-11 17:46 ` Grant Likely
2021-02-15 11:45 ` G Edhaya Chandran
2021-02-20 16:03 ` Samer El-Haj-Mahmoud
2021-02-11 17:46 ` [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format Grant Likely
` (2 subsequent siblings)
3 siblings, 2 replies; 14+ messages in thread
From: Grant Likely @ 2021-02-11 17:46 UTC (permalink / raw)
To: devel, G Edhaya Chandran, Barton Gao
Cc: nd, Samer El-Haj-Mahmoud, Grant Likely
The script was using a big list of numerical argument to pass on extra
parameters. Use the bash 'shift' command to carve of arguments for the
script so that $@ can be used for the remainder.
Signed-off-by: Grant Likely <grant.likely@arm.com>
---
uefi-sct/SctPkg/build.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh
index 22cf9667..3b1414ca 100755
--- a/uefi-sct/SctPkg/build.sh
+++ b/uefi-sct/SctPkg/build.sh
@@ -189,13 +189,16 @@ case `uname` in
;;
esac
+# Drop parsed command line arguments
+shift 2
+
echo "TOOLCHAIN is ${TARGET_TOOLS}"
export ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE
echo "Toolchain prefix: ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE"
SCT_BUILD=DEBUG
-if [ "$3" = "RELEASE" -o "$3" = "DEBUG" ]; then
- SCT_BUILD=$3
+if [ "$1" = "RELEASE" -o "$1" = "DEBUG" ]; then
+ SCT_BUILD=$1
shift
fi
@@ -254,7 +257,7 @@ cp $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin
#
for DSC in SctPkg/UEFI/UEFI_SCT.dsc SctPkg/UEFI/IHV_SCT.dsc $DSC_EXTRA
do
- build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
+ build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $@
# Check if there is any error
status=$?
if test $status -ne 0
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments
2021-02-11 17:46 ` [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments Grant Likely
@ 2021-02-15 11:45 ` G Edhaya Chandran
2021-02-20 16:03 ` Samer El-Haj-Mahmoud
1 sibling, 0 replies; 14+ messages in thread
From: G Edhaya Chandran @ 2021-02-15 11:45 UTC (permalink / raw)
To: Grant Likely, devel@edk2.groups.io, Barton Gao; +Cc: nd, Samer El-Haj-Mahmoud
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>
> -----Original Message-----
> From: Grant Likely <Grant.Likely@arm.com>
> Sent: 11 February 2021 23:16
> To: devel@edk2.groups.io; G Edhaya Chandran <Edhaya.Chandran@arm.com>;
> Barton Gao <gaojie@byosoft.com.cn>
> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>
> Subject: [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage
> arguments
>
> The script was using a big list of numerical argument to pass on extra
> parameters. Use the bash 'shift' command to carve of arguments for the script
> so that $@ can be used for the remainder.
>
> Signed-off-by: Grant Likely <grant.likely@arm.com>
> ---
> uefi-sct/SctPkg/build.sh | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh index
> 22cf9667..3b1414ca 100755
> --- a/uefi-sct/SctPkg/build.sh
> +++ b/uefi-sct/SctPkg/build.sh
> @@ -189,13 +189,16 @@ case `uname` in
> ;;
> esac
>
> +# Drop parsed command line arguments
> +shift 2
> +
> echo "TOOLCHAIN is ${TARGET_TOOLS}"
> export ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE
> echo "Toolchain prefix:
> ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE"
>
> SCT_BUILD=DEBUG
> -if [ "$3" = "RELEASE" -o "$3" = "DEBUG" ]; then
> - SCT_BUILD=$3
> +if [ "$1" = "RELEASE" -o "$1" = "DEBUG" ]; then
> + SCT_BUILD=$1
> shift
> fi
>
> @@ -254,7 +257,7 @@ cp $EDK_TOOLS_PATH/Source/C/bin/GenBin
> $DEST_DIR/GenBin # for DSC in SctPkg/UEFI/UEFI_SCT.dsc
> SctPkg/UEFI/IHV_SCT.dsc $DSC_EXTRA do
> - build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b
> $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> + build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b
> $SCT_BUILD $@
> # Check if there is any error
> status=$?
> if test $status -ne 0
> --
> 2.20.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments
2021-02-11 17:46 ` [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments Grant Likely
2021-02-15 11:45 ` G Edhaya Chandran
@ 2021-02-20 16:03 ` Samer El-Haj-Mahmoud
2021-02-22 12:50 ` [edk2-devel] " G Edhaya Chandran
1 sibling, 1 reply; 14+ messages in thread
From: Samer El-Haj-Mahmoud @ 2021-02-20 16:03 UTC (permalink / raw)
To: Grant Likely, devel@edk2.groups.io, G Edhaya Chandran, Barton Gao; +Cc: nd
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> -----Original Message-----
> From: Grant Likely <Grant.Likely@arm.com>
> Sent: Thursday, February 11, 2021 12:46 PM
> To: devel@edk2.groups.io; G Edhaya Chandran
> <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>
> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>
> Subject: [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to
> manage arguments
>
> The script was using a big list of numerical argument to pass on extra
> parameters. Use the bash 'shift' command to carve of arguments for the
> script so that $@ can be used for the remainder.
>
> Signed-off-by: Grant Likely <grant.likely@arm.com>
> ---
> uefi-sct/SctPkg/build.sh | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh index
> 22cf9667..3b1414ca 100755
> --- a/uefi-sct/SctPkg/build.sh
> +++ b/uefi-sct/SctPkg/build.sh
> @@ -189,13 +189,16 @@ case `uname` in
> ;;
> esac
>
> +# Drop parsed command line arguments
> +shift 2
> +
> echo "TOOLCHAIN is ${TARGET_TOOLS}"
> export
> ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE
> echo "Toolchain prefix:
> ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE"
>
> SCT_BUILD=DEBUG
> -if [ "$3" = "RELEASE" -o "$3" = "DEBUG" ]; then
> - SCT_BUILD=$3
> +if [ "$1" = "RELEASE" -o "$1" = "DEBUG" ]; then
> + SCT_BUILD=$1
> shift
> fi
>
> @@ -254,7 +257,7 @@ cp $EDK_TOOLS_PATH/Source/C/bin/GenBin
> $DEST_DIR/GenBin # for DSC in SctPkg/UEFI/UEFI_SCT.dsc
> SctPkg/UEFI/IHV_SCT.dsc $DSC_EXTRA do
> - build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b
> $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> + build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b
> $SCT_BUILD $@
> # Check if there is any error
> status=$?
> if test $status -ne 0
> --
> 2.20.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format
2021-02-11 17:46 [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages Grant Likely
2021-02-11 17:46 ` [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments Grant Likely
@ 2021-02-11 17:46 ` Grant Likely
2021-02-15 12:30 ` G Edhaya Chandran
2021-02-20 16:03 ` Samer El-Haj-Mahmoud
2021-02-15 11:43 ` [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages G Edhaya Chandran
2021-02-20 16:03 ` Samer El-Haj-Mahmoud
3 siblings, 2 replies; 14+ messages in thread
From: Grant Likely @ 2021-02-11 17:46 UTC (permalink / raw)
To: devel, G Edhaya Chandran, Barton Gao
Cc: nd, Samer El-Haj-Mahmoud, Grant Likely
The buildzip.sh script builds the SCT and the EFI Shell, and then zips
them up in a file structure that can be booted when unzipped to a USB
drive or other block storage.
Signed-off-by: Grant Likely <grant.likely@arm.com>
---
uefi-sct/SctPkg/buildzip.sh | 67 +++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100755 uefi-sct/SctPkg/buildzip.sh
diff --git a/uefi-sct/SctPkg/buildzip.sh b/uefi-sct/SctPkg/buildzip.sh
new file mode 100755
index 00000000..c5bf20df
--- /dev/null
+++ b/uefi-sct/SctPkg/buildzip.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+#
+# EDK2 SCT build script for SCT+Shell in a zip file
+#
+# Copyright (c) 2021, ARM Ltd. All rights reserved.
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+set -e
+
+TARGET_ARCH=$1
+
+if [ X"${TARGET_ARCH}" == X"" ]
+then
+ echo "Usage: $0 <ARM|AARCH64>"
+ exit
+fi
+
+case $TARGET_ARCH in
+ AARCH64)
+ BOOT_IMAGE_NAME=BOOTAA64.efi;;
+ *)
+ BOOT_IMAGE_NAME=BOOT${TARGET_ARCH}.efi;;
+esac
+
+# clear all positional parameters
+set --
+
+source ./edk2/edksetup.sh
+
+getconf _NPROCESSORS_ONLN
+NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
+
+make -j"$NUM_CPUS" -C edk2/BaseTools/
+
+# Build the SCT and the shell
+DSC_EXTRA=ShellPkg/ShellPkg.dsc ./SctPkg/build.sh ${TARGET_ARCH} GCC RELEASE -j"$NUM_CPUS"
+
+# Assemble all the files that need to be in the zip file
+mkdir -p ${TARGET_ARCH}_SCT/EFI/BOOT
+cp Build/Shell/RELEASE_GCC5/${TARGET_ARCH}/Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi ${TARGET_ARCH}_SCT/EFI/BOOT/${BOOT_IMAGE_NAME}
+
+mkdir -p ${TARGET_ARCH}_SCT/SCT
+cp -r Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/${TARGET_ARCH}/* ${TARGET_ARCH}_SCT/SCT/
+cp Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/SctStartup.nsh ${TARGET_ARCH}_SCT/Startup.nsh
+
+# Copy the SCT Parser tool into the repo
+cp sct_parser/* ${TARGET_ARCH}_SCT/SCT/Sequence/
+
+# Put some version information into the ESP directory
+cat > ./${TARGET_ARCH}_SCT/versions.txt << EOF
+EDK2_VER=`git -C ./edk2 describe`
+EDK2_TEST_VER=`git -C ./edk2-test describe`
+BUILD_DATE="`date`"
+EOF
+
+# Zip up the test folder
+cd ${TARGET_ARCH}_SCT
+zip -r ../edk2-test-${TARGET_ARCH,,}.zip *
+cd ..
+
--
2.20.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format
2021-02-11 17:46 ` [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format Grant Likely
@ 2021-02-15 12:30 ` G Edhaya Chandran
2021-02-19 18:01 ` Grant Likely
2021-02-20 16:03 ` Samer El-Haj-Mahmoud
1 sibling, 1 reply; 14+ messages in thread
From: G Edhaya Chandran @ 2021-02-15 12:30 UTC (permalink / raw)
To: Grant Likely, devel@edk2.groups.io, Barton Gao; +Cc: nd, Samer El-Haj-Mahmoud
Hi Grant,
A minor comment:
+getconf _NPROCESSORS_ONLN
This print may not be needed.
With Warm Regards,
Edhay
> -----Original Message-----
> From: Grant Likely <Grant.Likely@arm.com>
> Sent: 11 February 2021 23:16
> To: devel@edk2.groups.io; G Edhaya Chandran <Edhaya.Chandran@arm.com>;
> Barton Gao <gaojie@byosoft.com.cn>
> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>
> Subject: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a
> bootable format
>
> The buildzip.sh script builds the SCT and the EFI Shell, and then zips them up in
> a file structure that can be booted when unzipped to a USB drive or other block
> storage.
>
> Signed-off-by: Grant Likely <grant.likely@arm.com>
> ---
> uefi-sct/SctPkg/buildzip.sh | 67 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
> create mode 100755 uefi-sct/SctPkg/buildzip.sh
>
> diff --git a/uefi-sct/SctPkg/buildzip.sh b/uefi-sct/SctPkg/buildzip.sh new file
> mode 100755 index 00000000..c5bf20df
> --- /dev/null
> +++ b/uefi-sct/SctPkg/buildzip.sh
> @@ -0,0 +1,67 @@
> +#!/bin/bash
> +#
> +# EDK2 SCT build script for SCT+Shell in a zip file # # Copyright (c)
> +2021, ARM Ltd. All rights reserved.
> +#
> +# This program and the accompanying materials # are licensed and made
> +available under the terms and conditions of the BSD License # which
> +accompanies this distribution. The full text of the license may be
> +found at # http://opensource.org/licenses/bsd-license.php
> +#
> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> EITHER EXPRESS OR IMPLIED.
> +
> +set -e
> +
> +TARGET_ARCH=$1
> +
> +if [ X"${TARGET_ARCH}" == X"" ]
> +then
> + echo "Usage: $0 <ARM|AARCH64>"
> + exit
> +fi
> +
> +case $TARGET_ARCH in
> + AARCH64)
> + BOOT_IMAGE_NAME=BOOTAA64.efi;;
> + *)
> + BOOT_IMAGE_NAME=BOOT${TARGET_ARCH}.efi;;
> +esac
> +
> +# clear all positional parameters
> +set --
> +
> +source ./edk2/edksetup.sh
> +
> +getconf _NPROCESSORS_ONLN
> +NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
> +
> +make -j"$NUM_CPUS" -C edk2/BaseTools/
> +
> +# Build the SCT and the shell
> +DSC_EXTRA=ShellPkg/ShellPkg.dsc ./SctPkg/build.sh ${TARGET_ARCH} GCC
> RELEASE -j"$NUM_CPUS"
> +
> +# Assemble all the files that need to be in the zip file mkdir -p
> +${TARGET_ARCH}_SCT/EFI/BOOT cp
> +Build/Shell/RELEASE_GCC5/${TARGET_ARCH}/Shell_EA4BB293-2D7F-4456-
> A681-1
> +F22F42CD0BC.efi ${TARGET_ARCH}_SCT/EFI/BOOT/${BOOT_IMAGE_NAME}
> +
> +mkdir -p ${TARGET_ARCH}_SCT/SCT
> +cp -r
> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/${TARGET_ARCH}
> /*
> +${TARGET_ARCH}_SCT/SCT/ cp
> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/SctStartup.nsh
> +${TARGET_ARCH}_SCT/Startup.nsh
> +
> +# Copy the SCT Parser tool into the repo cp sct_parser/*
> +${TARGET_ARCH}_SCT/SCT/Sequence/
> +
> +# Put some version information into the ESP directory cat >
> +./${TARGET_ARCH}_SCT/versions.txt << EOF EDK2_VER=`git -C ./edk2
> +describe` EDK2_TEST_VER=`git -C ./edk2-test describe`
> +BUILD_DATE="`date`"
> +EOF
> +
> +# Zip up the test folder
> +cd ${TARGET_ARCH}_SCT
> +zip -r ../edk2-test-${TARGET_ARCH,,}.zip * cd ..
> +
> --
> 2.20.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format
2021-02-15 12:30 ` G Edhaya Chandran
@ 2021-02-19 18:01 ` Grant Likely
2021-02-19 18:39 ` G Edhaya Chandran
2021-02-22 12:58 ` [edk2-devel] " G Edhaya Chandran
0 siblings, 2 replies; 14+ messages in thread
From: Grant Likely @ 2021-02-19 18:01 UTC (permalink / raw)
To: G Edhaya Chandran, devel@edk2.groups.io, Barton Gao
Cc: nd, Samer El-Haj-Mahmoud
On 15/02/2021 12:30, G Edhaya Chandran wrote:
> Hi Grant,
>
> A minor comment:
>
> +getconf _NPROCESSORS_ONLN
> This print may not be needed.
No, not needed. I seem to have left in a debug bit. Do you need me to
respin the series, or can I just submit a followup patch to clean it up?
g.
>
>
> With Warm Regards,
> Edhay
>
>
>> -----Original Message-----
>> From: Grant Likely <Grant.Likely@arm.com>
>> Sent: 11 February 2021 23:16
>> To: devel@edk2.groups.io; G Edhaya Chandran <Edhaya.Chandran@arm.com>;
>> Barton Gao <gaojie@byosoft.com.cn>
>> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
>> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>
>> Subject: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a
>> bootable format
>>
>> The buildzip.sh script builds the SCT and the EFI Shell, and then zips them up in
>> a file structure that can be booted when unzipped to a USB drive or other block
>> storage.
>>
>> Signed-off-by: Grant Likely <grant.likely@arm.com>
>> ---
>> uefi-sct/SctPkg/buildzip.sh | 67 +++++++++++++++++++++++++++++++++++++
>> 1 file changed, 67 insertions(+)
>> create mode 100755 uefi-sct/SctPkg/buildzip.sh
>>
>> diff --git a/uefi-sct/SctPkg/buildzip.sh b/uefi-sct/SctPkg/buildzip.sh new file
>> mode 100755 index 00000000..c5bf20df
>> --- /dev/null
>> +++ b/uefi-sct/SctPkg/buildzip.sh
>> @@ -0,0 +1,67 @@
>> +#!/bin/bash
>> +#
>> +# EDK2 SCT build script for SCT+Shell in a zip file # # Copyright (c)
>> +2021, ARM Ltd. All rights reserved.
>> +#
>> +# This program and the accompanying materials # are licensed and made
>> +available under the terms and conditions of the BSD License # which
>> +accompanies this distribution. The full text of the license may be
>> +found at # http://opensource.org/licenses/bsd-license.php
>> +#
>> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>> +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
>> EITHER EXPRESS OR IMPLIED.
>> +
>> +set -e
>> +
>> +TARGET_ARCH=$1
>> +
>> +if [ X"${TARGET_ARCH}" == X"" ]
>> +then
>> + echo "Usage: $0 <ARM|AARCH64>"
>> + exit
>> +fi
>> +
>> +case $TARGET_ARCH in
>> + AARCH64)
>> + BOOT_IMAGE_NAME=BOOTAA64.efi;;
>> + *)
>> + BOOT_IMAGE_NAME=BOOT${TARGET_ARCH}.efi;;
>> +esac
>> +
>> +# clear all positional parameters
>> +set --
>> +
>> +source ./edk2/edksetup.sh
>> +
>> +getconf _NPROCESSORS_ONLN
>> +NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
>> +
>> +make -j"$NUM_CPUS" -C edk2/BaseTools/
>> +
>> +# Build the SCT and the shell
>> +DSC_EXTRA=ShellPkg/ShellPkg.dsc ./SctPkg/build.sh ${TARGET_ARCH} GCC
>> RELEASE -j"$NUM_CPUS"
>> +
>> +# Assemble all the files that need to be in the zip file mkdir -p
>> +${TARGET_ARCH}_SCT/EFI/BOOT cp
>> +Build/Shell/RELEASE_GCC5/${TARGET_ARCH}/Shell_EA4BB293-2D7F-4456-
>> A681-1
>> +F22F42CD0BC.efi ${TARGET_ARCH}_SCT/EFI/BOOT/${BOOT_IMAGE_NAME}
>> +
>> +mkdir -p ${TARGET_ARCH}_SCT/SCT
>> +cp -r
>> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/${TARGET_ARCH}
>> /*
>> +${TARGET_ARCH}_SCT/SCT/ cp
>> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/SctStartup.nsh
>> +${TARGET_ARCH}_SCT/Startup.nsh
>> +
>> +# Copy the SCT Parser tool into the repo cp sct_parser/*
>> +${TARGET_ARCH}_SCT/SCT/Sequence/
>> +
>> +# Put some version information into the ESP directory cat >
>> +./${TARGET_ARCH}_SCT/versions.txt << EOF EDK2_VER=`git -C ./edk2
>> +describe` EDK2_TEST_VER=`git -C ./edk2-test describe`
>> +BUILD_DATE="`date`"
>> +EOF
>> +
>> +# Zip up the test folder
>> +cd ${TARGET_ARCH}_SCT
>> +zip -r ../edk2-test-${TARGET_ARCH,,}.zip * cd ..
>> +
>> --
>> 2.20.1
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format
2021-02-19 18:01 ` Grant Likely
@ 2021-02-19 18:39 ` G Edhaya Chandran
2021-02-22 12:58 ` [edk2-devel] " G Edhaya Chandran
1 sibling, 0 replies; 14+ messages in thread
From: G Edhaya Chandran @ 2021-02-19 18:39 UTC (permalink / raw)
To: Grant Likely, devel@edk2.groups.io, Barton Gao; +Cc: nd, Samer El-Haj-Mahmoud
Hi Grant,
I will remove this one line while upstreaming.
No need to submit another patch.
With Warm Regards,
Edhay
> -----Original Message-----
> From: Grant Likely <Grant.Likely@arm.com>
> Sent: 19 February 2021 23:32
> To: G Edhaya Chandran <Edhaya.Chandran@arm.com>; devel@edk2.groups.io;
> Barton Gao <gaojie@byosoft.com.cn>
> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>
> Subject: Re: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in
> a bootable format
>
>
>
> On 15/02/2021 12:30, G Edhaya Chandran wrote:
> > Hi Grant,
> >
> > A minor comment:
> >
> > +getconf _NPROCESSORS_ONLN
> > This print may not be needed.
>
> No, not needed. I seem to have left in a debug bit. Do you need me to respin
> the series, or can I just submit a followup patch to clean it up?
>
> g.
>
> >
> >
> > With Warm Regards,
> > Edhay
> >
> >
> >> -----Original Message-----
> >> From: Grant Likely <Grant.Likely@arm.com>
> >> Sent: 11 February 2021 23:16
> >> To: devel@edk2.groups.io; G Edhaya Chandran
> >> <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>
> >> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> >> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>
> >> Subject: [edk2-sct PATCH 3/3] edk2-test: Helper script to build
> >> SCT+Shell in a bootable format
> >>
> >> The buildzip.sh script builds the SCT and the EFI Shell, and then
> >> zips them up in a file structure that can be booted when unzipped to
> >> a USB drive or other block storage.
> >>
> >> Signed-off-by: Grant Likely <grant.likely@arm.com>
> >> ---
> >> uefi-sct/SctPkg/buildzip.sh | 67
> +++++++++++++++++++++++++++++++++++++
> >> 1 file changed, 67 insertions(+)
> >> create mode 100755 uefi-sct/SctPkg/buildzip.sh
> >>
> >> diff --git a/uefi-sct/SctPkg/buildzip.sh
> >> b/uefi-sct/SctPkg/buildzip.sh new file mode 100755 index
> >> 00000000..c5bf20df
> >> --- /dev/null
> >> +++ b/uefi-sct/SctPkg/buildzip.sh
> >> @@ -0,0 +1,67 @@
> >> +#!/bin/bash
> >> +#
> >> +# EDK2 SCT build script for SCT+Shell in a zip file # # Copyright
> >> +(c) 2021, ARM Ltd. All rights reserved.
> >> +#
> >> +# This program and the accompanying materials # are licensed and
> >> +made available under the terms and conditions of the BSD License #
> >> +which accompanies this distribution. The full text of the license
> >> +may be found at # http://opensource.org/licenses/bsd-license.php
> >> +#
> >> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> >> +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> >> EITHER EXPRESS OR IMPLIED.
> >> +
> >> +set -e
> >> +
> >> +TARGET_ARCH=$1
> >> +
> >> +if [ X"${TARGET_ARCH}" == X"" ]
> >> +then
> >> + echo "Usage: $0 <ARM|AARCH64>"
> >> + exit
> >> +fi
> >> +
> >> +case $TARGET_ARCH in
> >> + AARCH64)
> >> + BOOT_IMAGE_NAME=BOOTAA64.efi;;
> >> + *)
> >> + BOOT_IMAGE_NAME=BOOT${TARGET_ARCH}.efi;;
> >> +esac
> >> +
> >> +# clear all positional parameters
> >> +set --
> >> +
> >> +source ./edk2/edksetup.sh
> >> +
> >> +getconf _NPROCESSORS_ONLN
> >> +NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
> >> +
> >> +make -j"$NUM_CPUS" -C edk2/BaseTools/
> >> +
> >> +# Build the SCT and the shell
> >> +DSC_EXTRA=ShellPkg/ShellPkg.dsc ./SctPkg/build.sh ${TARGET_ARCH} GCC
> >> RELEASE -j"$NUM_CPUS"
> >> +
> >> +# Assemble all the files that need to be in the zip file mkdir -p
> >> +${TARGET_ARCH}_SCT/EFI/BOOT cp
> >> +Build/Shell/RELEASE_GCC5/${TARGET_ARCH}/Shell_EA4BB293-2D7F-4456-
> >> A681-1
> >> +F22F42CD0BC.efi
> ${TARGET_ARCH}_SCT/EFI/BOOT/${BOOT_IMAGE_NAME}
> >> +
> >> +mkdir -p ${TARGET_ARCH}_SCT/SCT
> >> +cp -r
> >>
> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/${TARGET_ARCH}
> >> /*
> >> +${TARGET_ARCH}_SCT/SCT/ cp
> >> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/SctStartup.nsh
> >> +${TARGET_ARCH}_SCT/Startup.nsh
> >> +
> >> +# Copy the SCT Parser tool into the repo cp sct_parser/*
> >> +${TARGET_ARCH}_SCT/SCT/Sequence/
> >> +
> >> +# Put some version information into the ESP directory cat >
> >> +./${TARGET_ARCH}_SCT/versions.txt << EOF EDK2_VER=`git -C ./edk2
> >> +describe` EDK2_TEST_VER=`git -C ./edk2-test describe`
> >> +BUILD_DATE="`date`"
> >> +EOF
> >> +
> >> +# Zip up the test folder
> >> +cd ${TARGET_ARCH}_SCT
> >> +zip -r ../edk2-test-${TARGET_ARCH,,}.zip * cd ..
> >> +
> >> --
> >> 2.20.1
> >
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format
2021-02-19 18:01 ` Grant Likely
2021-02-19 18:39 ` G Edhaya Chandran
@ 2021-02-22 12:58 ` G Edhaya Chandran
1 sibling, 0 replies; 14+ messages in thread
From: G Edhaya Chandran @ 2021-02-22 12:58 UTC (permalink / raw)
To: Grant Likely, devel
[-- Attachment #1: Type: text/plain, Size: 161 bytes --]
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>
Upstreamed by : https://github.com/tianocore/edk2-test/commit/92efde18495c2c77ceac1a0cd0d34c32b8e13431
[-- Attachment #2: Type: text/html, Size: 171 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format
2021-02-11 17:46 ` [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format Grant Likely
2021-02-15 12:30 ` G Edhaya Chandran
@ 2021-02-20 16:03 ` Samer El-Haj-Mahmoud
1 sibling, 0 replies; 14+ messages in thread
From: Samer El-Haj-Mahmoud @ 2021-02-20 16:03 UTC (permalink / raw)
To: Grant Likely, devel@edk2.groups.io, G Edhaya Chandran, Barton Gao
Cc: nd, Samer El-Haj-Mahmoud
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> -----Original Message-----
> From: Grant Likely <Grant.Likely@arm.com>
> Sent: Thursday, February 11, 2021 12:46 PM
> To: devel@edk2.groups.io; G Edhaya Chandran
> <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>
> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>
> Subject: [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a
> bootable format
>
> The buildzip.sh script builds the SCT and the EFI Shell, and then zips them up
> in a file structure that can be booted when unzipped to a USB drive or other
> block storage.
>
> Signed-off-by: Grant Likely <grant.likely@arm.com>
> ---
> uefi-sct/SctPkg/buildzip.sh | 67
> +++++++++++++++++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
> create mode 100755 uefi-sct/SctPkg/buildzip.sh
>
> diff --git a/uefi-sct/SctPkg/buildzip.sh b/uefi-sct/SctPkg/buildzip.sh new file
> mode 100755 index 00000000..c5bf20df
> --- /dev/null
> +++ b/uefi-sct/SctPkg/buildzip.sh
> @@ -0,0 +1,67 @@
> +#!/bin/bash
> +#
> +# EDK2 SCT build script for SCT+Shell in a zip file # # Copyright (c)
> +2021, ARM Ltd. All rights reserved.
> +#
> +# This program and the accompanying materials # are licensed and made
> +available under the terms and conditions of the BSD License # which
> +accompanies this distribution. The full text of the license may be
> +found at # http://opensource.org/licenses/bsd-license.php
> +#
> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> EITHER EXPRESS OR IMPLIED.
> +
> +set -e
> +
> +TARGET_ARCH=$1
> +
> +if [ X"${TARGET_ARCH}" == X"" ]
> +then
> + echo "Usage: $0 <ARM|AARCH64>"
> + exit
> +fi
> +
> +case $TARGET_ARCH in
> + AARCH64)
> + BOOT_IMAGE_NAME=BOOTAA64.efi;;
> + *)
> + BOOT_IMAGE_NAME=BOOT${TARGET_ARCH}.efi;;
> +esac
> +
> +# clear all positional parameters
> +set --
> +
> +source ./edk2/edksetup.sh
> +
> +getconf _NPROCESSORS_ONLN
> +NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
> +
> +make -j"$NUM_CPUS" -C edk2/BaseTools/
> +
> +# Build the SCT and the shell
> +DSC_EXTRA=ShellPkg/ShellPkg.dsc ./SctPkg/build.sh ${TARGET_ARCH} GCC
> RELEASE -j"$NUM_CPUS"
> +
> +# Assemble all the files that need to be in the zip file mkdir -p
> +${TARGET_ARCH}_SCT/EFI/BOOT cp
> +Build/Shell/RELEASE_GCC5/${TARGET_ARCH}/Shell_EA4BB293-2D7F-4456-
> A681-1
> +F22F42CD0BC.efi
> ${TARGET_ARCH}_SCT/EFI/BOOT/${BOOT_IMAGE_NAME}
> +
> +mkdir -p ${TARGET_ARCH}_SCT/SCT
> +cp -r
> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/${TARGET_ARC
> H}/*
> +${TARGET_ARCH}_SCT/SCT/ cp
> +Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/SctStartup.nsh
> +${TARGET_ARCH}_SCT/Startup.nsh
> +
> +# Copy the SCT Parser tool into the repo cp sct_parser/*
> +${TARGET_ARCH}_SCT/SCT/Sequence/
> +
> +# Put some version information into the ESP directory cat >
> +./${TARGET_ARCH}_SCT/versions.txt << EOF EDK2_VER=`git -C ./edk2
> +describe` EDK2_TEST_VER=`git -C ./edk2-test describe`
> +BUILD_DATE="`date`"
> +EOF
> +
> +# Zip up the test folder
> +cd ${TARGET_ARCH}_SCT
> +zip -r ../edk2-test-${TARGET_ARCH,,}.zip * cd ..
> +
> --
> 2.20.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages
2021-02-11 17:46 [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages Grant Likely
2021-02-11 17:46 ` [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments Grant Likely
2021-02-11 17:46 ` [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format Grant Likely
@ 2021-02-15 11:43 ` G Edhaya Chandran
2021-02-20 16:03 ` Samer El-Haj-Mahmoud
3 siblings, 0 replies; 14+ messages in thread
From: G Edhaya Chandran @ 2021-02-15 11:43 UTC (permalink / raw)
To: Grant Likely, devel@edk2.groups.io, Barton Gao
Cc: nd, Samer El-Haj-Mahmoud, Samer El-Haj-Mahmoud
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>
> -----Original Message-----
> From: Grant Likely <Grant.Likely@arm.com>
> Sent: 11 February 2021 23:16
> To: devel@edk2.groups.io; G Edhaya Chandran <Edhaya.Chandran@arm.com>;
> Barton Gao <gaojie@byosoft.com.cn>
> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>; Samer El-Haj-
> Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Subject: [edk2-sct PATCH 1/3] edk2-test: Add support for building extra
> packages
>
> The build.sh script is very useful for setting up the build environment before
> calling the package build. Sometimes additional packages are needed when
> building the SCT. (e.g., it is useful to build ShellPkg).
> Refactor the build code to allow additional DSCs to be added to the build.
>
> This patch is useful when building a full SCT image that includes the
> EDK2 shell.
>
> Signed-off-by: Grant Likely <grant.likely@arm.com>
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
> Cc: Barton Gao <gaojie@byosoft.com.cn>
> Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> ---
> uefi-sct/SctPkg/build.sh | 34 +++++++++++++---------------------
> 1 file changed, 13 insertions(+), 21 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh index
> 37667711..22cf9667 100755
> --- a/uefi-sct/SctPkg/build.sh
> +++ b/uefi-sct/SctPkg/build.sh
> @@ -249,28 +249,20 @@ mkdir -p $DEST_DIR cp
> $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin
>
> #
> -# Build the SCT package
> +# Build the packages needed for the SCT # Set $DSC_EXTRA to any extra
> +packages needed for the build
> #
> -build -p SctPkg/UEFI/UEFI_SCT.dsc -a $SCT_TARGET_ARCH -t $TARGET_TOOLS
> -b $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> -
> -# Check if there is any error
> -status=$?
> -if test $status -ne 0
> -then
> - echo Could not build the UEFI SCT package
> - exit -1
> -fi
> -
> -build -p SctPkg/UEFI/IHV_SCT.dsc -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -
> b $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> -
> -# Check if there is any error
> -status=$?
> -if test $status -ne 0
> -then
> - echo Could not build the IHV SCT package
> - exit -1
> -fi
> -
> +for DSC in SctPkg/UEFI/UEFI_SCT.dsc SctPkg/UEFI/IHV_SCT.dsc $DSC_EXTRA
> +do
> + build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b
> $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> + # Check if there is any error
> + status=$?
> + if test $status -ne 0
> + then
> + echo Could not build package $DSC
> + exit -1
> + fi
> +done
>
> #
> # If the argument is clean, then don't have to generate Sct binary.
> --
> 2.20.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages
2021-02-11 17:46 [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages Grant Likely
` (2 preceding siblings ...)
2021-02-15 11:43 ` [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages G Edhaya Chandran
@ 2021-02-20 16:03 ` Samer El-Haj-Mahmoud
2021-02-22 12:17 ` [edk2-devel] " G Edhaya Chandran
3 siblings, 1 reply; 14+ messages in thread
From: Samer El-Haj-Mahmoud @ 2021-02-20 16:03 UTC (permalink / raw)
To: Grant Likely, devel@edk2.groups.io, G Edhaya Chandran, Barton Gao; +Cc: nd
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> -----Original Message-----
> From: Grant Likely <Grant.Likely@arm.com>
> Sent: Thursday, February 11, 2021 12:46 PM
> To: devel@edk2.groups.io; G Edhaya Chandran
> <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>
> Cc: nd <nd@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Grant Likely <Grant.Likely@arm.com>; Samer El-Haj-
> Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Subject: [edk2-sct PATCH 1/3] edk2-test: Add support for building extra
> packages
>
> The build.sh script is very useful for setting up the build environment before
> calling the package build. Sometimes additional packages are needed when
> building the SCT. (e.g., it is useful to build ShellPkg).
> Refactor the build code to allow additional DSCs to be added to the build.
>
> This patch is useful when building a full SCT image that includes the
> EDK2 shell.
>
> Signed-off-by: Grant Likely <grant.likely@arm.com>
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
> Cc: Barton Gao <gaojie@byosoft.com.cn>
> Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> ---
> uefi-sct/SctPkg/build.sh | 34 +++++++++++++---------------------
> 1 file changed, 13 insertions(+), 21 deletions(-)
>
> diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh index
> 37667711..22cf9667 100755
> --- a/uefi-sct/SctPkg/build.sh
> +++ b/uefi-sct/SctPkg/build.sh
> @@ -249,28 +249,20 @@ mkdir -p $DEST_DIR cp
> $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin
>
> #
> -# Build the SCT package
> +# Build the packages needed for the SCT # Set $DSC_EXTRA to any extra
> +packages needed for the build
> #
> -build -p SctPkg/UEFI/UEFI_SCT.dsc -a $SCT_TARGET_ARCH -t
> $TARGET_TOOLS -b $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> -
> -# Check if there is any error
> -status=$?
> -if test $status -ne 0
> -then
> - echo Could not build the UEFI SCT package
> - exit -1
> -fi
> -
> -build -p SctPkg/UEFI/IHV_SCT.dsc -a $SCT_TARGET_ARCH -t
> $TARGET_TOOLS -b $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> -
> -# Check if there is any error
> -status=$?
> -if test $status -ne 0
> -then
> - echo Could not build the IHV SCT package
> - exit -1
> -fi
> -
> +for DSC in SctPkg/UEFI/UEFI_SCT.dsc SctPkg/UEFI/IHV_SCT.dsc
> $DSC_EXTRA
> +do
> + build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b
> $SCT_BUILD $3 $4 $5 $6 $7 $8 $9
> + # Check if there is any error
> + status=$?
> + if test $status -ne 0
> + then
> + echo Could not build package $DSC
> + exit -1
> + fi
> +done
>
> #
> # If the argument is clean, then don't have to generate Sct binary.
> --
> 2.20.1
^ permalink raw reply [flat|nested] 14+ messages in thread