summaryrefslogtreecommitdiff
path: root/poky/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'poky/scripts')
-rwxr-xr-xpoky/scripts/create-pull-request2
-rw-r--r--poky/scripts/lib/wic/plugins/imager/direct.py2
-rwxr-xr-xpoky/scripts/oe-setup-builddir61
-rwxr-xr-xpoky/scripts/runqemu6
4 files changed, 31 insertions, 40 deletions
diff --git a/poky/scripts/create-pull-request b/poky/scripts/create-pull-request
index 8eefcf63a5..2f91a355b0 100755
--- a/poky/scripts/create-pull-request
+++ b/poky/scripts/create-pull-request
@@ -128,7 +128,7 @@ PROTO_RE="[a-z][a-z+]*://"
GIT_RE="\(^\($PROTO_RE\)\?\)\($USER_RE@\)\?\([^:/]*\)[:/]\(.*\)"
REMOTE_URL=${REMOTE_URL%.git}
REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\5#")
-REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\4/\5#")
+REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#https://\4/\5#")
if [ -z "$BRANCH" ]; then
BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)
diff --git a/poky/scripts/lib/wic/plugins/imager/direct.py b/poky/scripts/lib/wic/plugins/imager/direct.py
index c44159b235..da483daed5 100644
--- a/poky/scripts/lib/wic/plugins/imager/direct.py
+++ b/poky/scripts/lib/wic/plugins/imager/direct.py
@@ -117,7 +117,7 @@ class DirectPlugin(ImagerPlugin):
updated = False
for part in self.parts:
if not part.realnum or not part.mountpoint \
- or not part.mountpoint.startswith('/'):
+ or part.mountpoint == "/" or not part.mountpoint.startswith('/'):
continue
if part.use_uuid:
diff --git a/poky/scripts/oe-setup-builddir b/poky/scripts/oe-setup-builddir
index d3c7f943e7..a13860c7d9 100755
--- a/poky/scripts/oe-setup-builddir
+++ b/poky/scripts/oe-setup-builddir
@@ -7,12 +7,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
-if [ -z "$BUILDDIR" ]; then
- echo >&2 "Error: The build directory (BUILDDIR) must be set!"
+die() {
+ echo Error: "$@" >&2
exit 1
-fi
+}
+
+[ -n "$BUILDDIR" ] || die "The build directory (BUILDDIR) must be set!"
-if [ "$1" = '--help' -o "$1" = '-h' ]; then
+if [ "$1" = '--help' ] || [ "$1" = '-h' ]; then
echo 'Usage: oe-setup-builddir'
echo ''
echo "OpenEmbedded setup-builddir - setup build directory $BUILDDIR"
@@ -22,35 +24,22 @@ fi
mkdir -p "$BUILDDIR/conf"
-if [ ! -d "$BUILDDIR" ]; then
- echo >&2 "Error: The builddir ($BUILDDIR) does not exist!"
- exit 1
-fi
-
-if [ ! -w "$BUILDDIR" ]; then
- echo >&2 "Error: Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . oe-init-build-env ~/my-build"
- exit 1
-fi
+[ -d "$BUILDDIR" ] || die "The build directory ($BUILDDIR) does not exist!"
+[ -w "$BUILDDIR" ] ||
+ die "Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . oe-init-build-env ~/my-build"
# Attempting removal of sticky,setuid bits from BUILDDIR, BUILDDIR/conf
chmod -st "$BUILDDIR" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR"
chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR/conf"
-cd "$BUILDDIR"
+cd "$BUILDDIR" || die "Failed to change directory to $BUILDDIR!"
-if [ -f "$BUILDDIR/conf/templateconf.cfg" -a -z "$TEMPLATECONF" ]; then
- TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
- # The following two are no longer valid; unsetting them will automatically get them replaced
- # with correct ones.
- if [ $TEMPLATECONF = "meta/conf" -o $TEMPLATECONF = "meta-poky/conf" ]; then
- unset TEMPLATECONF
- rm $BUILDDIR/conf/templateconf.cfg
- fi
-fi
+. "$OEROOT/.templateconf"
-. "$OEROOT"/.templateconf
+# Keep the original TEMPLATECONF before possibly prefixing it with $OEROOT below.
+ORG_TEMPLATECONF=$TEMPLATECONF
-#
+#
# $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
#
if [ -n "$TEMPLATECONF" ]; then
@@ -59,15 +48,12 @@ if [ -n "$TEMPLATECONF" ]; then
if [ -d "$OEROOT/$TEMPLATECONF" ]; then
TEMPLATECONF="$OEROOT/$TEMPLATECONF"
fi
- if [ ! -d "$TEMPLATECONF" ]; then
- echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
- exit 1
- fi
- templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
- if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != "templates" ]; then
- echo >&2 "Error: TEMPLATECONF value (which is $TEMPLATECONF) must point to meta-some-layer/conf/templates/template-name"
- exit 1
- fi
+ [ -d "$TEMPLATECONF" ] ||
+ die "TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
+ fi
+ templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" "$TEMPLATECONF")
+ if [ "$templatesdir" != templates ] || [ ! -f "$TEMPLATECONF/../../layer.conf" ]; then
+ die "TEMPLATECONF value (which is $TEMPLATECONF) must point to meta-some-layer/conf/templates/template-name"
fi
OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
@@ -83,8 +69,7 @@ if [ ! -r "$BUILDDIR/conf/local.conf" ]; then
You had no conf/local.conf file. This configuration file has therefore been
created for you from $OECORELOCALCONF
You may wish to edit it to, for example, select a different MACHINE (target
-hardware). See conf/local.conf for more information as common configuration
-options are commented.
+hardware).
EOM
cp -f "$OECORELOCALCONF" "$BUILDDIR/conf/local.conf"
@@ -118,7 +103,7 @@ unset OECORELOCALCONF
unset OECORELAYERCONF
# Ending the first-time run message. Show the YP Documentation banner.
-if [ ! -z "$SHOWYPDOC" ]; then
+if [ -n "$SHOWYPDOC" ]; then
cat <<EOM
The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
@@ -138,5 +123,5 @@ fi
unset OECORENOTESCONF
if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
- echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
+ echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
fi
diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu
index b6fc212ebe..983f7514c7 100755
--- a/poky/scripts/runqemu
+++ b/poky/scripts/runqemu
@@ -1505,6 +1505,9 @@ class BaseConfig(object):
cmd = "%s %s" % (self.qemu_opt, kernel_opts)
cmds = shlex.split(cmd)
logger.info('Running %s\n' % cmd)
+ with open('/proc/uptime', 'r') as f:
+ uptime_seconds = f.readline().split()[0]
+ logger.info('Host uptime: %s\n' % uptime_seconds)
pass_fds = []
if self.taplock_descriptor:
pass_fds = [self.taplock_descriptor.fileno()]
@@ -1528,6 +1531,9 @@ class BaseConfig(object):
signal.signal(signal.SIGTERM, signal.SIG_IGN)
logger.info("Cleaning up")
+ with open('/proc/uptime', 'r') as f:
+ uptime_seconds = f.readline().split()[0]
+ logger.info('Host uptime: %s\n' % uptime_seconds)
if self.cleantap:
cmd = ('sudo', self.qemuifdown, self.tap, self.bindir_native)
logger.debug('Running %s' % str(cmd))