config-build-env: Switch to arago-project git
cover config-build-env: Switch to arago-project git
Here are a series of patches that are meant to:
a) be more paranoid in checking the environment it runs in
b) additional cleanups in case of weird corner cases where build folder is left in weird state
c) Finally switch over to git.ti.com tree instead of arago-project.org tree for the new location of oe-layer-setup
Nishanth Menon (5):
config-build-env: Move the oe-layer-setup to a variable
config-build-env: Lets make sure we are really in a build folder
config-build-env: Refactor to cleanup messed up build folder
config-build-env: Make sure that the git url points correctly
config-build-env: Switch arago-project git repo to ti git repo
lib/oesdk/config-build-env | 46 +++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 10 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/5 config-build-env: Move the oe-layer-setup to a variable
Lets first start preparing for cleanup by moving the git url to a variable.
--- lib/oesdk/config-build-env | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
lib/oesdk/config-build-env +3 -1
@@ -1,5 +1,7 @@ #!/bin/bash +TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git" + # This script is intended to be called only from the top-level build-oesdk.sh # script which parses the configuration file and sets necessary variables. # So check if it is being called from any other context and if so exit.
@@ -21,7 +23,7 @@ checkout_layer_scripts() { if [ ! -d $name ] then - git clone http://arago-project.org/git/projects/oe-layersetup.git $name + git clone "$TI_SDK_OELAYER_SETUP" $name elif [ -d $name/.git ] then #This looks to be a git repo. Hopefully it is the right one :)
Signature · 1 line
2.32.0
PATCH 2/5 config-build-env: Lets make sure we are really in a build folder
In reply to Nishanth MenonLets make sure that we are really in a build folder if for some reason we end up at a top layer script issue and we mess up the build machine.
--- lib/oesdk/config-build-env | 7 +++++++ 1 file changed, 7 insertions(+)
lib/oesdk/config-build-env +7 -0
@@ -21,6 +21,13 @@ checkout_layer_scripts() { name=`basename $BUILD_ROOT` + # Paranoid check: Am I really a build folder? + amibuild=`echo $BUILD_ROOT|grep "build$"` + if [ -z "$amibuild" ]; then + echo "Something horrible has happened.. BUILD_ROOT=$BUILD_ROOT does'nt end with 'build'. maynot be build folder. Aborting!" + exit 1 + fi + if [ ! -d $name ] then git clone "$TI_SDK_OELAYER_SETUP" $name
Signature · 1 line
2.32.0
PATCH 3/5 config-build-env: Refactor to cleanup messed up build folder
In reply to Nishanth MenonIn some weird, yet unknown cases, the build folder might be messed up. Lets make sure we clean that up first prior to cloning or updating the folder. This seems to happen when we force via jenkins to abort a running job, leaving the system in a weird state on the remote build machine. It is not clear what specifically is going on in the sequence, but lets add some diagnostics on if any errant processes are sticking around in the previous process (VM cleanup etc) that prevented a proper system cleanup.
--- lib/oesdk/config-build-env | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
lib/oesdk/config-build-env +18 -9
@@ -15,7 +15,7 @@ fi # conditions apply: # 1. The checkout creates the final directory of BUILD_ROOT # 2. If a git repo already exists then do a git pull -# 3. If the directory is not empty and is not a git repo then bail +# 3. If the directory is not empty and is not a git repo, then cleanup if unused checkout_layer_scripts() { cd `dirname $BUILD_ROOT`
@@ -28,18 +28,27 @@ checkout_layer_scripts() { exit 1 fi - if [ ! -d $name ] - then + # If the scripts folder exists and is not a git repo, cleanup. + if [ -e $name -a ! -d $name/.git ]; then + echo "The $BUILD_ROOT directory is present and is not a git repo - attempting to wipe it off" + users=`lsof "$BUILD_ROOT"|wc -l` + if [ $users -gt 0 ]; then + echo "ERROR:: We have users for $BUILD_ROOT folder: Aborting!!!" + lsof $BUILD_ROOT + pstree -aplG + exit 1 + fi + rm -rvf "$BUILD_ROOT" || exit 1 + fi + + + if [ ! -d $name ]; then git clone "$TI_SDK_OELAYER_SETUP" $name - elif [ -d $name/.git ] - then - #This looks to be a git repo. Hopefully it is the right one :) + else + # This looks to be a git repo. Hopefully it is the right one :) cd $BUILD_ROOT git fetch git reset --hard origin - else - echo "The $BUILD_ROOT directory is not empty and is not a git repo" - exit 1 fi }
Signature · 1 line
2.32.0
PATCH 4/5 config-build-env: Make sure that the git url points correctly
In reply to Nishanth MenonMake sure that the build scripts git url points to the correct location.
--- lib/oesdk/config-build-env | 8 ++++++++ 1 file changed, 8 insertions(+)
lib/oesdk/config-build-env +8 -0
@@ -47,6 +47,14 @@ checkout_layer_scripts() { else # This looks to be a git repo. Hopefully it is the right one :) cd $BUILD_ROOT + # In case we have changed the location of our build scripts + # we should change our git url towards it. + mygit='git remote get-url origin' + if [ "$mygit" != "$TI_SDK_OELAYER_SETUP"]; then + echo "$TI_SDK_OELAYER_SETUP Mismatch in git URL: $mygit vs $TI_SDK_OELAYER_SETUP. Force resetting the origin!" + git remote set-url origin $TI_SDK_OELAYER_SETUP + fi + git fetch git reset --hard origin fi
Signature · 1 line
2.32.0
Re: [tisdk-build-scripts PATCH 4/5] config-build-env: Make sure that the git url points correctly
Quoted 12 lines · Nishanth Menon
Make sure that the build scripts git url points to the correct location.
Signed-off-by Nishanth Menon <[email protected]>--- lib/oesdk/config-build-env | 8 ++++++++ 1 file changed, 8 insertions(+)lib/oesdk/config-build-env +0
-0
lib/oesdk/config-build-env checkout_layer_scripts() { · line 53
Quoted 7 lines
lib/oesdk/config-build-env +4
-0@@ -47,6 +47,14 @@ checkout_layer_scripts() { else # This looks to be a git repo. Hopefully it is the right one :) cd $BUILD_ROOT + # In case we have changed the location of our build scripts + # we should change our git url towards it. + mygit='git remote get-url origin' + if [ "$mygit" != "$TI_SDK_OELAYER_SETUP"]; then
There needs to be a space between "$TI_SDK_OELAYER_SETUP" and ]
if there are no further comments, and you can fix it when applying, please do. Else, do comment so that I can send an updated version.
Quoted 10 lines
lib/oesdk/config-build-env +4
-0+ echo "$TI_SDK_OELAYER_SETUP Mismatch in git URL: $mygit vs $TI_SDK_OELAYER_SETUP. Force resetting the origin!" + git remote set-url origin $TI_SDK_OELAYER_SETUP + fi + git fetch git reset --hard origin fiSignature · 1 line
2.32.0
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D)/Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
PATCH 5/5 config-build-env: Switch arago-project git repo to ti git repo
In reply to Nishanth MenonArago-project is on the way down, so flip over to git.ti.com repo
--- lib/oesdk/config-build-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/oesdk/config-build-env +1 -1
@@ -1,6 +1,6 @@ #!/bin/bash -TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git" +TI_SDK_OELAYER_SETUP="http://git.ti.com/git/arago-project/oe-layersetup.git" # This script is intended to be called only from the top-level build-oesdk.sh # script which parses the configuration file and sets necessary variables.
Signature · 1 line
2.32.0
Re: [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo
Quoted 12 lines · Nishanth Menon
Arago-project is on the way down, so flip over to git.ti.com repo
Signed-off-by Nishanth Menon <[email protected]>--- lib/oesdk/config-build-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/oesdk/config-build-env +0
-0
lib/oesdk/config-build-env line 3
Quoted 4 lines
lib/oesdk/config-build-env +1
-1@@ -1,6 +1,6 @@ #!/bin/bash -TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git" +TI_SDK_OELAYER_SETUP="http://git.ti.com/git/arago-project/oe-layersetup.git"
What's the preferred clone method on git.ti.com? I see Web UI shows these:
Clone
https://git.ti.com/git/arago-project/oe-layersetup.git
https://git.ti.com/cgit/arago-project/oe-layersetupgit://git.ti.com/arago-project/oe-layersetup.git
http://git.ti.com/git/arago-project/oe-layersetup.git
Quoted 5 lines
lib/oesdk/config-build-env +0
-0# This script is intended to be called only from the top-level build-oesdk.sh # script which parses the configuration file and sets necessary variables.Signature · 1 line
2.32.0
Signature · 4 lines
Regards, Denys Dmytriyenko <[email protected]> PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964 Fingerprint: 25FC E4A5 8A72 2F69 1186 6D76 4209 0272 9A92 C964
Re: [tisdk-build-scripts PATCH 5/5] config-build-env: Switch arago-project git repo to ti git repo
Quoted 20 lines · Denys Dmytriyenko
Quoted 12 lines · Nishanth Menon
Arago-project is on the way down, so flip over to git.ti.com repo
Signed-off-by Nishanth Menon <[email protected]>--- lib/oesdk/config-build-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/oesdk/config-build-env +0
-0lib/oesdk/config-build-env line 3
Quoted 4 lines
lib/oesdk/config-build-env +1
-1@@ -1,6 +1,6 @@ #!/bin/bash -TI_SDK_OELAYER_SETUP="http://arago-project.org/git/projects/oe-layersetup.git" +TI_SDK_OELAYER_SETUP="http://git.ti.com/git/arago-project/oe-layersetup.git"What's the preferred clone method on git.ti.com? I see Web UI shows these:
Quoted 5 lines
Clone
https://git.ti.com/git/arago-project/oe-layersetup.git
https://git.ti.com/cgit/arago-project/oe-layersetupgit://git.ti.com/arago-project/oe-layersetup.git
http://git.ti.com/git/arago-project/oe-layersetup.git
Have'nt heard of any specific preference.
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
Quoted 6 lines · Nishanth Menon
Here are a series of patches that are meant to:
a) be more paranoid in checking the environment it runs in
b) additional cleanups in case of weird corner cases where build folder is left in weird state
c) Finally switch over to git.ti.com tree instead of arago-project.org tree for the new location of oe-layer-setup
Overall, changes look sane to me. Thanks.
Quoted 13 lines
Nishanth Menon (5):
config-build-env: Move the oe-layer-setup to a variable
config-build-env: Lets make sure we are really in a build folder
config-build-env: Refactor to cleanup messed up build folder
config-build-env: Make sure that the git url points correctly
config-build-env: Switch arago-project git repo to ti git repolib/oesdk/config-build-env | 46 +++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 10 deletions(-)Signature · 1 line
2.32.0
Signature · 4 lines
Regards, Denys Dmytriyenko <[email protected]> PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964 Fingerprint: 25FC E4A5 8A72 2F69 1186 6D76 4209 0272 9A92 C964