diff options
Diffstat (limited to 'poky/scripts')
-rwxr-xr-x | poky/scripts/bitbake-whatchanged | 2 | ||||
-rwxr-xr-x | poky/scripts/contrib/documentation-audit.sh | 2 | ||||
-rwxr-xr-x | poky/scripts/contrib/list-packageconfig-flags.py | 2 | ||||
-rw-r--r-- | poky/scripts/lib/devtool/standard.py | 7 | ||||
-rw-r--r-- | poky/scripts/oe-time-dd-test.sh | 23 | ||||
-rwxr-xr-x | poky/scripts/runqemu | 143 | ||||
-rwxr-xr-x | poky/scripts/sstate-diff-machines.sh | 4 | ||||
-rwxr-xr-x | poky/scripts/verify-bashisms | 2 |
8 files changed, 117 insertions, 68 deletions
diff --git a/poky/scripts/bitbake-whatchanged b/poky/scripts/bitbake-whatchanged index 3095dafa4..6f4b26811 100755 --- a/poky/scripts/bitbake-whatchanged +++ b/poky/scripts/bitbake-whatchanged @@ -217,7 +217,7 @@ print what will be done between the current and last builds, for example: # Edit the recipes $ bitbake-whatchanged core-image-sato -The changes will be printed" +The changes will be printed. Note: The amount of tasks is not accurate when the task is "do_build" since diff --git a/poky/scripts/contrib/documentation-audit.sh b/poky/scripts/contrib/documentation-audit.sh index 1191f57a8..f436f9bae 100755 --- a/poky/scripts/contrib/documentation-audit.sh +++ b/poky/scripts/contrib/documentation-audit.sh @@ -27,7 +27,7 @@ fi echo "REMINDER: you need to build for MACHINE=qemux86 or you won't get useful results" echo "REMINDER: you need to set LICENSE_FLAGS_WHITELIST appropriately in local.conf or " -echo " you'll get false positives. For example, LICENSE_FLAGS_WHITELIST = \"Commercial\"" +echo " you'll get false positives. For example, LICENSE_FLAGS_WHITELIST = \"commercial\"" for pkg in `bitbake -s | awk '{ print \$1 }'`; do if [[ "$pkg" == "Loading" || "$pkg" == "Loaded" || diff --git a/poky/scripts/contrib/list-packageconfig-flags.py b/poky/scripts/contrib/list-packageconfig-flags.py index d6de4dc84..bb288e909 100755 --- a/poky/scripts/contrib/list-packageconfig-flags.py +++ b/poky/scripts/contrib/list-packageconfig-flags.py @@ -33,7 +33,7 @@ import bb.tinfoil def get_fnlist(bbhandler, pkg_pn, preferred): ''' Get all recipe file names ''' if preferred: - (latest_versions, preferred_versions) = bb.providers.findProviders(bbhandler.config_data, bbhandler.cooker.recipecaches[''], pkg_pn) + (latest_versions, preferred_versions, required_versions) = bb.providers.findProviders(bbhandler.config_data, bbhandler.cooker.recipecaches[''], pkg_pn) fn_list = [] for pn in sorted(pkg_pn): diff --git a/poky/scripts/lib/devtool/standard.py b/poky/scripts/lib/devtool/standard.py index 7b62b7e7b..f364a4528 100644 --- a/poky/scripts/lib/devtool/standard.py +++ b/poky/scripts/lib/devtool/standard.py @@ -953,12 +953,17 @@ def modify(args, config, basepath, workspace): if bb.data.inherits_class('kernel', rd): f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout ' - 'do_fetch do_unpack do_kernel_configme do_kernel_configcheck"\n') + 'do_fetch do_unpack do_kernel_configcheck"\n') f.write('\ndo_patch[noexec] = "1"\n') f.write('\ndo_configure_append() {\n' ' cp ${B}/.config ${S}/.config.baseline\n' ' ln -sfT ${B}/.config ${S}/.config.new\n' '}\n') + f.write('\ndo_kernel_configme_prepend() {\n' + ' if [ -e ${S}/.config ]; then\n' + ' mv ${S}/.config ${S}/.config.old\n' + ' fi\n' + '}\n') if rd.getVarFlag('do_menuconfig','task'): f.write('\ndo_configure_append() {\n' ' if [ ! ${DEVTOOL_DISABLE_MENUCONFIG} ]; then\n' diff --git a/poky/scripts/oe-time-dd-test.sh b/poky/scripts/oe-time-dd-test.sh new file mode 100644 index 000000000..970a86dff --- /dev/null +++ b/poky/scripts/oe-time-dd-test.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# +# oe-time-dd-test records how much time it takes to +# write <count> number of kilobytes to the filesystem. +# It also records the number of processes that are in +# running (R), uninterruptible sleep (D) and interruptible +# sleep (S) state from the output of "top" command. +# The purporse of this script is to find which part of +# the build system puts stress on the filesystem io and +# log all the processes. + +usage() { + echo "Usage: $0 <count>" +} + +if [ $# -ne 1 ]; then + usage + exit 1 +fi + +uptime +/usr/bin/time -f "%e" dd if=/dev/zero of=foo bs=1024 count=$1 conv=fsync +top -b -n 1 | grep -v "0 0 0" | grep -E ' [RSD] ' | cut -c 46-47 | sort | uniq -c diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu index 532f2e338..df4ee21d5 100755 --- a/poky/scripts/runqemu +++ b/poky/scripts/runqemu @@ -139,6 +139,7 @@ class BaseConfig(object): 'OE_TMPDIR', 'OECORE_NATIVE_SYSROOT', 'MULTICONFIG', + 'SERIAL_CONSOLES', ) self.qemu_opt = '' @@ -173,6 +174,13 @@ class BaseConfig(object): self.nfs_running = False self.serialconsole = False self.serialstdio = False + self.nographic = False + self.sdl = False + self.gtk = False + self.gl = False + self.gl_es = False + self.egl_headless = False + self.novga = False self.cleantap = False self.saved_stty = '' self.audio_enabled = False @@ -459,44 +467,22 @@ class BaseConfig(object): if arg in self.fstypes + self.vmtypes + self.wictypes: self.check_arg_fstype(arg) elif arg == 'nographic': - if ('sdl' in sys.argv): - raise RunQemuError('Option nographic makes no sense alongside the sdl option.' % (arg)) - if ('gtk' in sys.argv): - raise RunQemuError('Option nographic makes no sense alongside the gtk option.' % (arg)) - self.qemu_opt_script += ' -nographic' - self.kernel_cmdline_script += ' console=ttyS0' + self.nographic = True elif arg == 'sdl': - if 'gl' in sys.argv[1:]: - self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display sdl,gl=on,show-cursor=on' - elif 'gl-es' in sys.argv[1:]: - self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display sdl,gl=es,show-cursor=on' - else: - self.qemu_opt_script += ' -display sdl,show-cursor=on' + self.sdl = True elif arg == 'gtk': - if 'gl' in sys.argv[1:]: - self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display gtk,gl=on,show-cursor=on' - elif 'gl-es' in sys.argv[1:]: - self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display gtk,gl=es,show-cursor=on' - else: - self.qemu_opt_script += ' -display gtk,show-cursor=on' - elif arg == 'gl' or arg == 'gl-es': - # These args are handled inside sdl or gtk blocks above - if ('gtk' not in sys.argv) and ('sdl' not in sys.argv): - raise RunQemuError('Option %s also needs gtk or sdl option.' % (arg)) + self.gtk = True + elif arg == 'gl': + self.gl = True + elif 'gl-es' in sys.argv[1:]: + self.gl_es = True elif arg == 'egl-headless': - self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display egl-headless,show-cursor=on' + self.egl_headless = True elif arg == 'novga': - self.qemu_opt_script += ' -vga none' + self.novga = True elif arg == 'serial': - self.kernel_cmdline_script += ' console=ttyS0' self.serialconsole = True elif arg == "serialstdio": - self.kernel_cmdline_script += ' console=ttyS0' self.serialstdio = True elif arg == 'audio': logger.info("Enabling audio in qemu") @@ -1321,6 +1307,66 @@ class BaseConfig(object): raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!") self.qemu_system = qemu_system + def setup_vga(self): + if self.nographic == True: + if self.sdl == True: + raise RunQemuError('Option nographic makes no sense alongside the sdl option.') + if self.gtk == True: + raise RunQemuError('Option nographic makes no sense alongside the gtk option.') + self.qemu_opt += ' -nographic' + return + + if self.novga == True: + self.qemu_opt += ' -vga none' + return + + if (self.gl_es == True or self.gl == True) and (self.sdl == False and self.gtk == False): + raise RunQemuError('Option gl/gl-es needs gtk or sdl option.') + + if self.sdl == True or self.gtk == True or self.egl_headless == True: + self.set_dri_path() + self.qemu_opt += ' -vga virtio -display ' + if self.egl_headless == True: + self.qemu_opt += 'egl-headless,' + else: + if self.sdl == True: + self.qemu_opt += 'sdl,' + elif self.gtk == True: + self.qemu_opt += 'gtk,' + + if self.gl == True: + self.qemu_opt += 'gl=on,' + elif self.gl_es == True: + self.qemu_opt += 'gl=es,' + self.qemu_opt += 'show-cursor=on' + + self.qemu_opt += ' %s' %self.get('QB_GRAPHICS') + + def setup_serial(self): + # Setup correct kernel command line for serial + if self.serialstdio == True or self.serialconsole == True or self.nographic == True or self.tcpserial_portnum: + for entry in self.get('SERIAL_CONSOLES').split(' '): + self.kernel_cmdline_script += ' console=%s' %entry.split(';')[1] + + if self.serialstdio == True or self.nographic == True: + self.qemu_opt += " -serial mon:stdio" + else: + self.qemu_opt += " -serial mon:vc" + if self.serialconsole: + if sys.stdin.isatty(): + subprocess.check_call(("stty", "intr", "^]")) + logger.info("Interrupt character is '^]'") + + self.qemu_opt += " %s" % self.get("QB_SERIAL_OPT") + + # We always wants ttyS0 and ttyS1 in qemu machines (see SERIAL_CONSOLES). + # If no serial or serialtcp options were specified, only ttyS0 is created + # and sysvinit shows an error trying to enable ttyS1: + # INIT: Id "S1" respawning too fast: disabled for 5 minutes + serial_num = len(re.findall("-serial", self.qemu_opt)) + if serial_num < 2: + self.qemu_opt += " -serial null" + def setup_final(self): qemu_bin = os.path.join(self.bindir_native, self.qemu_system) @@ -1345,6 +1391,8 @@ class BaseConfig(object): for ovmf in self.ovmf_bios: format = ovmf.rsplit('.', 1)[-1] + if format == "bin": + format = "raw" self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (format, ovmf) self.qemu_opt += ' ' + self.qemu_opt_script @@ -1363,37 +1411,8 @@ class BaseConfig(object): if self.snapshot: self.qemu_opt += " -snapshot" - if self.serialconsole: - if sys.stdin.isatty(): - subprocess.check_call(("stty", "intr", "^]")) - logger.info("Interrupt character is '^]'") - - first_serial = "" - if not re.search("-nographic", self.qemu_opt): - first_serial = "-serial mon:vc" - # We always want a ttyS1. Since qemu by default adds a serial - # port when nodefaults is not specified, it seems that all that - # would be needed is to make sure a "-serial" is there. However, - # it appears that when "-serial" is specified, it ignores the - # default serial port that is normally added. So here we make - # sure to add two -serial if there are none. And only one if - # there is one -serial already. - serial_num = len(re.findall("-serial", self.qemu_opt)) - if serial_num == 0: - self.qemu_opt += " %s %s" % (first_serial, self.get("QB_SERIAL_OPT")) - elif serial_num == 1: - self.qemu_opt += " %s" % self.get("QB_SERIAL_OPT") - - # We always wants ttyS0 and ttyS1 in qemu machines (see SERIAL_CONSOLES), - # if not serial or serialtcp options was specified only ttyS0 is created - # and sysvinit shows an error trying to enable ttyS1: - # INIT: Id "S1" respawning too fast: disabled for 5 minutes - serial_num = len(re.findall("-serial", self.qemu_opt)) - if serial_num == 0: - if re.search("-nographic", self.qemu_opt) or self.serialstdio: - self.qemu_opt += " -serial mon:stdio -serial null" - else: - self.qemu_opt += " -serial mon:vc -serial null" + self.setup_serial() + self.setup_vga() def start_qemu(self): import shlex diff --git a/poky/scripts/sstate-diff-machines.sh b/poky/scripts/sstate-diff-machines.sh index 1d721eb87..8b64e11be 100755 --- a/poky/scripts/sstate-diff-machines.sh +++ b/poky/scripts/sstate-diff-machines.sh @@ -127,6 +127,8 @@ for M in ${machines}; do fi done +COMPARE_TASKS="do_configure.sigdata do_populate_sysroot.sigdata do_package_write_ipk.sigdata do_package_write_rpm.sigdata do_package_write_deb.sigdata do_package_write_tar.sigdata" + function compareSignatures() { MACHINE1=$1 MACHINE2=$2 @@ -134,7 +136,7 @@ function compareSignatures() { PRE_PATTERN="" [ -n "${PATTERN}" ] || PRE_PATTERN="-v" [ -n "${PATTERN}" ] || PATTERN="MACHINE" - for TASK in do_configure.sigdata do_populate_sysroot.sigdata do_package_write_ipk.sigdata; do + for TASK in $COMPARE_TASKS; do printf "\n\n === Comparing signatures for task ${TASK} between ${MACHINE1} and ${MACHINE2} ===\n" | tee -a ${OUTPUT}/signatures.${MACHINE2}.${TASK}.log diff ${OUTPUT}/${MACHINE1}/list.M ${OUTPUT}/${MACHINE2}/list.M | grep ${PRE_PATTERN} "${PATTERN}" | grep ${TASK} > ${OUTPUT}/signatures.${MACHINE2}.${TASK} for i in `cat ${OUTPUT}/signatures.${MACHINE2}.${TASK} | sed 's#[^/]*/\([^/]*\)/.*#\1#g' | sort -u | xargs`; do diff --git a/poky/scripts/verify-bashisms b/poky/scripts/verify-bashisms index fb0cc719e..14d8c298e 100755 --- a/poky/scripts/verify-bashisms +++ b/poky/scripts/verify-bashisms @@ -100,7 +100,7 @@ if __name__=='__main__': args = parser.parse_args() if shutil.which("checkbashisms.pl") is None: - print("Cannot find checkbashisms.pl on $PATH, get it from https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.pl") + print("Cannot find checkbashisms.pl on $PATH, get it from https://salsa.debian.org/debian/devscripts/raw/master/scripts/checkbashisms.pl") sys.exit(1) # The order of defining the worker function, |