* [PATCH 0/1] toaster: clean up startup script
@ 2016-02-29 21:12 brian avery
2016-02-29 21:12 ` [PATCH 1/1] toaster: cleanup of the bin/toaster startup code brian avery
2016-03-01 11:53 ` [PATCH 0/1] toaster: clean up startup script Smith, Elliot
0 siblings, 2 replies; 3+ messages in thread
From: brian avery @ 2016-02-29 21:12 UTC (permalink / raw)
To: toaster
Note: This patch is against origin/master since there is an outstanding reference
to meta-yocto that we need to remove from toaster-next as it is now meta-poky.
This only changes bitbake/bin/toaster which merged cleanly with toaster-next except for the above.
This cleanup fixes a couple of issues:
1) Removes the superflous code to set toasterconf.json
- this isn't used and referenced meta-yocto
- the code to set toasterconf.json is based on .templateconf
2) Changes exit to return so we don't surprise the user by exiting their shell
- this is necessary because it is being sourced
3) Removes the last references to the old TOASTER_MANAGED variable
- this is historical and no longer used.
4) Adds -t parameter to lsof
- This stops it from dying on odd filesystems and is much
faster since all we are using are processes anyway
5) Handles start and stop as params
- it was easy to confuse the script especially
if we were calling it with parameters.
- if start/stop isn't specified, it will still toggle
The following changes since commit 4006a7f2762ccd5dcbc6cdff49482d4387a73261:
sanity: Fix int verses string reference (2016-02-28 22:54:09 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib bavery/toaster/fix-meta-yocto-reference
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/toaster/fix-meta-yocto-reference
brian avery (1):
toaster: cleanup of the bin/toaster startup code
bin/toaster | 41 +++++++++++++++++------------------------
1 file changed, 17 insertions(+), 24 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] toaster: cleanup of the bin/toaster startup code
2016-02-29 21:12 [PATCH 0/1] toaster: clean up startup script brian avery
@ 2016-02-29 21:12 ` brian avery
2016-03-01 11:53 ` [PATCH 0/1] toaster: clean up startup script Smith, Elliot
1 sibling, 0 replies; 3+ messages in thread
From: brian avery @ 2016-02-29 21:12 UTC (permalink / raw)
To: toaster
This cleanup fixes a couple of issues:
1) Removes the superflous code to set toasterconf.json
- this isn't used and referenced meta-yocto
2) Changes exit to return so we don't surprise the user by exiting their shell
- this is necessary because it is being sourced
3) Removes the last references to the old TOASTER_MANAGED variable
- this is historical and no longer used.
4) Adds -t parameter to lsof
- This stops it from dying on odd filesystems and is much
faster since all we are using are processes anyway
5) Handles start and stop as params
- it was easy to confuse the script especially
if we were calling it with parameters.
- if start/stop isn't specified, it will still toggle
Signed-off-by: brian avery <avery.brian@gmail.com>
---
bin/toaster | 41 +++++++++++++++++------------------------
1 file changed, 17 insertions(+), 24 deletions(-)
diff --git a/bin/toaster b/bin/toaster
index 72eae64..d409554 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -128,7 +128,7 @@ stop_bitbake() {
BBSERVER=0.0.0.0:-1 bitbake -m
unset BBSERVER
# force stop any misbehaving bitbake server
- lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
+ lsof -t bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
}
verify_prereq() {
@@ -177,7 +177,7 @@ if [ -n "$TEMPLATECONF" ]; then
fi
if [ ! -d "$TEMPLATECONF" ]; then
echo >&2 "Error: '$TEMPLATECONF' must be a directory containing toasterconf.json"
- [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
+ return 1
fi
fi
fi
@@ -189,7 +189,7 @@ fi
if [ ! -f $TOASTER_CONF ]; then
echo "$TOASTER_CONF configuration file not found. Set TOASTER_CONF to specify file or fix .templateconf"
- [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
+ return 1
fi
# this defines the dir toaster will use for
@@ -204,7 +204,7 @@ export TOASTER_DIR=`pwd`
NOTOASTERUI=0
WEBSERVER=1
WEB_PORT="8000"
-
+unset CMD
for param in $*; do
case $param in
noui )
@@ -213,6 +213,12 @@ for param in $*; do
noweb )
WEBSERVER=0
;;
+ start )
+ CMD=$param
+ ;;
+ stop )
+ CMD=$param
+ ;;
webport=*)
WEB_PORT="${param#*=}"
esac
@@ -220,7 +226,7 @@ done
if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then
echo "Error: This script needs to be sourced. Please run as . $TOASTER"
- exit 1
+ return 1
fi
if [ "$1" = 'restart-bitbake' ] ; then
@@ -240,22 +246,6 @@ if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then
return 2
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
- TOASTER_CONF="$(dirname $TOASTER)/../../meta-yocto/conf/toasterconf.json"
- export TOASTER_CONF=$(python -c "import os; print os.path.realpath('$TOASTER_CONF')")
-fi
-if [ ! -f $TOASTER_CONF ]; then
- echo "$TOASTER_CONF configuration file not found."
- echo " set TOASTER_CONF to specify a path"
- return 1
-fi
# this defines the dir toaster will use for
# 1) clones of layers (in _toaster_clones )
# 2) the build dir (in build)
@@ -267,9 +257,12 @@ fi
export TOASTER_DIR=`dirname $BUILDDIR`
# Determine the action. If specified by arguments, fine, if not, toggle it
-if [ "$1" = 'start' ] || [ "$1" = 'stop' ]; then
- CMD="$1"
-else
+if [ "$CMD" = "start" ] ; then
+ if [ -n "$BBSERVER" ]; then
+ echo " Toaster is already running. Exiting..."
+ return 1
+fi
+elif [ "$CMD" = "" ]; then
if [ -z "$BBSERVER" ]; then
CMD="start"
else
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/1] toaster: clean up startup script
2016-02-29 21:12 [PATCH 0/1] toaster: clean up startup script brian avery
2016-02-29 21:12 ` [PATCH 1/1] toaster: cleanup of the bin/toaster startup code brian avery
@ 2016-03-01 11:53 ` Smith, Elliot
1 sibling, 0 replies; 3+ messages in thread
From: Smith, Elliot @ 2016-03-01 11:53 UTC (permalink / raw)
To: brian avery; +Cc: toaster
[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]
Pushed upstream and added to toaster-next.
Elliot
On 29 February 2016 at 21:12, brian avery <avery.brian@gmail.com> wrote:
> Note: This patch is against origin/master since there is an outstanding
> reference
> to meta-yocto that we need to remove from toaster-next as it is now
> meta-poky.
>
> This only changes bitbake/bin/toaster which merged cleanly with
> toaster-next except for the above.
>
> This cleanup fixes a couple of issues:
> 1) Removes the superflous code to set toasterconf.json
> - this isn't used and referenced meta-yocto
> - the code to set toasterconf.json is based on .templateconf
> 2) Changes exit to return so we don't surprise the user by exiting their
> shell
> - this is necessary because it is being sourced
> 3) Removes the last references to the old TOASTER_MANAGED variable
> - this is historical and no longer used.
> 4) Adds -t parameter to lsof
> - This stops it from dying on odd filesystems and is much
> faster since all we are using are processes anyway
> 5) Handles start and stop as params
> - it was easy to confuse the script especially
> if we were calling it with parameters.
> - if start/stop isn't specified, it will still toggle
>
>
>
>
> The following changes since commit
> 4006a7f2762ccd5dcbc6cdff49482d4387a73261:
>
> sanity: Fix int verses string reference (2016-02-28 22:54:09 +0000)
>
> are available in the git repository at:
>
> git://git.yoctoproject.org/poky-contrib
> bavery/toaster/fix-meta-yocto-reference
>
> http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/toaster/fix-meta-yocto-reference
>
> brian avery (1):
> toaster: cleanup of the bin/toaster startup code
>
> bin/toaster | 41 +++++++++++++++++------------------------
> 1 file changed, 17 insertions(+), 24 deletions(-)
>
> --
> 1.9.1
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
[-- Attachment #2: Type: text/html, Size: 3057 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-01 11:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-29 21:12 [PATCH 0/1] toaster: clean up startup script brian avery
2016-02-29 21:12 ` [PATCH 1/1] toaster: cleanup of the bin/toaster startup code brian avery
2016-03-01 11:53 ` [PATCH 0/1] toaster: clean up startup script Smith, Elliot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.