Couple of fixes to help new users
cover Couple of fixes to help new users
Please review the following changes for suitability for inclusion. If you have any objections or suggestions for improvement, please respond to the patches. If you agree with the changes, please provide your Acked-by.
The following changes since commit 2e83e6755441cb14bd907d306974338c15173189:
kernel: restore crtsavres.o to enable building external modules on powerpc (2011-08-17 15:46:16 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/sanity3
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/sanity3
Paul Eggleton (2):
image.bbclass, kernel.bbclass: create warning file about deleting
deploydir files
sanity.bbclass: add optional untested host distro warning
meta/classes/image.bbclass | 2 + meta/classes/kernel.bbclass | 2 + meta/classes/sanity.bbclass | 48 +++++++++++++++++++++++++++++++++++++++ meta/files/deploydir_readme.txt | 8 ++++++ 4 files changed, 60 insertions(+), 0 deletions(-) create mode 100644 meta/files/deploydir_readme.txt
Signature · 1 line
1.7.4.1
RFC PATCH 1/2 image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
New users sometimes delete files in tmp/deploy/images assuming they will be re-created just by re-running the build, and then are confused when this doesn't work. To discourage people from doing this, create a file called README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt in tmp/deploy/images containing an explanation of what needs to be done to re-create files there.
Fixes [YOCTO #1315] and [YOCTO #1346].
--- meta/classes/image.bbclass | 2 ++ meta/classes/kernel.bbclass | 2 ++ meta/files/deploydir_readme.txt | 8 ++++++++ 3 files changed, 12 insertions(+), 0 deletions(-) create mode 100644 meta/files/deploydir_readme.txt
meta/classes/image.bbclass +2 -0
@@ -138,6 +138,8 @@ fakeroot do_rootfs () { mkdir -p ${IMAGE_ROOTFS} mkdir -p ${DEPLOY_DIR_IMAGE} + cp -n ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOY_DIR_IMAGE}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt + if [ "${USE_DEVFS}" != "1" ]; then for devtable in ${@get_devtable_list(d)}; do makedevs -r ${IMAGE_ROOTFS} -D $devtable
meta/classes/kernel.bbclass +2 -0
@@ -500,6 +500,8 @@ kernel_do_deploy() { cd ${DEPLOYDIR} rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin + + cp -n ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt } do_deploy[dirs] = "${DEPLOYDIR} ${B}"
meta/files/deploydir_readme.txt new file +8 -0
@@ -0,0 +1,8 @@ +Files in the deploy directory will not be re-created automatically if you +delete them. If you do delete a file, you will need to run: + + bitbake -c clean TARGET + bitbake TARGET + +where TARGET is the name of the appropriate package or target e.g. +"virtual/kernel" for the kernel, an image, etc.
Signature · 1 line
1.7.4.1
RFC PATCH 2/2 sanity.bbclass: add optional untested host distro warning
In reply to Paul EggletonSANITY_TESTED_DISTROS, if specified, is expected to be a newline-delimited list of distro identifier strings, e.g.
SANITY_TESTED_DISTROS = " \
Ubuntu 11.04 \
Fedora release 14 (Laughlin) \
"(spaces, tabs etc. are trimmed)
If SANITY_TESTED_DISTROS is defined, we will attempt to detect the host distribution. If the distribution is not in SANITY_TESTED_DISTROS or we could not detect the distribution then we show a warning during sanity checking.
Provides the mechanism for fixing [YOCTO #1096].
--- meta/classes/sanity.bbclass | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-)
meta/classes/sanity.bbclass +48 -0
@@ -118,6 +118,52 @@ def check_connectivity(d): return retval +def check_supported_distro(e): + tested_distros = e.data.getVar('SANITY_TESTED_DISTROS', True) + if not tested_distros: + return + + if os.path.exists("/etc/redhat-release"): + f = open("/etc/redhat-release", "r") + try: + distro = f.readline() + finally: + f.close() + elif os.path.exists("/etc/SuSE-release"): + f = open("/etc/SuSE-release", "r") + try: + distro = f.readline() + # Remove the architecture suffix e.g. (i586) + distro = re.sub(r' \([a-zA-Z0-9\-_]*\)$', '', distro).strip() + finally: + f.close() + else: + # Use LSB method + import subprocess as sub + try: + p = sub.Popen(['lsb_release','-d','-s'],stdout=sub.PIPE,stderr=sub.PIPE) + out, err = p.communicate() + distro = out.rstrip() + except Exception: + distro = None + + if not distro: + if os.path.exists("/etc/lsb-release"): + f = open("/etc/lsb-release", "r") + try: + for line in f: + lns = line.split('=') + if lns[0] == "DISTRIB_DESCRIPTION": + distro = lns[1].strip('"\n') + break + finally: + f.close() + if distro: + if distro not in [x.strip() for x in tested_distros.split('\n')]: + bb.warn('Host distribution "%s" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.' % distro) + else: + bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.') + def check_sanity(e): from bb import note, error, data, __version__
@@ -249,6 +295,8 @@ def check_sanity(e): if pseudo_msg != "": messages = messages + pseudo_msg + '\n' + check_supported_distro(e) + # Check if DISPLAY is set if IMAGETEST is set if not data.getVar( 'DISPLAY', e.data, True ) and data.getVar( 'IMAGETEST', e.data, True ) == 'qemu': messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n'
Signature · 1 line
1.7.4.1
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
In reply to Paul Eggletonmeta/files/deploydir_readme.txt line 8
Quoted 8 lines · Paul Eggleton
meta/files/deploydir_readme.txt new file +8
-0+Files in the deploy directory will not be re-created automatically if you +delete them. If you do delete a file, you will need to run: + + bitbake -c clean TARGET + bitbake TARGET + +where TARGET is the name of the appropriate package or target e.g. +"virtual/kernel" for the kernel, an image, etc.
Doesn't it suffice to run "bitbake -f -c deploy TARGET"?
p.
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Quoted 11 lines · On Wednesday 17 August 2011 19:41:37 Phil Blundell wrote:
meta/files/deploydir_readme.txt line 8
Quoted 8 lines · Paul Eggleton
+Files in the deploy directory will not be re-created automatically if you +delete them. If you do delete a file, you will need to run:
meta/files/deploydir_readme.txt new file +6
-0+ + bitbake -c clean TARGET + bitbake TARGET + +where TARGET is the name of the appropriate package or target e.g. +"virtual/kernel" for the kernel, an image, etc.Doesn't it suffice to run "bitbake -f -c deploy TARGET"?
I guess it would, but I'm not sure we really want to be encouraging users to use -f.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
In reply to Paul EggletonOp 17 aug. 2011, om 20:37 heeft Paul Eggleton het volgende geschreven:
Quoted 22 lines
New users sometimes delete files in tmp/deploy/images assuming they will be re-created just by re-running the build, and then are confused when this doesn't work. To discourage people from doing this, create a file called README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt in tmp/deploy/images containing an explanation of what needs to be done to re-create files there.
Fixes [YOCTO #1315] and [YOCTO #1346].
Signed-off-by Paul Eggleton <[email protected]>---
meta/classes/image.bbclass | 2 ++ meta/classes/kernel.bbclass | 2 ++ meta/files/deploydir_readme.txt | 8 ++++++++ 3 files changed, 12 insertions(+), 0 deletions(-)create mode 100644
meta/files/deploydir_readme.txtmeta/classes/image.bbclass +0
-0
meta/classes/image.bbclass fakeroot do_rootfs () { · line 142
Quoted 5 lines
meta/classes/image.bbclass +2
-0@@ -138,6 +138,8 @@ fakeroot do_rootfs () { mkdir -p ${IMAGE_ROOTFS} mkdir -p ${DEPLOY_DIR_IMAGE} + cp -n ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOY_DIR_IMAGE}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt +
That doesn't work on my debian box:
| + cp -n /OE/tentacle/sources/openembedded-core/meta/files/deploydir_readme.txt /OE/tentacle/build/tmp-angstrom_2010_x-eglibc/deploy/images/beagleboard/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | cp: invalid option -- 'n' | Try `cp --help' for more information.
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Quoted 9 lines · Koen Kooi
Op 17 aug. 2011, om 20:37 heeft Paul Eggleton het volgende geschreven:
meta/classes/image.bbclass fakeroot do_rootfs () { · line 142
Quoted 2 lines
meta/classes/image.bbclass +2
-0+ cp -n ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOY_DIR_IMAGE}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt +That doesn't work on my debian box:
| + cp -n /OE/tentacle/sources/openembedded-core/meta/files/deploydir_readme.txt /OE/tentacle/build/tmp-angstrom_2010_x-eglibc/deploy/images/beagleboard/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | cp: invalid option -- 'n' | Try `cp --help' for more information.
Which debian version are you running?
I've seen no problem, as far as I can tell, on neither my ubuntu, nor my debian box. (Although I'm running debian sid on that one).
Cheers,
Anders
Signature · 2 lines
Anders Darander ChargeStorm AB
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Op 23 aug. 2011, om 08:44 heeft Anders Darander het volgende geschreven:
Quoted 7 lines · Koen Kooi
Quoted 5 lines
Op 17 aug. 2011, om 20:37 heeft Paul Eggleton het volgende geschreven:
meta/classes/image.bbclass fakeroot do_rootfs () { · line 142
Quoted 2 lines
meta/classes/image.bbclass +2
-0+ cp -n ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOY_DIR_IMAGE}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt +That doesn't work on my debian box:
Quoted 8 lines
Quoted 3 lines
| + cp -n /OE/tentacle/sources/openembedded-core/meta/files/deploydir_readme.txt /OE/tentacle/build/tmp-angstrom_2010_x-eglibc/deploy/images/beagleboard/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | cp: invalid option -- 'n' | Try `cp --help' for more information.Which debian version are you running?
I've seen no problem, as far as I can tell, on neither my ubuntu, nor my debian box. (Although I'm running debian sid on that one).
koen@dominion:/OE/tentacle/sources/openembedded-core$ lsb_release -a /usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated import sets No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 5.0 (lenny) Release: 5.0 Codename: lenny
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
In reply to Anders DaranderQuoted 7 lines · Anders Darander
Quoted 5 lines · Koen Kooi
Op 17 aug. 2011, om 20:37 heeft Paul Eggleton het volgende geschreven:
meta/classes/image.bbclass fakeroot do_rootfs () { · line 142
Quoted 2 lines
meta/classes/image.bbclass +2
-0+ cp -n ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOY_DIR_IMAGE}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt +That doesn't work on my debian box:
Quoted 8 lines
Quoted 3 lines
| + cp -n /OE/tentacle/sources/openembedded-core/meta/files/deploydir_readme.txt /OE/tentacle/build/tmp-angstrom_2010_x-eglibc/deploy/images/beagleboard/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | cp: invalid option -- 'n' | Try `cp --help' for more information.Which debian version are you running?
I've seen no problem, as far as I can tell, on neither my ubuntu, nor my debian box. (Although I'm running debian sid on that one).
Irrespective of whether it happens to work or not on some or other distro, "cp -n" isn't POSIX and we shouldn't be relying on it.
I can't really see why the -n option is needed here anyway. It looks to me like it could just be removed with no ill effects.
p.
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Quoted 5 lines · On Tuesday 23 August 2011 10:22:12 Phil Blundell wrote:
Irrespective of whether it happens to work or not on some or other distro, "cp -n" isn't POSIX and we shouldn't be relying on it.
I can't really see why the -n option is needed here anyway. It looks to me like it could just be removed with no ill effects.
Sorry, I wasn't aware that it was a non-standard option. I'll post a new version with it removed.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Quoted 9 lines · Paul Eggleton
Quoted 5 lines · On Tuesday 23 August 2011 10:22:12 Phil Blundell wrote:
Irrespective of whether it happens to work or not on some or other distro, "cp -n" isn't POSIX and we shouldn't be relying on it.
I can't really see why the -n option is needed here anyway. It looks to me like it could just be removed with no ill effects.
Sorry, I wasn't aware that it was a non-standard option. I'll post a new version with it removed.
Yeah, POSIX cp only understands quite a restricted set of options. It supports -f, -i, -p, -R, plus -H, -L and -P in newer versions (and the obsolescent -r). Anything beyond that is not guaranteed.
p.
Saul Wold
AppliedQuoted 17 lines · Paul Eggleton
Please review the following changes for suitability for inclusion. If you have any objections or suggestions for improvement, please respond to the patches. If you agree with the changes, please provide your Acked-by.
The following changes since commit
2e83e6755441cb14bd907d306974338c15173189:kernel: restore crtsavres.o to enable building external modules on powerpc (2011-08-17 15:46:16 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contribpaule/sanity3
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/sanity3Paul Eggleton (2):
image.bbclass, kernel.bbclass: create warning file about deleting
deploydir files
sanity.bbclass: add optional untested host distro warning
Quoted 7 lines
meta/classes/image.bbclass | 2 + meta/classes/kernel.bbclass | 2 + meta/classes/sanity.bbclass | 48 +++++++++++++++++++++++++++++++++++++++ meta/files/deploydir_readme.txt | 8 ++++++ 4 files changed, 60 insertions(+), 0 deletions(-)create mode 100644
meta/files/deploydir_readme.txt
Merged into OE-Core
I know there is some additional fix for the image.bbclass, do we need one for kernel.bbclass also?
Thanks
Sau!
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
In reply to Paul EggletonQuoted 13 lines · Paul Eggleton
Quoted 11 lines · On Wednesday 17 August 2011 19:41:37 Phil Blundell wrote:
meta/files/deploydir_readme.txt line 8
Quoted 8 lines · Paul Eggleton
+Files in the deploy directory will not be re-created automatically if you +delete them. If you do delete a file, you will need to run:
meta/files/deploydir_readme.txt new file +6
-0+ + bitbake -c clean TARGET + bitbake TARGET + +where TARGET is the name of the appropriate package or target e.g. +"virtual/kernel" for the kernel, an image, etc.Doesn't it suffice to run "bitbake -f -c deploy TARGET"?
Quoted 2 lines
I guess it would, but I'm not sure we really want to be encouraging users to use -f.
I don't see it as having the same negative conotation as the force options to things like rpm and dpkg. Here it just means "I really want to run this specific task again, even if you already ran it, likely because I know I did something to undo what you just did." :-)
Quoted 4 lines
Cheers,
Paul
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Quoted 8 lines · On Tuesday 23 August 2011 20:08:08 you wrote:
Quoted 2 lines · Paul Eggleton
I guess it would, but I'm not sure we really want to be encouraging users to use -f.
I don't see it as having the same negative conotation as the force options to things like rpm and dpkg. Here it just means "I really want to run this specific task again, even if you already ran it, likely because I know I did something to undo what you just did." :-)
My concern is that not all tasks are repeatable; people could run into all sorts of trouble using this option under the wrong circumstances and it might be difficult to debug after the fact.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Op 23 aug. 2011 om 22:07 heeft Paul Eggleton <[email protected]> het volgende geschreven:
Quoted 11 lines · On Tuesday 23 August 2011 20:08:08 you wrote:
Quoted 8 lines · Paul Eggleton
Quoted 2 lines
I guess it would, but I'm not sure we really want to be encouraging users to use -f.
I don't see it as having the same negative conotation as the force options to things like rpm and dpkg. Here it just means "I really want to run this specific task again, even if you already ran it, likely because I know I did something to undo what you just did." :-)
My concern is that not all tasks are repeatable;
I consider that a bug :)
Quoted 16 lines
could run into all
sorts of trouble using this option under the wrong circumstances and it might be difficult to debug after the fact.Cheers,
PaulSignature · 7 lines
Paul Eggleton Intel Open Source Technology Centre _______________________________________________ Openembedded-core mailing list [email protected] http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
Quoted 3 lines · On Tuesday 23 August 2011 22:39:41 Koen Kooi wrote:
Quoted 1 line
My concern is that not all tasks are repeatable;
I consider that a bug :)
Why? If you use the system as intended it's never a problem.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre