Skip to contentSkip to conversation

Couple of fixes to help new users

RFC PATCH Applied Paul Eggleton 6 participants 16 messages Aug 17, 2011 – Aug 23, 2011

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 54eb78b..286ae01 100644
@@ -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
index 386b05e..a2b10f2 100644
@@ -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
new file mode 100644
index 0000000..97ec185
@@ -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
#2 lore raw

Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files

meta/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.

#3 lore raw

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
#4 lore raw

Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files

Quoted 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
#5 lore raw

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
#6 lore raw

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,
Paul

Signature · 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
#7 lore raw

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
#8 lore raw

Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files

In reply to Paul Eggleton

Op 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].

---

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 +0 -0
index 54eb78b..286ae01 100644

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.
#9 lore raw

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
#10 lore raw

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
#11 lore raw

Re: [RFC PATCH 1/2] image.bbclass, kernel.bbclass: create warning file about deleting deploydir files

In reply to Anders Darander
Quoted 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.

#12 lore raw

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
#13 lore raw

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.

#14 lore raw

RFC PATCH 2/2 sanity.bbclass: add optional untested host distro warning

In reply to Paul Eggleton

SANITY_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
index d50c843..16af029 100644
@@ -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
Applied
#15 lore raw
In reply to Paul Eggleton
Quoted 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-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

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!