From 977dc1ac484e0c201b30f551e5f2d1d32e27eccf Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Wed, 6 Feb 2019 16:01:43 -0500 Subject: poky: refresh thud: 1d987b98ed..ee7dd31944 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update poky to thud HEAD. Alex Kiernan (2): systemd: backport fix to stop enabling ECN systemd: Add PACKAGECONFIG for gnutls Alexander Kanavin (3): lighttpd: update to 1.4.51 boost: update to 1.69.0 systemd: backport a patch to fix meson 0.49.0 issue Alexey Brodkin (1): wic: sdimage-bootpart: Use mmcblk0 drive instead of bogus mmcblk André Draszik (1): meta: remove True option to getVar calls (again) Anuj Mittal (6): eudev: upgrade 3.2.5 -> 3.2.7 gsettings-desktop-schemas: upgrade 3.28.0 -> 3.28.1 libatomic-ops: upgrade 7.6.6 -> 7.6.8 libpng: upgrade 1.6.35 -> 1.6.36 common-licenses: update Libpng license text i2c-tools: upgrade 4.0 -> 4.1 Aníbal Limón (1): meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU Armin Kuster (1): tzdata/tzcode-native: update to 2018i Brad Bishop (1): systemd-systemctl-native: handle Install wildcards Bruce Ashfield (3): kernel: use olddefconfig as the primary target for KERNEL_CONFIG_COMMAND linux-yocto/4.18: update to v4.18.22 linux-yocto/4.18: update to v4.18.25 Changqing Li (1): libsndfile1: Security fix CVE-2017-17456/17457 CVE-2018-19661/19662 Chen Qi (3): package.bbclass: fix python unclosed file ResourceWarning eSDK.py: avoid error in tearDownClass due to race condistion eSDK.py: unset BBPATH and BUILDDIR to avoid eSDK failure Douglas Royds (6): icecc: readlink -f on the recipe-sysroot gcc/g++ icecc: Trivial simplification icecc: Syntax error meant that we weren't waiting for tarball generation icecc: Don't generate recipe-sysroot symlinks at recipe-parsing time icecc: patchelf is needed by icecc-create-env patch: reproducibility: Fix host umask leakage Erik Botö (1): testimage: Add possibility to pass parmeters to qemu Federico Sauter (1): kernel: don't assign the build user/host Joshua Watt (1): classes/testsdk: Split implementation into classes Kai Kang (2): testimage.bbclass: remove boot parameter systemd.log_target systemd: fix compile error for x32 Kevin Hao (1): meta-yocto-bsp: Bump to the latest stable kernel for the non-x86 BSPs Khem Raj (6): grub2: Fix passing null to printf formats gnupg: Upgrade to 2.2.12 release binutils: Fix build with clang binutils: Upgrade to latest on 2.31 release branch binutils: bfd doesn't handle ELF compressed data alignment systemd: Fix memory use after free errors Manjukumar Matha (1): kernel.bbclass: Fix incorrect deploying of fitimage.initramfs Marcus Cooper (3): systemd: Security fix CVE-2018-16864 systemd: Security fix CVE-2018-16865 systemd: Security fix CVE-2018-16866 Michael Ho (1): sstate: add support for caching shared workdir tasks Naveen Saini (2): linux-yocto: update genericx86* SRCREV for 4.18 linux-yocto: update genericx86* SRCREV for 4.18 Peter Kjellerstedt (2): systemd: Correct and clean up user/group definitions systemd: Correct a conditional add to SYSTEMD_PACKAGES Richard Purdie (9): nativesdk-*-provides-dummy: Fixes to allow correct operation with opkg classes: Correctly markup regex strings testimage: Remove duplicate dependencies testimage: Simplfy DEFAULT_TEST_SUITES logic testimage: Further cleanup DEFAULT_TEST_SUITES testimage: Enable autorunning of the package manager testsuites oeqa/runtime/cases: Improve test dependency information oeqa/runtime/cases: Improve dependencies of kernel/gcc/build tests oeqa/utils/buildproject: Only clean files if we've done something Robert Yang (7): oeqa/utils/qemurunner: Print output when failed to login oeqa/utils/qemurunner: set timeout to 60s for run_serial oeqa: Fix for QEMU_USE_KVM oeqa: make it work for multiple users runqemu-gen-tapdevs: Allow run --help without sudo oeqa/manual/bsp-qemu.json: Update for QEMU_USE_KVM oeqa/selftest/runqemu: Enable kvm when QEMU_USE_KVM is set Ross Burton (2): toolchain-scripts: run post-relocate scripts for every environment runqemu: clean up subprocess usage Yeoh Ee Peng (3): scripts/oe-git-archive: fix non-existent key referencing error testimage: Add support for slirp oeqa/qemu & runtime: qemu do not need ip input from external OpenBMC compatibility updates: meta-phosphor: Brad Bishop (1): phosphor: rebase i2c-tools patches Change-Id: Idc626fc076580aeebde1420bcad01e069b559504 Signed-off-by: Brad Bishop --- .../lib/wic/canned-wks/sdimage-bootpart.wks | 4 +- poky/scripts/oe-git-archive | 19 ++++--- poky/scripts/runqemu | 63 ++++++++++------------ poky/scripts/runqemu-gen-tapdevs | 27 +++++++--- 4 files changed, 63 insertions(+), 50 deletions(-) (limited to 'poky/scripts') diff --git a/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks b/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks index 7ffd632f4a..63bc4dab6a 100644 --- a/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks +++ b/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks @@ -2,5 +2,5 @@ # long-description: Creates a partitioned SD card image. Boot files # are located in the first vfat partition. -part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4 --size 16 -part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4 +part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 diff --git a/poky/scripts/oe-git-archive b/poky/scripts/oe-git-archive index ab19cb9aa3..913291a99c 100755 --- a/poky/scripts/oe-git-archive +++ b/poky/scripts/oe-git-archive @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Helper script for committing data to git and pushing upstream # @@ -208,6 +208,13 @@ def parse_args(argv): help="Data to commit") return parser.parse_args(argv) +def get_nested(d, list_of_keys): + try: + for k in list_of_keys: + d = d[k] + return d + except KeyError: + return "" def main(argv=None): """Script entry point""" @@ -223,11 +230,11 @@ def main(argv=None): # Get keywords to be used in tag and branch names and messages metadata = metadata_from_bb() - keywords = {'hostname': metadata['hostname'], - 'branch': metadata['layers']['meta']['branch'], - 'commit': metadata['layers']['meta']['commit'], - 'commit_count': metadata['layers']['meta']['commit_count'], - 'machine': metadata['config']['MACHINE']} + keywords = {'hostname': get_nested(metadata, ['hostname']), + 'branch': get_nested(metadata, ['layers', 'meta', 'branch']), + 'commit': get_nested(metadata, ['layers', 'meta', 'commit']), + 'commit_count': get_nested(metadata, ['layers', 'meta', 'commit_count']), + 'machine': get_nested(metadata, ['config', 'MACHINE'])} # Expand strings early in order to avoid getting into inconsistent # state (e.g. no tag even if data was committed) diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu index 08f4cfe4ca..55cdd414ec 100755 --- a/poky/scripts/runqemu +++ b/poky/scripts/runqemu @@ -115,9 +115,9 @@ def check_tun(): raise RunQemuError("TUN control device %s is not writable, please fix (e.g. sudo chmod 666 %s)" % (dev_tun, dev_tun)) def check_libgl(qemu_bin): - cmd = 'ldd %s' % qemu_bin - logger.debug('Running %s...' % cmd) - need_gl = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') + cmd = ('ldd', qemu_bin) + logger.debug('Running %s...' % str(cmd)) + need_gl = subprocess.check_output(cmd).decode('utf-8') if re.search('libGLU', need_gl): # We can't run without a libGL.so libgl = False @@ -398,7 +398,7 @@ class BaseConfig(object): cmd = 'MACHINE=%s bitbake -e' % arg logger.info('Running %s...' % cmd) - self.bitbake_e = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') + self.bitbake_e = subprocess.check_output(cmd, shell=True).decode('utf-8') # bitbake -e doesn't report invalid MACHINE as an error, so # let's check DEPLOY_DIR_IMAGE to make sure that it is a valid # MACHINE. @@ -838,10 +838,7 @@ class BaseConfig(object): self.nfs_server = '192.168.7.1' # Figure out a new nfs_instance to allow multiple qemus running. - # CentOS 7.1's ps doesn't print full command line without "ww" - # when invoke by subprocess.Popen(). - cmd = "ps auxww" - ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') + ps = subprocess.check_output(("ps", "auxww")).decode('utf-8') pattern = '/bin/unfsd .* -i .*\.pid -e .*/exports([0-9]+) ' all_instances = re.findall(pattern, ps, re.M) if all_instances: @@ -881,17 +878,17 @@ class BaseConfig(object): if not src: raise RunQemuError("No NFS_DIR is set, and can't find %s or %s to extract" % (src1, src2)) logger.info('NFS_DIR not found, extracting %s to %s' % (src, dest)) - cmd = 'runqemu-extract-sdk %s %s' % (src, dest) - logger.info('Running %s...' % cmd) - if subprocess.call(cmd, shell=True) != 0: + cmd = ('runqemu-extract-sdk', src, dest) + logger.info('Running %s...' % str(cmd)) + if subprocess.call(cmd) != 0: raise RunQemuError('Failed to run %s' % cmd) self.clean_nfs_dir = True self.rootfs = dest # Start the userspace NFS server - cmd = 'runqemu-export-rootfs start %s' % self.rootfs - logger.info('Running %s...' % cmd) - if subprocess.call(cmd, shell=True) != 0: + cmd = ('runqemu-export-rootfs', 'start', self.rootfs) + logger.info('Running %s...' % str(cmd)) + if subprocess.call(cmd) != 0: raise RunQemuError('Failed to run %s' % cmd) self.nfs_running = True @@ -957,9 +954,9 @@ class BaseConfig(object): except FileExistsError: pass - cmd = '%s link' % ip - logger.debug('Running %s...' % cmd) - ip_link = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') + cmd = (ip, 'link') + logger.debug('Running %s...' % str(cmd)) + ip_link = subprocess.check_output(cmd).decode('utf-8') # Matches line like: 6: tap0: possibles = re.findall('^[0-9]+: +(tap[0-9]+): <.*', ip_link, re.M) tap = "" @@ -984,8 +981,8 @@ class BaseConfig(object): gid = os.getgid() uid = os.getuid() logger.info("Setting up tap interface under sudo") - cmd = 'sudo %s %s %s %s' % (self.qemuifup, uid, gid, self.bindir_native) - tap = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8').rstrip('\n') + cmd = ('sudo', self.qemuifup, str(uid), str(gid), self.bindir_native) + tap = subprocess.check_output(cmd).decode('utf-8').strip() lockfile = os.path.join(lockdir, tap) self.lock = lockfile + '.lock' self.acquire_lock() @@ -1020,7 +1017,7 @@ class BaseConfig(object): if self.get('QB_NET') == 'none': return if sys.stdin.isatty(): - self.saved_stty = subprocess.check_output("stty -g", shell=True).decode('utf-8') + self.saved_stty = subprocess.check_output(("stty", "-g")).decode('utf-8').strip() self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device if self.slirp_enabled: self.setup_slirp() @@ -1134,7 +1131,7 @@ class BaseConfig(object): if not qemu_system: raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!") - qemu_bin = '%s/%s' % (self.bindir_native, qemu_system) + qemu_bin = os.path.join(self.bindir_native, qemu_system) # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't # find QEMU in sysroot, it needs to use host's qemu. @@ -1172,7 +1169,7 @@ class BaseConfig(object): if self.serialstdio: if sys.stdin.isatty(): - subprocess.check_call("stty intr ^]", shell=True) + subprocess.check_call(("stty", "intr", "^]")) logger.info("Interrupt character is '^]'") first_serial = "" @@ -1236,20 +1233,19 @@ class BaseConfig(object): logger.info("Cleaning up") if self.cleantap: - cmd = 'sudo %s %s %s' % (self.qemuifdown, self.tap, self.bindir_native) - logger.debug('Running %s' % cmd) - subprocess.check_call(cmd, shell=True) + cmd = ('sudo', self.qemuifdown, self.tap, self.bindir_native) + logger.debug('Running %s' % str(cmd)) + subprocess.check_call(cmd) self.release_lock() if self.nfs_running: logger.info("Shutting down the userspace NFS server...") - cmd = "runqemu-export-rootfs stop %s" % self.rootfs - logger.debug('Running %s' % cmd) - subprocess.check_call(cmd, shell=True) + cmd = ("runqemu-export-rootfs", "stop", self.rootfs) + logger.debug('Running %s' % str(cmd)) + subprocess.check_call(cmd) if self.saved_stty: - cmd = "stty %s" % self.saved_stty - subprocess.check_call(cmd, shell=True) + subprocess.check_call(("stty", self.saved_stty)) if self.clean_nfs_dir: logger.info('Removing %s' % self.rootfs) @@ -1291,10 +1287,9 @@ class BaseConfig(object): if result and os.path.exists(result): return result - cmd = 'bitbake qemu-helper-native -e' - logger.info('Running %s...' % cmd) - out = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - out = out.stdout.read().decode('utf-8') + cmd = ('bitbake', 'qemu-helper-native', '-e') + logger.info('Running %s...' % str(cmd)) + out = subprocess.check_output(cmd).decode('utf-8') match = re.search('^STAGING_BINDIR_NATIVE="(.*)"', out, re.M) if match: diff --git a/poky/scripts/runqemu-gen-tapdevs b/poky/scripts/runqemu-gen-tapdevs index 11de318c1a..869fee261d 100755 --- a/poky/scripts/runqemu-gen-tapdevs +++ b/poky/scripts/runqemu-gen-tapdevs @@ -22,22 +22,28 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +uid=`id -u` +gid=`id -g` +if [ -n "$SUDO_UID" ]; then + uid=$SUDO_UID +fi +if [ -n "$SUDO_GID" ]; then + gid=$SUDO_GID +fi + usage() { echo "Usage: sudo $0 " - echo "Where is the numeric user id the tap devices will be owned by" + echo "Where is the numeric user id the tap devices will be owned by" echo "Where is the numeric group id the tap devices will be owned by" echo " is the number of tap devices to create (0 to remove all)" echo " is the path to the build system's native sysroot" - echo "e.g. $ bitbake qemu-helper-native" - echo "$ sudo $0 1000 1000 4 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin" + echo "For example:" + echo "$ bitbake qemu-helper-native" + echo "$ sudo $0 $uid $gid 4 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin" + echo "" exit 1 } -if [ $EUID -ne 0 ]; then - echo "Error: This script must be run with root privileges" - exit -fi - if [ $# -ne 4 ]; then echo "Error: Incorrect number of arguments" usage @@ -54,6 +60,11 @@ if [[ ! -x "$TUNCTL" || -d "$TUNCTL" ]]; then usage fi +if [ $EUID -ne 0 ]; then + echo "Error: This script must be run with root privileges" + exit +fi + SCRIPT_DIR=`dirname $0` RUNQEMU_IFUP="$SCRIPT_DIR/runqemu-ifup" if [ ! -x "$RUNQEMU_IFUP" ]; then -- cgit v1.2.3