toaster: remove startup questions
cover toaster: remove startup questions
This removes the startup questions from toaster and uses the following dir structure.
cwd/toaster.sqlite
cwd/_toaster_clones
cwd/build
You can override TOASTER_CONF to point at the toasterconf.json in meta.
There are still a fair number of directory assumptions that need to be worked out for 2.1 but this should let us start up easier and automate tests better.
Since we are putting the builddir here, we should really allow users to set the SSTATE_DIR and DL_DIR variables. I will try to add that as part of the change needed for 7880 since it has to set a number of new variables.
The following changes since commit 2bd6d137555b44c374853068767e7f4c736898d1:
toaster: Hide "Download build log" button if log doesn't exist (2015-10-07 13:02:07 +0300)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib ed/submit/bavery/toaster/startup_simplification_8217_v3
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/submit/bavery/toaster/startup_simplification_8217_v3
brian avery (5):
toaster: removed superuser question from startup
toaster: remove layer and build dir interactive questions
toaster: check for configuration file and exit if not found
toaster: get rid of interactivity in bldcontrol
toaster: remove bashisms so script works in dash as well
bin/toaster | 39 ++++-- .../management/commands/checksettings.py | 138 ++++++--------------- 2 files changed, 69 insertions(+), 108 deletions(-)
--
Ed
PATCH 1/5 toaster: removed superuser question from startup
From: brian avery <[email protected]>
added comment explaining how to create one later
--- bin/toaster | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
bin/toaster +4 -5
@@ -54,11 +54,10 @@ webserverStartAll() fi retval=0 - if [ "$TOASTER_MANAGED" '=' '1' ]; then - python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1 - else - python $BBBASEDIR/lib/toaster/manage.py syncdb --noinput || retval=1 - fi + # you can always add a superuser later via + # python bitbake/lib/toaster/manage.py python manage.py createsuperuser --username=<ME> + python $BBBASEDIR/lib/toaster/manage.py syncdb --noinput || retval=1 + python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2 if [ $retval -eq 1 ]; then echo "Failed db sync, stopping system start" 1>&2
Signature · 1 line
2.1.4
PATCH 2/5 toaster: remove layer and build dir interactive questions
From: brian avery <[email protected]>
added TOASTER_CONF env var for toaasterconf.json
added TOASTER_DIR env var for working dir
added bugfix so WEB_PORT env variable is honored
--- bin/toaster | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
bin/toaster +24 -1
@@ -162,7 +162,30 @@ RUNNING=0 NOTOASTERUI=0 WEBSERVER=1 TOASTER_BRBE="" -WEB_PORT="8000" +if [ "$WEB_PORT" == "" ]; then + WEB_PORT="8000" +fi +# this is the configuraton file we are using for toaster +# note default is assuming yocto. Override this if you are +# running in a pure OE environment and use the toasterconf.json +# in meta/conf/toasterconf.json +# note: for future there are a number of relative path assumptions +# in the local layers that currently prevent using an arbitrary +# toasterconf.json +if [ "$TOASTER_CONF" == "" ]; then + BIN_DIR=$(dirname "${BASH_SOURCE[0]}") + export TOASTER_CONF="$BIN_DIR/../../meta-yocto/conf/toasterconf.json" +fi +# this defines the dir toaster will use for +# 1) clones of layers (in _toaster_clones ) +# 2) the build dir (in build) +# 3) the sqlite db if that is being used. +# 4) pid's we need to clean up on exit/shutdown +# note: for future. in order to make this an arbitrary directory, we need to +# make sure that the toaster.sqlite file doesn't default to `pwd` like it currently does. +export TOASTER_DIR=`pwd` + + NOBROWSER=0 for param in $*; do
Signature · 1 line
2.1.4
PATCH 3/5 toaster: check for configuration file and exit if not found
In reply to Ed BartoshFrom: brian avery <[email protected]>
[YOCTO #8217]
--- bin/toaster | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
bin/toaster +5 -1
@@ -174,7 +174,11 @@ fi # toasterconf.json if [ "$TOASTER_CONF" == "" ]; then BIN_DIR=$(dirname "${BASH_SOURCE[0]}") - export TOASTER_CONF="$BIN_DIR/../../meta-yocto/conf/toasterconf.json" + export TOASTER_CONF="$BIN_DIR/../../meta-yocto/conf/toasterconf.json" +fi +if [ ! -f $TOASTER_CONF ]; then + echo "$TOASTER_CONF configuration file not found, exiting..." + exit -1 fi # this defines the dir toaster will use for # 1) clones of layers (in _toaster_clones )
Signature · 1 line
2.1.4
PATCH 4/5 toaster: get rid of interactivity in bldcontrol
In reply to Ed BartoshFrom: brian avery <[email protected]>
removed layer dir questions and base off TOASTER_DIR
removed build dir questions and base off TOASTER_DIR
base configuration file off of TOASTER_CONF
fixed some pylint issues
[YOCTO #8217]
--- bin/toaster | 2 +- .../management/commands/checksettings.py | 138 ++++++--------------- 2 files changed, 38 insertions(+), 102 deletions(-)
bin/toaster +1 -1
@@ -174,7 +174,7 @@ fi # toasterconf.json if [ "$TOASTER_CONF" == "" ]; then BIN_DIR=$(dirname "${BASH_SOURCE[0]}") - export TOASTER_CONF="$BIN_DIR/../../meta-yocto/conf/toasterconf.json" + export TOASTER_CONF="$BIN_DIR/../../meta-yocto/conf/toasterconf.json" fi if [ ! -f $TOASTER_CONF ]; then echo "$TOASTER_CONF configuration file not found, exiting..."
lib/toaster/bldcontrol/management/commands/checksettings.py +37 -101
209 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH 5/5 toaster: remove bashisms so script works in dash as well
In reply to Ed BartoshFrom: brian avery <[email protected]>
[YOCTO #8217]
--- bin/toaster | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
bin/toaster +4 -5
@@ -162,7 +162,7 @@ RUNNING=0 NOTOASTERUI=0 WEBSERVER=1 TOASTER_BRBE="" -if [ "$WEB_PORT" == "" ]; then +if [ "$WEB_PORT" = "" ]; then WEB_PORT="8000" fi # this is the configuraton file we are using for toaster
@@ -172,13 +172,13 @@ fi # note: for future there are a number of relative path assumptions # in the local layers that currently prevent using an arbitrary # toasterconf.json -if [ "$TOASTER_CONF" == "" ]; then - BIN_DIR=$(dirname "${BASH_SOURCE[0]}") +if [ "$TOASTER_CONF" = "" ]; then + BIN_DIR=$(dirname -- "$0") export TOASTER_CONF="$BIN_DIR/../../meta-yocto/conf/toasterconf.json" fi if [ ! -f $TOASTER_CONF ]; then echo "$TOASTER_CONF configuration file not found, exiting..." - exit -1 + exit 1; fi # this defines the dir toaster will use for # 1) clones of layers (in _toaster_clones )
@@ -375,4 +375,3 @@ case $CMD in echo "Successful ${CMD}." ;; esac -
Signature · 1 line
2.1.4