aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
AgeCommit message (Collapse)Author
2016-03-24sanity.bbclass: check host tool dependencies on change in NATIVELSBSTRINGBill Randle
When a user upgrades their host distro, it may no longer have all the required tools installed, but this won't be caught by bitbake resulting in possible build errors. Rather than check for installed tools on every startup, use the NATIVELSBSTRING change as indicator to rescan for host tool dependencies. Store the NATIVELSBSTRING in the sanity_info file. [YOCTO #8585] Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-24sanity.bbclass cleanupBill Randle
Limit search for a version var name to start at the beginning of a line, otherwise, if the var name is used in a comment, that comment line will be replaced, rather than the desired assignment line. Move bblayer update message into function where it's actually updated, rather than assuming all successful config file update are to the bblayers.conf file. Replace a stray tab with spaces for consistency. [Fixes YOCTO #9318] Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-20sanity.bbclass: allow customizing config file update error messagesPatrick Ohly
The default file pattern may be amiguous and "meld" might not always be the preferred tool, so allow distros to override those parts of the error messages. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-20sanity.bbclass: fix success message when config file was updatedPatrick Ohly
The code now iterates over different config files, but always printed a message about conf/bblayers.conf for each file. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-20sanity.bbclass: expand error messages for version checksPatrick Ohly
The ${WORKDIR} variable was not getting expanded (anymore?), leading to less helpful error messages like: Exception: NotImplementedError: Your version of bblayers.conf has the wrong LCONF_VERSION (has 7, expecting 8). Please compare your file against bblayers.conf.sample and merge any changes before continuing. "meld conf/bblayers.conf ${COREBASE}/meta*/conf/bblayers.conf.sample" is a good way to visualise the changes. ERROR: Execution of event handler 'check_sanity_eventhandler' failed After adding expansion, embedding ${LCONF_VERSION} and ${LAYER_CONF_VERSION} in the error message seems a bit more readable and consistent. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-02sanity: Do not mistake meta-yocto-bsp for meta-yoctoPeter Kjellerstedt
The code in oecore_update_bblayers() handling the transition from meta-yocto to meta-poky was not very resilient. It would, e.g., mistake meta-yocto-bsp for meta-yocto if the former occurred before the latter in BBLAYERS. The code also failed to update multiple existences of meta-yocto in the bblayers.conf file, e.g., if it was present in BBLAYERS_NON_REMOVABLE in addition to BBLAYERS (which it is by default). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-02sanity.bbclass: remove conflict checking for image vm and liveRobert Yang
[YOCTO #9161] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-28sanity: Fix int verses string referenceRichard Purdie
The sanity update code needs to be passed an int, not string. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28mirrors/own-mirrors/sanity: Updates after npm fetcher additionRichard Purdie
Update the classes after the addition of the npm fetcher to match the other fetcher additions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28sanity: Improve configuration upgrade capabilities (support meta-yocto -> ↵Richard Purdie
poky transition) Right now, only one configuration file can be processed (conf/bblayers.conf) and it can only have one version number. This is a cause of immense friction between OE-Core and Poky since if one needs a version change, it shouldn't be forced on the other. We'd like to rename the meta-yocto layer (within the meta-yocto repository) to meta-poky. To do this, we need to correct the bblayers.conf file and that means changing the sanity version. After the pain this caused the last time, Paul made me promise never to have them out of sync between OE-Core and Poky, equally, having every distro changing config update OE-Core isn't scalable either. This patch changes the sanity upgrade method to list a more generic format: <config file>:<current version variable name>:<required version variable name>:<upgrade function> This in theory allows us to support upgrades to any of the core configuration files, and allow layers to extend them as needed. Files with the same name can be handled in different layers by setting a unique version name variable in the file itself. The upgrade code is only called if the version variable is set. To allow us to make the poky name change and use a new configuration file name, one last version bump is included for poky to handle the transition. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11classes/sanity: check_perl_modules provide output when failAníbal Limón
When check_perl_modules fail is a good idea to print perl interpeter output for debug purposes. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-07sanity.bbclass: add more information to error message about TUNE_PKGARCH ↵Martin Jansa
missing in PACKAGE_ARCHS * sometimes it's hard to see what's wrong here * error message: Error, the PACKAGE_ARCHS variable does not contain TUNE_PKGARCH (cortexa7t2hfhf-vfp-vfpv4-neon). doesn't help much to understand what exactly went wrong and where Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-01sanity: don't enforce DISPLAY for testimageRoss Burton
Now that qemurunner doesn't need DISPLAY set, let whether DISPLAY is set be up to the user. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-24sanity: check that the host has file installedRoss Burton
Now that file-native is ASSUME_PROVIDED, check that it's actually present. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-21sanity.bbclass: expand warning when chmod failsAlex Franco
As suggested, add exception message to warning in sanity.bbclass when chmod fails on TMPDIR. [YOCTO #7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-28sanity.bbclass: show warning when chmod failsAlex Franco
* for some reason this part of: http://patchwork.openembedded.org/patch/102561/ wasn't ever merged. [YOCTO #7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-11sanity.bbclass: remove abspath warning for SSTATE_MIRRORSChristopher Larson
The sstate URI is relative to begin with, so it's completely valid to want to alter it in a way that keeps it relative using a mirror, and I have real world cases where this is causing issues. Remove the warning. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-31Fix mode +st on TMPDIR when creating itAlex Franco
A sanity check fails when TMPDIR has setuid, setgid set. It was proposed to fix this on TMPDIR creation instead of failing with a sanity test only. This patch handles removal of those special bits (and additonally, the sticky bit) from BUILDDIR and TMPDIR when these directories are created. [YOCTO #7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-11sanity.bbclass: check SSTATE_DIR, DL_DIR and *MIRROR for broken symlinksMikko Rapeli
This change makes broken symlinks stand out clearly instead of bitbake failing with odd error messages. Tested locally with broken symlink as SSTATE_DIR, DL_DIR and SSTATE_MIRROR. Change-Id: I2e92702237ab3bdb897d0bdefcf33480aabbc288 Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-24image: Support for qcow2Christian Ziethén
Add support for qcow2 image format. Implemented in the same way as the previously existing vmdk and vdi solutions. Signed-off-by: Christian Ziethén <christian.ziethen@linaro.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-21sanity.bbclass: Remove check if /tmp is writableMariano Lopez
The check would be managed using BB_DISKMON_DIRS so this removes the check from the sanity class. [YOCTO #8000] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16sanity.bbclass: Check if /tmp is writableMariano Lopez
Used mkstemp instead of raw open file call. Also added the exception message to the output of the sanity check. [YOCTO #7922] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-02sanity.bbclass: Check if /tmp is writableMariano Lopez
If /tmp can't be written, bitbake gaves an unrelated error. This checks if /tmp can be written in every build. [YOCTO #7922] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-26sanity.bbclass: check /bin/sh is dash or bashRobert Yang
The build would fail when /bin/sh links to ksh or csh, we only test dash and bash AFAIK. * When /bin/sh -> csh: $ bitbake quilt-native $ bitbake quilt-native -cfetch Illegal variable name. Illegal variable name. [snip] uname: extra operand `2' Try `uname --help' for more information. * When /bin/sh -> ksh: If there are only a few tasks running, for example, "bitbake quilt-native", the build would be OK, but it would fail if we run "bitbake world" for a while, there would be a lot of "Broken pipe" errors: Exception: CalledProcessError: Command 'cd /path/to/xx; find . -type d -print | tar -cf - -C /path/to/sysroot-destdir -p --files-from - --no-recursion | tar -xf - -C /path/to/xxx' returned non-zero exit status 2 with output tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors find: `standard output': Broken pipe find: write error [YOCTO #7917] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11sanity.bbclass: Prevent 'vdi' and 'live' to be built togetherJuro Bystricky
Same reason and check as for vmdk. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-03xserver-xorg: Upgrade 1.16.3 -> 1.17.1 (OELAYOUT_ABI change)Jussi Kukkonen
* Increase OELAYOUT_ABI: this is required because the xf86-video-modesetting package moves from its own recipe to xserver-xorg and sanity check cannot handle that currently. The upgrade will delete old xf86-video-modesetting files from sysroots. * Remove upstreamed xserver-xorg patches * Remove xf86-video-modesetting recipe: the driver is now included in xserver-xorg recipe, which now produces the xf86-video-modesetting package. The package version changes from 0.9 to 1.17.1 * Update xserver-xorg license checksum: modesetting license info (another MIT one) has been added to the file Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
2015-05-21sanity.bbclass: import subprocess in correct functionJussi Kukkonen
check_sanity() no longer needs the subprocess module but sanity_handle_abichanges() does use subprocess.call(). Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-05-20sanity.bbclass: improve the sanity check for PATH and BBPATHShiqun Lin
Build fails if "./" is in the PATH To reproduce the issue: $ export PATH="./:$PATH" $ make -C build-tools elfutils Error: ./ld: unrecognized option '--sysroot=/' Signed-off-by: Shiqun Lin <Shiqun.Lin@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14sanity.bbclass: Increased verbosity for connectivity checkMariano Lopez
The connectivity sanity error doesn't tell you which URL failed to fetch nor how it failed. This provides the URL that failed and why it failed using BBFetchException messages during the connectivity check. [YOCTO #7592] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-05-05mirrors.bbclass: drop support for svk sourcesAndre McCurdy
The svk fetcher was removed from bitbake 1.22, so svk support should logically have been removed from oe-core Daisy onwards. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-21sanity.bbclass: vmdk and live can't be built togetherRobert Yang
Both vmdk and live use syslinux, but they have different/conflicted configurations, the main conflictions are: vmdk live SYSLINUX_ROOT root=/dev/sda2 root=/dev/ram0 SYSLINUX_LABELS boot boot install INITRD No yes So it would make the boot menu strange and vmdk can't be boot, we need add a few extra vars to fix the problem such as SYSLINUX_ROOT_VMDK SYSLINUX_ROOT_LIVE, but that needs a lot of changes in the code, so just add a sanity checking for it. [YOCTO #6889] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23classes/sanity: avoid bblayers version issue when switching between poky and ↵Paul Eggleton
other DISTRO values If you create a build directory with poky, or set DISTRO to "poky" and run bitbake, you'll get a bblayers.conf file with LCONF_VERSION set to 6. If you then set DISTRO to any other value where the new distro config doesn't pull in poky's config, e.g. "nodistro", you would then get a bblayers.conf version error which didn't immediately make sense. (The layer versions have been out-of-step ever since meta-yocto-bsp was split out of meta-yocto several years ago). This is just painful and we'd rather users didn't have to deal with it. Obviously it isn't an OE-Core problem per se, but a simple way to resolve it for everyone is to bump OE-Core's version to 6 with an automatic no-op upgrade. Also ensure that multiple upgrade functions (such as the poky one) have a chance to execute by not breaking out of the loop as we were before. Fixes [YOCTO #6139]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-20sanity: TMPDIR ABI change for kernel processRichard Purdie
The kernel source is being moved into the sysroot, to do this and preserve previous builds, we need to change the TMPDIR ABI and provide a function to uninstall all kernels from the sysroot. This change adds code to do that and increases the ABI number. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27sanity: refactor mirrors checks to be more pythonicChristopher Larson
- Use clearer variable names - Use variable unpacking to reference elements by name rather than index - Sacrifice a small amount of time (iterate over protocols twice per entry rather than once) for clarity: use readable generator expressions with any() rather than maintaining state. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27sanity: fix support for regex schemes in mirrors checkChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27sanity: handle both \n and \\n in mirror varsChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23sanity.bbclass: check the format of MIRRORSRobert Yang
Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS: * Each mirror shoudl contain two memebers. * The local "file://" url must use absolute path (file:///). * The protocol must in protocols list. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23sanity.bbclass/kernel.bbclass: minor fixesRobert Yang
Fixed: - Remove an unused line - Remove unneeded code after d.getVar(), we don't need the "or ''" after d.getVar() unless we need a string. - typo: PREMIRROS -> PREMIRRORS. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02sanity.bbclass: Add ability to verify toolchain flagsMark Hatle
When attempting to use a binary toolchain, such as meta-mentor, we want the ability to verify that the CCARGS, ASARGS and LDARGS contain the necessary and appropriate flags. This change specifically verifies, if set: TUNEABI_REQUIRED_CCARGS_tune-<tune> TUNEABI_REQUIRED_ASARGS_tune-<tune> TUNEABI_REQUIRED_LDARGS_tune-<tune> Each of these, will be processed by the class and verified that the selected tune's CCARGS, ASARGS, and LDARGS contains the listed item. This can be used to validate that the user has not accidently or otherwise missed an argument. Note, conflicting arguments are not verified. Without verification it's possible for a misconfiguration to go undetected, presenting runtime and debugging errors. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-07-23sanity: Check for setgid/setuid TMPDIRRichard Purdie
Building in a TMPDIR which has setgid or setuid is a bad idea. We could try and reset the permissions but since these can also invade into other directories like the cache or sstate, lets tell the user to fix it instead. [YOCTO #6519] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-08sanity.bbclass: Update minimum git version to 1.7.8Richard Purdie
To quote "Maxin B. John" <maxin.john@enea.com>: git version 1.7.8 added the --list option to git-branch. Since we depend on this option in git.py, the minimum requiremnt for git should be updated to Git 1.7.8+ Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-03sanity.bbclass: Add libsdl-native checkRichard Purdie
If libsdl-native is in ASSUME_PROVIDED, check for it in the sanity tests. This warns the user if they've said its being provided but it isn't and prevents silent build issues. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-04sanity: testimage needs DISPLAY set only for qemu targetsStefan Stanacar
There's no point in failing if DISPLAY isn't set if we don't boot a qemu image when using a controller like SimpleRemoteTarget or GummibootTarget. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-01image/image-prelink/image-mklibs/sanity: Drop pointless EXPORT_FUNCTIONSRichard Purdie
I'm sick of seeing people adding to EXPORT_FUNCTIONS in these classes when they clearly have no idea what it does. Worse, these uses of it are all broken, the naming is incorrect and they do nothing. Lets remove them and try and preserve any remaining part of my sanity. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-31classes/sanity: check if SDKMACHINE setting has taken effectPaul Eggleton
If you try to set SDKMACHINE in a distro configuration file, it won't take effect because by the time that is parsed the line in bitbake.conf which includes the appropriate conf file for SDKMACHINE has already been parsed. Check that SDK_ARCH has changed from its default value and show an error if it hasn't in order to catch this misconfiguration. Fixes [YOCTO #5861]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27sanity.bbclass: Update against bitbake sanity event changesRichard Purdie
Bitbake will now trigger sanity events when it needs the checks to run in all cases so we can drop the ConfigParsed hook. We now control whether events are generated or errors are raised from the event itself. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05sanity.bbclass: support wildcards in SANITY_TESTED_DISTROSOlof Johansson
With this change, you can use shell like globbing expressions (as supported by Python's fnmatch) for entries in SANITY_TESTED_DISTROS. This makes it possible to say that, e.g. "all Debian 7 Wheezy releases are supported" with the entry "Debian-7.*". [YOCTO #5265] Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-02sanity.bbclass: check that TMPDIR is not located on nfsRobert Yang
There would be some unexpected errors when the whole TMPDIR is located on nfs, so add a test for it in sanity.bbclass. Note: The better way to get the filesystem id should be get f_fsid from struct statvfs, but there is no f_fsid in os.stat() or os.statvfs(), so we use 'stat -f -c "%t"' here. BTW., s/tmpdir/TMPDIR/ in the previous comment message to make them have a uniform. [YOCTO #5442] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-28sanity.bbclass: check required perl modulesRobert Yang
Several required perl modules may missing on the host, for example the Text::ParseWords, Thread::Queue and Data::Dumper are not installed by default on recent Fedora releases (19 and 20 AFAIK). There would be wild errors if they don't exist, so check them in sanity.bbclass. And add perl to SANITY_REQUIRED_UTILITIES. [YOCTO #5744] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>