From 1e677d83dfd89840777e5e458e384df1a2d8bfab Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 7 Mar 2007 23:02:23 +0000 Subject: tinderclient.bbclass: Add hacky workaround for bitbake 1.8.x (pending rewrite in 1.9) --- classes/tinderclient.bbclass | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'classes') diff --git a/classes/tinderclient.bbclass b/classes/tinderclient.bbclass index 3f5183cc8f..d1d9f49fac 100644 --- a/classes/tinderclient.bbclass +++ b/classes/tinderclient.bbclass @@ -371,6 +371,10 @@ addhandler tinderclient_eventhandler python tinderclient_eventhandler() { from bb import note, error, data from bb.event import NotHandled + + if e.data is None: + return NotHandled + do_tinder_report = data.getVar('TINDER_REPORT', e.data, True) if do_tinder_report and do_tinder_report == "1": tinder_do_tinder_report(e) -- cgit v1.2.3 From 0c6a9f2f931c65df90763850e9b30bb0d913e498 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Fri, 9 Mar 2007 20:29:00 +0000 Subject: classes/insane.bbclass: Use split and make it work with python2.3 again rsplit was introduced in python 2.4 and is like split but starts to split from the right side. The only difference is obviously if you have maxsplit set (which we don't). So it is fine to remove the 'r' --- classes/insane.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index a3ca21d1dc..40f6151f08 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -206,7 +206,7 @@ def package_qa_check_rpath(file,name,d): bb.fatal("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check") output = os.popen("%s -Byr %s" % (scanelf,file)) - txt = output.readline().rsplit() + txt = output.readline().split() if bad_dir in txt: package_qa_write_error( 1, name, file, d) bb.error("QA Issue package %s contains bad RPATH %s in file %s" % (name, txt, file)) -- cgit v1.2.3 From 21e7506f34e5cc2fc0667ecab73202422f7225cd Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 10 Mar 2007 00:28:54 +0000 Subject: classes/seppuku.bbclass: Switch to HTTP post, attach the build logs instead of using comments The limit of comments is too low. Use attachments to work around this issue. Also start using HTTP post to avoid really long URLs. They lead to a pipe error. To post we use a MultiPartPoster which is licensed LGPL and can be freely downloaded. You need to put it into the PYTHONPATH Add a new variable for creating attachments and document it. --- classes/seppuku.bbclass | 111 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 16 deletions(-) (limited to 'classes') diff --git a/classes/seppuku.bbclass b/classes/seppuku.bbclass index 5757df7efb..8d5e234c49 100644 --- a/classes/seppuku.bbclass +++ b/classes/seppuku.bbclass @@ -5,6 +5,23 @@ # This class requires python2.4 because of the urllib2 usage # +def seppuku_spliturl(url): + """ + Split GET URL to return the host base and the query + as a param dictionary + """ + import urllib + (uri,query) = urllib.splitquery(url) + param = {} + for par in query.split("&"): + (key,value) = urllib.splitvalue(par) + key = urllib.unquote(key) + value = urllib.unquote(value) + param[key] = value + + return (uri,param) + + def seppuku_login(opener, login, user, password): """ @@ -109,7 +126,7 @@ def seppuku_find_bug_report(opener, query, product, component, bugname): (number,status) = scanner.result()[0] return (not status in ["CLOS", "RESO", "VERI"],number) -def seppuku_reopen_bug(opener, file, product, component, bug_number, bugname, text): +def seppuku_reopen_bug(poster, file, product, component, bug_number, bugname, text): """ Reopen a bug report and append to the comment @@ -118,22 +135,34 @@ def seppuku_reopen_bug(opener, file, product, component, bug_number, bugname, te http://bugzilla.openmoko.org/cgi-bin/bugzilla/process_bug.cgi?id=239&bug_file_loc=http%3A%2F%2F&version=2007&longdesclength=2&product=OpenMoko&component=autobuilds&comment=bla&priority=P2&bug_severity=normal&op_sys=Linux&rep_platform=Neo1973&knob=reopen&target_milestone=Phase+0&short_desc=foo """ - import urllib, urllib2 - param = urllib.urlencode( { "product" : product, "component" : component, "longdesclength" : 2, - "short_desc" : bugname, "knob" : "reopen", "id" : bug_number, "comment" : text } ) + import urllib2 + (uri, param) = seppuku_spliturl( file ) + + # Prepare the post + param["product"] = product + param["component"] = component + param["longdesclength"] = 2 + param["short_desc"] = bugname + param["knob"] = "reopen" + param["id"] = bug_number + param["comment"] = text + try: - result = opener.open( file + param ) + result = poster.open( uri, param ) except urllib2.HTTPError, e: print e.geturl() print e.info() return False + except Exception, e: + print e + return False if result.code != 200: return False else: return True -def seppuku_file_bug(opener, file, product, component, bugname, text): +def seppuku_file_bug(poster, file, product, component, bugname, text): """ Create a completely new bug report @@ -150,14 +179,21 @@ def seppuku_file_bug(opener, file, product, component, bugname, text): @param text Text """ - import urllib,urllib2 - param = urllib.urlencode( { "product" : product, "component" : component, "short_desc" : bugname, "comment" : text } ) + import urllib2 + (uri, param) = seppuku_spliturl( file ) + param["product"] = product + param["component"] = component + param["short_desc"] = bugname + param["comment"] = text + try: - result = opener.open( file + param ) + result = poster.open( uri, param ) except urllib2.HTTPError, e: print e.geturl() print e.info() - raise e + return False + except Exception, e: + print e return False if result.code != 200: @@ -165,6 +201,35 @@ def seppuku_file_bug(opener, file, product, component, bugname, text): else: return True +def seppuku_create_attachment(poster, attach_query, product, component, bug_number, text, file): + """ + + Create a new attachment for the failed report + """ + + if not bug_number: + import bb + bb.note("Can't create an attachment, the bug is not present") + return False + + import urllib2 + param = { "bugid" : bug_number, "action" : "insert", "data" : file, "description" : "Build log", "ispatch" : "0", "contenttypemethod" : "list", "contenttypeselection" : "text/plain", "comment" : text } + + try: + result = poster.open( attach_query, param ) + except urllib2.HTTPError, e: + print e.geturl() + print e.info() + return False + except Exception, e: + print e + return False + + print result.read() + if result.code != 200: + return False + else: + return True addhandler seppuku_eventhandler @@ -177,7 +242,12 @@ python seppuku_eventhandler() { from bb import data, mkdirhier, build import bb, os, glob - bb.note( "Ran" ) + # Try to load our exotic libraries + try: + import MultipartPostHandler + except: + bb.note("You need to put the MultipartPostHandler into your PYTHONPATH. Download it from http://pipe.scs.fsu.edu/PostHandler/MultipartPostHandler.py") + return NotHandled try: import urllib2, cookielib @@ -194,10 +264,12 @@ python seppuku_eventhandler() { elif name == "TaskFailed" or name == "NoProvider": cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) + poster = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj),MultipartPostHandler.MultipartPostHandler) login = bb.data.getVar("SEPPUKU_LOGIN", data, True) query = bb.data.getVar("SEPPUKU_QUERY", data, True) newbug = bb.data.getVar("SEPPUKU_NEWREPORT", data, True) reopen = bb.data.getVar("SEPPUKU_ADDCOMMENT", data, True) + attach = bb.data.getVar("SEPPUKU_ATTACHMENT", data, True) user = bb.data.getVar("SEPPUKU_USER", data, True) passw = bb.data.getVar("SEPPUKU_PASS", data, True) product = bb.data.getVar("SEPPUKU_PRODUCT", data, True) @@ -215,12 +287,12 @@ python seppuku_eventhandler() { "pr" : bb.data.getVar("PR", data, True), "task" : e.task } log_file = glob.glob("%s/log.%s.*" % (bb.data.getVar('T', event.data, True), event.task)) - if len(log_file) != 0: - to_file = bb.data.getVar('TINDER_LOG', event.data, True) - text = "".join(open(log_file[0], 'r').readlines()) + text = "The package failed to build at %s" % bb.data.getVar('DATETIME', data, True) + file = open(log_file[0], 'r') elif name == "NoProvider": bugname = "noprovider for %s runtime: %s" % (event.getItem, event.getisRuntime) text = "Please fix it" + file = None else: assert False @@ -234,10 +306,17 @@ python seppuku_eventhandler() { return NotHandled if bug_number and not bug_open: - if not seppuku_reopen_bug(opener, reopen, product, component, bug_number, bugname, text): + if not seppuku_reopen_bug(poster, reopen, product, component, bug_number, bugname, text): bb.note("Failed to reopen the bug report") - elif not seppuku_file_bug(opener, newbug, product, component, bugname, text): + elif not seppuku_file_bug(poster, newbug, product, component, bugname, text): bb.note("Filing a bugreport failed") + else: + # get the new bug number and create an attachment + (bug_open, bug_number) = seppuku_find_bug_report(opener, query, product, component, bugname) + + if file: + if not seppuku_create_attachment(poster, attach, product, component, bug_number, text, file): + bb.note("Failed to attach the build log") return NotHandled } -- cgit v1.2.3 From 1b661974e3f8f844f6ec4cdb7bb42cef9595b626 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Sat, 10 Mar 2007 14:10:06 +0000 Subject: own-mirrors.bbclass: added class which can be used to set PREMIRRORS from config - SOURCE_MIRROR_URL is new variable which point to source mirror which will be used before fetching from original SRC_URI location. --- classes/own-mirrors.bbclass | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 classes/own-mirrors.bbclass (limited to 'classes') diff --git a/classes/own-mirrors.bbclass b/classes/own-mirrors.bbclass new file mode 100644 index 0000000000..32763ed24f --- /dev/null +++ b/classes/own-mirrors.bbclass @@ -0,0 +1,4 @@ +PREMIRRORS() { +http://.*/.* ${SOURCE_MIRROR_URL} +ftp://.*/.* ${SOURCE_MIRROR_URL} +} -- cgit v1.2.3 From bd13294b484455566e38dc333eb2f098b90cef09 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 10 Mar 2007 20:12:18 +0000 Subject: opie.bbclass: Allow OPIE_CVS_PV to be overriden. --- classes/opie.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/opie.bbclass b/classes/opie.bbclass index c3b9d13226..92cde5487b 100644 --- a/classes/opie.bbclass +++ b/classes/opie.bbclass @@ -15,7 +15,7 @@ inherit palmtop -OPIE_CVS_PV = "1.2.2+cvs${SRCDATE}" +OPIE_CVS_PV ?= "1.2.2+cvs${SRCDATE}" DEPENDS_prepend = "${@["libopie2 ", ""][(bb.data.getVar('PN', d, 1) == 'libopie2')]}" -- cgit v1.2.3 From 2b6c35cc5513a15159e06bd558cf3e84eac146fd Mon Sep 17 00:00:00 2001 From: Jamie Lenehan Date: Thu, 15 Mar 2007 07:32:35 +0000 Subject: insane.bbclass: Add support for sh4. --- classes/insane.bbclass | 1 + 1 file changed, 1 insertion(+) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 40f6151f08..1f20fa6614 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -48,6 +48,7 @@ def package_qa_get_machine_dict(): "m68k": ( 4, 0, 0, False, True), "mips": ( 8, 0, 0, False, True), "s390": (22, 0, 0, False, True), + "sh4": (42, 0, 0, True, True), "sparc": ( 2, 0, 0, False, True), }, "linux-uclibc" : { -- cgit v1.2.3 From bff6ed820186d8af5cbe59930f61013d489ad732 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Fri, 16 Mar 2007 20:16:31 +0000 Subject: classes/seppuku.bbclass: Make parsing of OpenEmbedded's bugtracker work OE's bugtracker has different classes for the buglist. I try hard to parse them all. All severities should be handled. --- classes/seppuku.bbclass | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/seppuku.bbclass b/classes/seppuku.bbclass index 8d5e234c49..7962cfbeb9 100644 --- a/classes/seppuku.bbclass +++ b/classes/seppuku.bbclass @@ -65,10 +65,13 @@ def seppuku_find_bug_report_old(): HTMLParser.__init__(self) self.state = self.STATE_NONE self.bugs = [] + self.bug = None def handle_starttag(self, tag, attr): if self.state == self.STATE_NONE and tag.lower() == "tr": - if len(attr) == 1 and attr[0] == ('class', 'bz_normal bz_P2 '): + if len(attr) == 1 and attr[0][0] == 'class' and \ + ('bz_normal' in attr[0][1] or 'bz_blocker' in attr[0][1] or 'bz_enhancement' in attr[0][1] or 'bz_major' in attr[0][1] or 'bz_minor' in attr[0][1] or 'bz_trivial' in attr[0][1] or 'bz_critical' in attr[0][1] or 'bz_wishlist' in attr[0][1]) \ + and 'bz_P' in attr[0][1]: self.state = self.STATE_FOUND_TR elif self.state == self.STATE_FOUND_TR and tag.lower() == "td": self.state += 1 @@ -78,6 +81,7 @@ def seppuku_find_bug_report_old(): if self.state != self.STATE_NONE: self.bugs.append( (self.bug,self.status) ) self.state = self.STATE_NONE + self.bug = None if self.state > 1 and tag.lower() == "td": self.state += 1 @@ -89,7 +93,11 @@ def seppuku_find_bug_report_old(): return if self.state == self.STATE_FOUND_NUMBER: - self.bug = data + """ + #1995 in bugs.oe.org has [SEC] additionally to the number and we want to ignore it + """ + if not self.bug: + self.bug = data elif self.state == self.STATE_FOUND_STATUS: self.status = data -- cgit v1.2.3 From 1977f9a109dac503efc20651adde01c28a92fd4f Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Fri, 16 Mar 2007 21:06:47 +0000 Subject: classes/seppuku.bbclass: Make it work with OpenEmbedded bugtracker Do not error out on python2.5 when splitting the url. We had an empty key and a none value. If there was no output file, do not error. This check is the same as in tinderclient.bbclass --- classes/seppuku.bbclass | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/seppuku.bbclass b/classes/seppuku.bbclass index 7962cfbeb9..4c0d4f9a82 100644 --- a/classes/seppuku.bbclass +++ b/classes/seppuku.bbclass @@ -15,6 +15,8 @@ def seppuku_spliturl(url): param = {} for par in query.split("&"): (key,value) = urllib.splitvalue(par) + if not key or len(key) == 0 or not value: + continue key = urllib.unquote(key) value = urllib.unquote(value) param[key] = value @@ -289,6 +291,7 @@ python seppuku_eventhandler() { else: print "Logged into the box" + file = None if name == "TaskFailed": bugname = "%(package)s-%(pv)s-%(pr)s-%(task)s" % { "package" : bb.data.getVar("PN", data, True), "pv" : bb.data.getVar("PV", data, True), @@ -296,11 +299,11 @@ python seppuku_eventhandler() { "task" : e.task } log_file = glob.glob("%s/log.%s.*" % (bb.data.getVar('T', event.data, True), event.task)) text = "The package failed to build at %s" % bb.data.getVar('DATETIME', data, True) - file = open(log_file[0], 'r') + if len(log_file) != 0: + file = open(log_file[0], 'r') elif name == "NoProvider": bugname = "noprovider for %s runtime: %s" % (event.getItem, event.getisRuntime) text = "Please fix it" - file = None else: assert False -- cgit v1.2.3 From 5fb7f282ceab4ad5655ef46c04d14fc51bc4c245 Mon Sep 17 00:00:00 2001 From: Oyvind Repvik Date: Sun, 18 Mar 2007 23:27:28 +0000 Subject: foonas: Move image-stuff to classes for lsppchg, lsppchd, n2100 and turbostation --- classes/lsppchd-image.bbclass | 1 + classes/lsppchg-image.bbclass | 1 + classes/n2100-image.bbclass | 36 ++++++++++++++++++++++++++++++++++++ classes/turbostation-image.bbclass | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 classes/lsppchd-image.bbclass create mode 100644 classes/lsppchg-image.bbclass create mode 100644 classes/n2100-image.bbclass create mode 100644 classes/turbostation-image.bbclass (limited to 'classes') diff --git a/classes/lsppchd-image.bbclass b/classes/lsppchd-image.bbclass new file mode 100644 index 0000000000..da280551d4 --- /dev/null +++ b/classes/lsppchd-image.bbclass @@ -0,0 +1 @@ +IMAGE_POSTPROCESS_COMMAND += "" diff --git a/classes/lsppchg-image.bbclass b/classes/lsppchg-image.bbclass new file mode 100644 index 0000000000..da280551d4 --- /dev/null +++ b/classes/lsppchg-image.bbclass @@ -0,0 +1 @@ +IMAGE_POSTPROCESS_COMMAND += "" diff --git a/classes/n2100-image.bbclass b/classes/n2100-image.bbclass new file mode 100644 index 0000000000..811b1d37b7 --- /dev/null +++ b/classes/n2100-image.bbclass @@ -0,0 +1,36 @@ +DEPENDS += "openssl-native" +EXTRA_IMAGECMD = "--little-endian" +ERASEBLOCK_SIZE = "0x20000" +IMAGE_FSTYPES = "jffs2" +IMAGE_POSTPROCESS_COMMAND += '${MACHINE}_pack_image;' + +n2100_pack_image() { + # find latest kernel + KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/zImage* | tail -1` + if [ -z "$KERNEL" ]; then + oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Bitbake linux to create one." + exit 1 + fi + ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 + OUTPUT=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flash.img + PADFILE=${DEPLOY_DIR_IMAGE}/padfile.zzz + HEX_MAX_KERN_SIZE=1C0000 + DEC_MAX_KERN_SIZE=`echo "ibase=16; $HEX_MAX_KERN_SIZE" | bc ` + HEX_MAX_ROOT_SIZE=DC0000 + DEC_MAX_ROOT_SIZE=`echo "ibase=16; $HEX_MAX_ROOT_SIZE" | bc ` + KERNEL_SIZE=`ls -l $KERNEL | awk '{print $5}'` + if [ $KERNEL_SIZE -gt $DEC_MAX_KERN_SIZE ]; then + oefatal "Kernel too large at $KERNEL_SIZE bytes. Max is $DEC_MAX_KERN_SIZE." + exit 1 + fi + ROOT_SIZE=`ls -l $ROOTFS | awk '{print $5}'` + if [ $ROOT_SIZE -gt $DEC_MAX_ROOT_SIZE ]; then + oefatal "Rootfs is too large at $ROOT_SIZE bytes. Max is $DEC_MAX_ROOT_SIZE." + exit 1 + fi + PAD_SIZE=`echo "$DEC_MAX_KERN_SIZE - $KERNEL_SIZE" | bc ` + dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null + cat $KERNEL $PADFILE $ROOTFS > $OUTPUT + rm -f $PADFILE + ls -l $OUTPUT +} diff --git a/classes/turbostation-image.bbclass b/classes/turbostation-image.bbclass new file mode 100644 index 0000000000..d82e3996d5 --- /dev/null +++ b/classes/turbostation-image.bbclass @@ -0,0 +1,35 @@ +EXTRA_IMAGECMD = "--big-endian" +ERASEBLOCK_SIZE = "0x20000" +IMAGE_FSTYPES = "jffs2" +IMAGE_POSTPROCESS_COMMAND += '${MACHINE}_pack_image;' + +turbostation_pack_image() { + # find latest kernel + KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/uImage* | tail -1` + if [ -z "$KERNEL" ]; then + oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Bitbake linux-turbostation to create one." + exit 1 + fi + ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 + OUTPUT=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flash.img + PADFILE=${DEPLOY_DIR_IMAGE}/padfile.zzz + HEX_MAX_KERN_SIZE=200000 + DEC_MAX_KERN_SIZE=`echo "ibase=16; $HEX_MAX_KERN_SIZE" | bc ` + HEX_MAX_ROOT_SIZE=D00000 + DEC_MAX_ROOT_SIZE=`echo "ibase=16; $HEX_MAX_ROOT_SIZE" | bc ` + KERNEL_SIZE=`ls -l $KERNEL | awk '{print $5}'` + if [ $KERNEL_SIZE -gt $DEC_MAX_KERN_SIZE ]; then + oefatal "Kernel too large at $KERNEL_SIZE bytes. Max is $DEC_MAX_KERN_SIZE." + exit 1 + fi + ROOT_SIZE=`ls -l $ROOTFS | awk '{print $5}'` + if [ $ROOT_SIZE -gt $DEC_MAX_ROOT_SIZE ]; then + oefatal "Rootfs is too large at $ROOT_SIZE bytes. Max is $DEC_MAX_ROOT_SIZE." + exit 1 + fi + PAD_SIZE=`echo "$DEC_MAX_KERN_SIZE - $KERNEL_SIZE" | bc ` + dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null + cat $KERNEL $PADFILE $ROOTFS > $OUTPUT + rm -f $PADFILE + ls -l $OUTPUT +} -- cgit v1.2.3 From cf2e14f1d29dfc2fdcbd0302f94c816b1b927d49 Mon Sep 17 00:00:00 2001 From: Justin Patrin Date: Mon, 19 Mar 2007 05:12:25 +0000 Subject: e.bbclass: remove include hack, add -dev package --- classes/e.bbclass | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'classes') diff --git a/classes/e.bbclass b/classes/e.bbclass index f20c1f8b60..59f2771027 100644 --- a/classes/e.bbclass +++ b/classes/e.bbclass @@ -22,11 +22,12 @@ export ESMART_CONFIG = "${STAGING_BINDIR_CROSS}/esmart-config" export FREETYPE_CONFIG = "${STAGING_BINDIR_CROSS}/freetype-config" export IMLIB2_CONFIG = "${STAGING_BINDIR_CROSS}/imlib2-config" -do_compile_prepend() { - find ${S} -name Makefile | xargs sed -i 's:/usr/include:${STAGING_INCDIR}:' - find ${S} -name Makefile | xargs sed -i 's:/usr/X11R6/include:${STAGING_INCDIR}:' -} +#do_compile_prepend() { +# find ${S} -name Makefile | xargs sed -i 's:/usr/include:${STAGING_INCDIR}:' +# find ${S} -name Makefile | xargs sed -i 's:/usr/X11R6/include:${STAGING_INCDIR}:' +#} -PACKAGES = "${PN}-dbg ${PN} ${PN}-themes" +PACKAGES = "${PN}-dbg ${PN} ${PN}-themes ${PN}-dev" FILES_${PN} = "${libdir}/lib*.so*" FILES_${PN}-themes = "${datadir}/${PN}/themes ${datadir}/${PN}/data ${datadir}/${PN}/fonts ${datadir}/${PN}/pointers ${datadir}/${PN}/images ${datadir}/${PN}/users ${datadir}/${PN}/images ${datadir}/${PN}/styles" +FILES_${PN}-dev += "${includedir}" \ No newline at end of file -- cgit v1.2.3 From a36eda03cab7dcd78872e03077dddca2aac3499c Mon Sep 17 00:00:00 2001 From: Oyvind Repvik Date: Tue, 20 Mar 2007 19:42:53 +0000 Subject: n2100, turbostation, linkstation: Move machine-stuff out of classes --- classes/lsppchd-image.bbclass | 4 +++- classes/lsppchg-image.bbclass | 4 +++- classes/n2100-image.bbclass | 6 ------ classes/turbostation-image.bbclass | 5 ----- 4 files changed, 6 insertions(+), 13 deletions(-) (limited to 'classes') diff --git a/classes/lsppchd-image.bbclass b/classes/lsppchd-image.bbclass index da280551d4..6aab20127a 100644 --- a/classes/lsppchd-image.bbclass +++ b/classes/lsppchd-image.bbclass @@ -1 +1,3 @@ -IMAGE_POSTPROCESS_COMMAND += "" +lsppchd_pack_image() { +: +} \ No newline at end of file diff --git a/classes/lsppchg-image.bbclass b/classes/lsppchg-image.bbclass index da280551d4..5d9da87c7d 100644 --- a/classes/lsppchg-image.bbclass +++ b/classes/lsppchg-image.bbclass @@ -1 +1,3 @@ -IMAGE_POSTPROCESS_COMMAND += "" +lsppchg_pack_image() { +: +} \ No newline at end of file diff --git a/classes/n2100-image.bbclass b/classes/n2100-image.bbclass index 811b1d37b7..519be213d5 100644 --- a/classes/n2100-image.bbclass +++ b/classes/n2100-image.bbclass @@ -1,9 +1,3 @@ -DEPENDS += "openssl-native" -EXTRA_IMAGECMD = "--little-endian" -ERASEBLOCK_SIZE = "0x20000" -IMAGE_FSTYPES = "jffs2" -IMAGE_POSTPROCESS_COMMAND += '${MACHINE}_pack_image;' - n2100_pack_image() { # find latest kernel KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/zImage* | tail -1` diff --git a/classes/turbostation-image.bbclass b/classes/turbostation-image.bbclass index d82e3996d5..e61ffc825b 100644 --- a/classes/turbostation-image.bbclass +++ b/classes/turbostation-image.bbclass @@ -1,8 +1,3 @@ -EXTRA_IMAGECMD = "--big-endian" -ERASEBLOCK_SIZE = "0x20000" -IMAGE_FSTYPES = "jffs2" -IMAGE_POSTPROCESS_COMMAND += '${MACHINE}_pack_image;' - turbostation_pack_image() { # find latest kernel KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/uImage* | tail -1` -- cgit v1.2.3 From 7263517b3939ba055d443a0ecbaf5ef9a3e91c38 Mon Sep 17 00:00:00 2001 From: Oyvind Repvik Date: Wed, 21 Mar 2007 10:36:45 +0000 Subject: storcenter: Add storcenter-image.bbclass --- classes/storcenter-image.bbclass | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 classes/storcenter-image.bbclass (limited to 'classes') diff --git a/classes/storcenter-image.bbclass b/classes/storcenter-image.bbclass new file mode 100644 index 0000000000..de77f1b417 --- /dev/null +++ b/classes/storcenter-image.bbclass @@ -0,0 +1,30 @@ +storcenter_pack_image() { + # find latest kernel + KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/uImage* | tail -1` + if [ -z "$KERNEL" ]; then + oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Bitbake linux-storcenter to create one." + exit 1 + fi + ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 + OUTPUT=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flash.img + PADFILE=${DEPLOY_DIR_IMAGE}/padfile.zzz + HEX_MAX_KERN_SIZE=170000 + DEC_MAX_KERN_SIZE=`echo "ibase=16; $HEX_MAX_KERN_SIZE" | bc ` + HEX_MAX_ROOT_SIZE=590000 + DEC_MAX_ROOT_SIZE=`echo "ibase=16; $HEX_MAX_ROOT_SIZE" | bc ` + KERNEL_SIZE=`ls -l $KERNEL | awk '{print $5}'` + if [ $KERNEL_SIZE -gt $DEC_MAX_KERN_SIZE ]; then + oefatal "Kernel too large at $KERNEL_SIZE bytes. Max is $DEC_MAX_KERN_SIZE." + exit 1 + fi + ROOT_SIZE=`ls -l $ROOTFS | awk '{print $5}'` + if [ $ROOT_SIZE -gt $DEC_MAX_ROOT_SIZE ]; then + oefatal "Rootfs is too large at $ROOT_SIZE bytes. Max is $DEC_MAX_ROOT_SIZE." + exit 1 + fi + PAD_SIZE=`echo "$DEC_MAX_KERN_SIZE - $KERNEL_SIZE" | bc ` + dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null + cat $KERNEL $PADFILE $ROOTFS > $OUTPUT + rm -f $PADFILE + ls -l $OUTPUT +} -- cgit v1.2.3 From a11b05312d81a8ccabd4c8c93de0741d03df8190 Mon Sep 17 00:00:00 2001 From: Leon Woestenberg Date: Sat, 24 Mar 2007 10:54:11 +0000 Subject: image.bbclass: Removed wildcard rm as it broke building multiple rootfs image types. --- classes/image.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/image.bbclass b/classes/image.bbclass index 5055b5b987..4f870915d0 100644 --- a/classes/image.bbclass +++ b/classes/image.bbclass @@ -93,7 +93,7 @@ fakeroot do_rootfs () { fi cd ${DEPLOY_DIR_IMAGE}/ - rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.* + rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type ln -s ${IMAGE_NAME}.rootfs.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type done -- cgit v1.2.3 From 80e03c31786137c4d72eed1da9f7da7b70434929 Mon Sep 17 00:00:00 2001 From: Rod Whitby Date: Sun, 25 Mar 2007 05:15:37 +0000 Subject: nslu2-image.bbclass: Made operation conditional upon an nslu2 override. --- classes/nslu2-image.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/nslu2-image.bbclass b/classes/nslu2-image.bbclass index e1af34fa57..14bf989055 100644 --- a/classes/nslu2-image.bbclass +++ b/classes/nslu2-image.bbclass @@ -16,5 +16,5 @@ nslu2_pack_image () { rm -rf ${DEPLOY_DIR_IMAGE}/slug } -EXTRA_IMAGEDEPENDS += 'slugimage-native nslu2-linksys-firmware ixp4xx-npe upslug2-native' -IMAGE_POSTPROCESS_COMMAND += "nslu2_pack_image; " +EXTRA_IMAGEDEPENDS_nslu2 += 'slugimage-native nslu2-linksys-firmware ixp4xx-npe upslug2-native' +IMAGE_POSTPROCESS_COMMAND_nslu2 += "nslu2_pack_image; " -- cgit v1.2.3 From 48c9a98908284963902fc29b4c47aed668bd5432 Mon Sep 17 00:00:00 2001 From: Oyvind Repvik Date: Mon, 26 Mar 2007 23:07:52 +0000 Subject: update n2100, lsppchg and lspphcd images --- classes/lsppchd-image.bbclass | 7 ++++++- classes/lsppchg-image.bbclass | 7 ++++++- classes/n2100-image.bbclass | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/lsppchd-image.bbclass b/classes/lsppchd-image.bbclass index 6aab20127a..bb150c7e15 100644 --- a/classes/lsppchd-image.bbclass +++ b/classes/lsppchd-image.bbclass @@ -1,3 +1,8 @@ +IMAGE_PREPROCESS_COMMAND_lsppchd += "export KPATH=`ls -tr ${IMAGE_ROOTFS}/boot/uImage-* | tail -1`; ln -sf /boot/${KPATH##*/} ${IMAGE_ROOTFS}/boot/uImage;" +IMAGE_PREPROCESS_COMMAND_lsppchd += "sed -i -es,^id:5:initdefault:,id:3:initdefault:, ${IMAGE_ROOTFS}/etc/inittab;" +IMAGE_PREPROCESS_COMMAND_lsppchd += "sed -i -es,^root::0,root:BTMzOOAQfESg6:0, ${IMAGE_ROOTFS}/etc/passwd;" +IMAGE_PREPROCESS_COMMAND_lsppchd += "sed -i -es,^VERBOSE=no,VERBOSE=very, ${IMAGE_ROOTFS}/etc/default/rcS;" + lsppchd_pack_image() { : -} \ No newline at end of file +} diff --git a/classes/lsppchg-image.bbclass b/classes/lsppchg-image.bbclass index 5d9da87c7d..9ad0801fe3 100644 --- a/classes/lsppchg-image.bbclass +++ b/classes/lsppchg-image.bbclass @@ -1,3 +1,8 @@ +IMAGE_PREPROCESS_COMMAND_lsppchg += "export KPATH=`ls -tr ${IMAGE_ROOTFS}/boot/uImage-* | tail -1`; ln -sf /boot/${KPATH##*/} ${IMAGE_ROOTFS}/boot/uImage;" +IMAGE_PREPROCESS_COMMAND_lsppchg += "sed -i -es,^id:5:initdefault:,id:3:initdefault:, ${IMAGE_ROOTFS}/etc/inittab;" +IMAGE_PREPROCESS_COMMAND_lsppchg += "sed -i -es,^root::0,root:BTMzOOAQfESg6:0, ${IMAGE_ROOTFS}/etc/passwd;" +IMAGE_PREPROCESS_COMMAND_lsppchg += "sed -i -es,^VERBOSE=no,VERBOSE=very, ${IMAGE_ROOTFS}/etc/default/rcS;" + lsppchg_pack_image() { : -} \ No newline at end of file +} diff --git a/classes/n2100-image.bbclass b/classes/n2100-image.bbclass index 519be213d5..393efae7e1 100644 --- a/classes/n2100-image.bbclass +++ b/classes/n2100-image.bbclass @@ -26,5 +26,5 @@ n2100_pack_image() { dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null cat $KERNEL $PADFILE $ROOTFS > $OUTPUT rm -f $PADFILE - ls -l $OUTPUT + ls -l $OUTPUT } -- cgit v1.2.3 From 0bb019850b4d6e84a81c4b06485280a02e1b5a72 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Thu, 29 Mar 2007 12:48:15 +0000 Subject: package_ipk.bbclass: add epoch support --- classes/package_ipk.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index 70bcdf6b7f..19c082d978 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -142,7 +142,11 @@ python do_package_ipk () { raise bb.build.FuncFailed("unable to open control file for writing.") fields = [] - fields.append(["Version: %s-%s\n", ['PV', 'PR']]) + pe = bb.data.getVar('PE', d, 1) + if pe and int(pe) > 0: + fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']]) + else: + fields.append(["Version: %s-%s\n", ['PV', 'PR']]) fields.append(["Description: %s\n", ['DESCRIPTION']]) fields.append(["Section: %s\n", ['SECTION']]) fields.append(["Priority: %s\n", ['PRIORITY']]) -- cgit v1.2.3 From fa30c973cc72f69f469bfcffb210069ee443351b Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Thu, 29 Mar 2007 12:50:18 +0000 Subject: package.bbclass: added support for private libraries (used only in package) - if package contain libraries which are not used outside then add PRIVATE_LIBS variable with names of them to not generate shlibs for them. --- classes/package.bbclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/package.bbclass b/classes/package.bbclass index 07fdb7f890..19c206ae5e 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -573,6 +573,7 @@ python package_do_shlibs() { bb.mkdirhier(shlibs_dir) needed = {} + private_libs = bb.data.getVar('PRIVATE_LIBS', d, 1) for pkg in packages.split(): needs_ldconfig = False bb.debug(2, "calculating shlib provides for %s" % pkg) @@ -596,7 +597,9 @@ python package_do_shlibs() { needed[pkg].append(m.group(1)) m = re.match("\s+SONAME\s+([^\s]*)", l) if m and not m.group(1) in sonames: - sonames.append(m.group(1)) + # if library is private (only used by package) then do not build shlib for it + if private_libs == '' or -1 == private_libs.find(m.group(1)): + sonames.append(m.group(1)) if m and libdir_re.match(root): needs_ldconfig = True shlibs_file = os.path.join(shlibs_dir, pkg + ".list") -- cgit v1.2.3 From 7ca9b39e2634a00c8af78f84f14fca369d946811 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Thu, 29 Mar 2007 12:57:43 +0000 Subject: package_deb.bbclass: add epoch support --- classes/package_deb.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass index 9697426d5d..388f9819bd 100644 --- a/classes/package_deb.bbclass +++ b/classes/package_deb.bbclass @@ -138,7 +138,11 @@ python do_package_deb () { raise bb.build.FuncFailed("unable to open control file for writing.") fields = [] - fields.append(["Version: %s-%s\n", ['PV', 'PR']]) + pe = bb.data.getVar('PE', d, 1) + if pe and int(pe) > 0: + fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']]) + else: + fields.append(["Version: %s-%s\n", ['PV', 'PR']]) fields.append(["Description: %s\n", ['DESCRIPTION']]) fields.append(["Section: %s\n", ['SECTION']]) fields.append(["Priority: %s\n", ['PRIORITY']]) -- cgit v1.2.3 From 5c164a27251aa8be7cbb8916a13919052387c3bd Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Thu, 29 Mar 2007 13:25:19 +0000 Subject: package.bbclass: fix build problem related to private libs --- classes/package.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/package.bbclass b/classes/package.bbclass index 19c206ae5e..3e80b2b31c 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -598,7 +598,7 @@ python package_do_shlibs() { m = re.match("\s+SONAME\s+([^\s]*)", l) if m and not m.group(1) in sonames: # if library is private (only used by package) then do not build shlib for it - if private_libs == '' or -1 == private_libs.find(m.group(1)): + if not private_libs or -1 == private_libs.find(m.group(1)): sonames.append(m.group(1)) if m and libdir_re.match(root): needs_ldconfig = True -- cgit v1.2.3 From 53b0ca70e6584fff074ade5bff2863a1bc3c7840 Mon Sep 17 00:00:00 2001 From: Oyvind Repvik Date: Fri, 30 Mar 2007 16:15:03 +0000 Subject: n2100, turbostation, lsppc: Update image --- classes/lsppchd-image.bbclass | 2 ++ classes/lsppchg-image.bbclass | 2 ++ classes/n2100-image.bbclass | 2 ++ classes/turbostation-image.bbclass | 2 ++ 4 files changed, 8 insertions(+) (limited to 'classes') diff --git a/classes/lsppchd-image.bbclass b/classes/lsppchd-image.bbclass index bb150c7e15..cb13222d64 100644 --- a/classes/lsppchd-image.bbclass +++ b/classes/lsppchd-image.bbclass @@ -6,3 +6,5 @@ IMAGE_PREPROCESS_COMMAND_lsppchd += "sed -i -es,^VERBOSE=no,VERBOSE=very, ${IMAG lsppchd_pack_image() { : } + +IMAGE_POSTPROCESS_COMMAND += "lsppchd_pack_image; " diff --git a/classes/lsppchg-image.bbclass b/classes/lsppchg-image.bbclass index 9ad0801fe3..553414224d 100644 --- a/classes/lsppchg-image.bbclass +++ b/classes/lsppchg-image.bbclass @@ -6,3 +6,5 @@ IMAGE_PREPROCESS_COMMAND_lsppchg += "sed -i -es,^VERBOSE=no,VERBOSE=very, ${IMAG lsppchg_pack_image() { : } + +IMAGE_POSTPROCESS_COMMAND += "lsppchg_pack_image; " diff --git a/classes/n2100-image.bbclass b/classes/n2100-image.bbclass index 393efae7e1..bc6c12e1fb 100644 --- a/classes/n2100-image.bbclass +++ b/classes/n2100-image.bbclass @@ -28,3 +28,5 @@ n2100_pack_image() { rm -f $PADFILE ls -l $OUTPUT } + +IMAGE_POSTPROCESS_COMMAND += "n2100_pack_image; " diff --git a/classes/turbostation-image.bbclass b/classes/turbostation-image.bbclass index e61ffc825b..5a0768c687 100644 --- a/classes/turbostation-image.bbclass +++ b/classes/turbostation-image.bbclass @@ -28,3 +28,5 @@ turbostation_pack_image() { rm -f $PADFILE ls -l $OUTPUT } + +IMAGE_POSTPROCESS_COMMAND += "turbostation_pack_image; " -- cgit v1.2.3 From 74f43656a25639eac79ee7d7e373dfc8c0d92126 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 30 Mar 2007 17:48:05 +0000 Subject: opie.bbclass, palmtop.bbclass: Set FILES_* in palmtop.bbclass, so even opie bootstrap libraries use them. Also, to not neat-pick which files go into FILES_${PN}, just change default order of packages. --- classes/opie.bbclass | 4 ---- classes/palmtop.bbclass | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'classes') diff --git a/classes/opie.bbclass b/classes/opie.bbclass index 92cde5487b..915de890cf 100644 --- a/classes/opie.bbclass +++ b/classes/opie.bbclass @@ -19,10 +19,6 @@ OPIE_CVS_PV ?= "1.2.2+cvs${SRCDATE}" DEPENDS_prepend = "${@["libopie2 ", ""][(bb.data.getVar('PN', d, 1) == 'libopie2')]}" -FILES_${PN}-dbg += " ${palmtopdir}/lib/.debug \ - ${palmtopdir}/bin/.debug \ - ${palmtopdir}/plugins/*/.debug " - # to be consistent, put all targets into workdir # NOTE: leave one space at the end, other files are expecting that EXTRA_QMAKEVARS_POST += "DESTDIR=${S} " diff --git a/classes/palmtop.bbclass b/classes/palmtop.bbclass index b4bd21ab25..39b9bd2b60 100644 --- a/classes/palmtop.bbclass +++ b/classes/palmtop.bbclass @@ -17,4 +17,9 @@ EXTRA_QMAKEVARS_POST += '${@base_conditional("PALMTOP_USE_MULTITHREADED_QT", "ye EXTRA_QMAKEVARS_POST += "${@["LIBS+=-lqpe ", ""][(bb.data.getVar('PN', d, 1) == 'libqpe-opie')]}" DEPENDS_prepend = "${@["virtual/libqpe1 uicmoc-native ", ""][(bb.data.getVar('PN', d, 1) == 'libqpe-opie')]}" -FILES_${PN} = "${palmtopdir}" +PACKAGES = "${PN}-dbg ${PN}-dev ${PN} ${PN}-doc ${PN}-locale" +FILES_${PN} = " ${palmtopdir} " +FILES_${PN}-dev += " ${palmtopdir}/lib/lib*.so " +FILES_${PN}-dbg += " ${palmtopdir}/lib/.debug \ + ${palmtopdir}/bin/.debug \ + ${palmtopdir}/plugins/*/.debug " -- cgit v1.2.3 From f4a53b765a6801f836586b5ee662b5f9392dcfab Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 31 Mar 2007 15:57:22 +0000 Subject: classes/patch.bbclass: Make sure to raise func_failed on any exception from within Import non existing patches raised a IOError by the md5sum method which was not catched at all and lead bitbake to exit due an unhandled exception. This is bad for all autobuilders. --- classes/patch.bbclass | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'classes') diff --git a/classes/patch.bbclass b/classes/patch.bbclass index 0a7b94cffc..07d18470f7 100644 --- a/classes/patch.bbclass +++ b/classes/patch.bbclass @@ -3,10 +3,20 @@ def patch_init(d): import os, sys + class NotFoundError(Exception): + def __init__(self, path): + self.path = path + def __str__(self): + return "Error: %s not found." % self.path + def md5sum(fname): import md5, sys - f = file(fname, 'rb') + try: + f = file(fname, 'rb') + except IOError: + raise NotFoundError(fname) + m = md5.new() while True: d = f.read(8096) @@ -24,11 +34,6 @@ def patch_init(d): def __str__(self): return "Command Error: exit status: %d Output:\n%s" % (self.status, self.output) - class NotFoundError(Exception): - def __init__(self, path): - self.path = path - def __str__(self): - return "Error: %s not found." % self.path def runcmd(args, dir = None): import commands @@ -482,7 +487,7 @@ python patch_do_patch() { bb.note("Applying patch '%s'" % pname) try: patchset.Import({"file":unpacked, "remote":url, "strippath": pnum}, True) - except NotFoundError: + except: import sys raise bb.build.FuncFailed(str(sys.exc_value)) resolver.Resolve() -- cgit v1.2.3 From f995e0a4f5a60f4a1b80449d8eb7f64d0efebfef Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 31 Mar 2007 20:15:44 +0000 Subject: classes/base.bbclass: Add checksum.py code to verify md5/sha256 sums on do_fetch This code uses the checksum.py from contrib/qa/checksum to verify md5sum and sha256 on do_fetch task. This code would even allow to checksum certain local patches. --- classes/base.bbclass | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 53139e19fa..1f1766cf11 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -10,6 +10,60 @@ def base_path_join(a, *p): path += '/' + b return path +# for MD5/SHA handling +def base_chk_load_parser(config_path): + import ConfigParser, os + parser = ConfigParser.ConfigParser() + if not len(parser.read(config_path)) == 1: + raise Exception("Can not open the '%s'" % config_path) + + return parser + +def base_chk_file(parser, pn, pv, src_uri, localpath): + import os + # Try PN-PV-SRC_URI first and then try PN-SRC_URI + # we rely on the get method to create errors + pn_pv_src = "%s-%s-%s" % (pn,pv,src_uri) + pn_src = "%s-%s" % (pn,src_uri) + if parser.has_section(pn_pv_src): + md5 = parser.get(pn_pv_src, "md5") + sha256 = parser.get(pn_pv_src, "sha256") + elif parser.has_section(pn_src): + md5 = parser.get(pn_src, "md5") + sha256 = parser.get(pn_src, "sha256") + else: + return False + #raise Exception("Can not find a section for '%s' '%s' and '%s'" % (pn,pv,src_uri)) + + # md5 and sha256 should be valid now + if not os.path.exists(localpath): + raise Exception("The path does not exist '%s'" % localpath) + + + # call md5(sum) and shasum + try: + md5pipe = os.popen('md5sum ' + localpath) + md5data = (md5pipe.readline().split() or [ "" ])[0] + md5pipe.close() + except OSError: + raise Exception("Executing md5sum failed") + + try: + shapipe = os.popen('shasum -a256 -p ' + localpath) + shadata = (shapipe.readline().split() or [ "" ])[0] + shapipe.close() + except OSError: + raise Exception("Executing shasum failed") + + if not md5 == md5data: + raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (md5, md5data)) + + if not sha256 == shadata: + raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256, shadata)) + + return True + + def base_dep_prepend(d): import bb; # @@ -402,6 +456,41 @@ python base_do_fetch() { except bb.fetch.FetchError: (type, value, traceback) = sys.exc_info() raise bb.build.FuncFailed("Fetch failed: %s" % value) + except bb.fetch.MD5SumError: + (type, value, traceback) = sys.exc_info() + raise bb.build.FuncFailed("MD5 failed: %s" % value) + except: + (type, value, traceback) = sys.exc_info() + raise bb.build.FuncFailed("Unknown fetch Error: %s" % value) + + + # Verify the SHA and MD5 sums we have in OE and check what do + # in + check_sum = bb.which(bb.data.getVar('BBPATH', d, True), "conf/checksums.ini") + if not check_sum: + bb.note("No conf/checksums.ini found, not checking checksums") + return + + try: + parser = base_chk_load_parser(ckeck_sum) + except: + bb.note("Creating the CheckSum parser failed") + return + + pv = bb.data.getVar('PV', d, True) + pn = bb.data.getVar('PN', d, True) + + # Check each URI + for url in src_uri.split(): + localpath = bb.fetch.localpath(url,localdata) + (type,host,path,_,_,_) = bb.decodeurl(url) + print type, host, path + uri = "%s://%s%s" % (type,host,path) + try: + if not base_chk_file(parser, pn, pv,uri, localpath): + bb.note("%s-%s-%s has no section, not checking URI" % pn,pv,uri) + except Exception, e: + raise bb.func.FuncFailed("Checksum of '%s' failed", uri) } addtask fetchall after do_fetch -- cgit v1.2.3 From 8e2d1b42f56902f87817efed2a8df169d31014a4 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 31 Mar 2007 20:31:20 +0000 Subject: classes/base.bbclass: Make the checksum code work and test it with file-native conf/checksums.ini: Provide an example on how this can be used --- classes/base.bbclass | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 1f1766cf11..880295fc30 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -12,15 +12,16 @@ def base_path_join(a, *p): # for MD5/SHA handling def base_chk_load_parser(config_path): - import ConfigParser, os + import ConfigParser, os, bb parser = ConfigParser.ConfigParser() if not len(parser.read(config_path)) == 1: + bb.note("Can not open the '%s' ini file" % config_path) raise Exception("Can not open the '%s'" % config_path) return parser def base_chk_file(parser, pn, pv, src_uri, localpath): - import os + import os, bb # Try PN-PV-SRC_URI first and then try PN-SRC_URI # we rely on the get method to create errors pn_pv_src = "%s-%s-%s" % (pn,pv,src_uri) @@ -37,6 +38,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): # md5 and sha256 should be valid now if not os.path.exists(localpath): + bb.note("The locapath does not exist '%s'" % localpath) raise Exception("The path does not exist '%s'" % localpath) @@ -56,9 +58,11 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): raise Exception("Executing shasum failed") if not md5 == md5data: + bb.note("The MD5Sums did not match. Wanted: '%s' and Got: '%s'" % (md5,md5data)) raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (md5, md5data)) if not sha256 == shadata: + bb.note("The SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256,shadata)) raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256, shadata)) return True @@ -472,7 +476,7 @@ python base_do_fetch() { return try: - parser = base_chk_load_parser(ckeck_sum) + parser = base_chk_load_parser(check_sum) except: bb.note("Creating the CheckSum parser failed") return @@ -484,13 +488,12 @@ python base_do_fetch() { for url in src_uri.split(): localpath = bb.fetch.localpath(url,localdata) (type,host,path,_,_,_) = bb.decodeurl(url) - print type, host, path uri = "%s://%s%s" % (type,host,path) try: - if not base_chk_file(parser, pn, pv,uri, localpath): - bb.note("%s-%s-%s has no section, not checking URI" % pn,pv,uri) - except Exception, e: - raise bb.func.FuncFailed("Checksum of '%s' failed", uri) + if not base_chk_file(parser, pn, pv,uri, localpath): + bb.note("%s-%s-%s has no section, not checking URI" % (pn,pv,uri)) + except Exception: + raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) } addtask fetchall after do_fetch -- cgit v1.2.3 From 5c87ad99c417011884ce00518eae54a082761427 Mon Sep 17 00:00:00 2001 From: Rod Whitby Date: Sat, 31 Mar 2007 04:19:30 +0000 Subject: insane.bbclass: Support armeb EABI. --- classes/insane.bbclass | 1 + 1 file changed, 1 insertion(+) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 1f20fa6614..e5a1cd03d4 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -59,6 +59,7 @@ def package_qa_get_machine_dict(): }, "linux-gnueabi" : { "arm" : (40, 0, 0, True, True), + "armeb" : (40, 0, 0, False, True), }, } -- cgit v1.2.3 From 3cb20b35af93a7b0df80cd0ae87704c73a8c57dc Mon Sep 17 00:00:00 2001 From: Stelios Koroneos Date: Sun, 1 Apr 2007 10:50:27 +0000 Subject: packages/perl/perl_5.8.7.bb: A set of patches to make perl usable on powerpc targets. Thanks to Jamie Lenahan for the help --- classes/cpan.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'classes') diff --git a/classes/cpan.bbclass b/classes/cpan.bbclass index 74bbebf882..a566f0fa42 100644 --- a/classes/cpan.bbclass +++ b/classes/cpan.bbclass @@ -26,6 +26,12 @@ cpan_do_compile () { if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" fi + + if test ${TARGET_ARCH} = "powerpc" ; then + OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" + fi + + oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS } -- cgit v1.2.3 From afc9dea14ffb67902060f32fda79290727b74bec Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sun, 1 Apr 2007 13:20:07 +0000 Subject: classes/base.bbclass: [ftp://ftp.trolltech.com/qt/source/qtopia-core-4.3.0beta.tar.gz] is good enough src_uri as section/groups are unique enough as well. Most of the time (almost always) scoping PN (or PN+PV) is not necessary and in this case the SRC_URI is good enough. Richard thank you for saying the obvious --- classes/base.bbclass | 3 +++ 1 file changed, 3 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 880295fc30..2ea5251609 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -32,6 +32,9 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): elif parser.has_section(pn_src): md5 = parser.get(pn_src, "md5") sha256 = parser.get(pn_src, "sha256") + elif parser.has_section(src_uri): + md5 = parser.get(src_uri, "md5") + sha256 = parser.get(src_uri, "sha256") else: return False #raise Exception("Can not find a section for '%s' '%s' and '%s'" % (pn,pv,src_uri)) -- cgit v1.2.3 From 9ac0b134bc70feb2aa31422df3e4360deebbcedd Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sun, 1 Apr 2007 17:26:11 +0000 Subject: classes/sanity.bblcass: Require shasum since base.bbclass is calling it --- classes/sanity.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index 958ab91fa6..580475a9af 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -86,7 +86,7 @@ def check_sanity(e): if not check_app_exists('${BUILD_PREFIX}g++', e.data): missing = missing + "C++ Compiler (${BUILD_PREFIX}g++)," - required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk" + required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk shasum" for util in required_utilities.split(): if not check_app_exists( util, e.data ): -- cgit v1.2.3 From 9b6d6f02b176f0080a7352876bd25d4dc3ad5d5c Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sun, 1 Apr 2007 17:31:33 +0000 Subject: classes/sanity.bbclass: md5sum is required as well --- classes/sanity.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index 580475a9af..edef2805d4 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -86,7 +86,7 @@ def check_sanity(e): if not check_app_exists('${BUILD_PREFIX}g++', e.data): missing = missing + "C++ Compiler (${BUILD_PREFIX}g++)," - required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk shasum" + required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk shasum md5sum" for util in required_utilities.split(): if not check_app_exists( util, e.data ): -- cgit v1.2.3 From 7870e6d52d38140b0789176e98aa658f8e52ed5a Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Sun, 1 Apr 2007 21:42:48 +0000 Subject: base.bbclass, sanity.bbclass: use sha256sum instead of shasum -a256 --- classes/base.bbclass | 2 +- classes/sanity.bbclass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 2ea5251609..6f8196cf80 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -54,7 +54,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): raise Exception("Executing md5sum failed") try: - shapipe = os.popen('shasum -a256 -p ' + localpath) + shapipe = os.popen('sha256sum -b ' + localpath) shadata = (shapipe.readline().split() or [ "" ])[0] shapipe.close() except OSError: diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index edef2805d4..f38644b6cb 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -86,7 +86,7 @@ def check_sanity(e): if not check_app_exists('${BUILD_PREFIX}g++', e.data): missing = missing + "C++ Compiler (${BUILD_PREFIX}g++)," - required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk shasum md5sum" + required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk sha256sum md5sum" for util in required_utilities.split(): if not check_app_exists( util, e.data ): -- cgit v1.2.3 From 6c93f6c3ad999372433fd112bb6339957f1d2d09 Mon Sep 17 00:00:00 2001 From: Michael Lauer Date: Mon, 2 Apr 2007 15:52:30 +0000 Subject: classes/openmoko-base.bbclass: add support for inputmethods --- classes/openmoko-base.bbclass | 1 + 1 file changed, 1 insertion(+) (limited to 'classes') diff --git a/classes/openmoko-base.bbclass b/classes/openmoko-base.bbclass index 35243c9752..8643daa7a4 100644 --- a/classes/openmoko-base.bbclass +++ b/classes/openmoko-base.bbclass @@ -9,6 +9,7 @@ def openmoko_base_get_subdir(d): if section == 'base' or section == 'libs': return "" elif section in 'apps tools pim'.split(): return "applications" elif section == "panel-plugin": return "panel-plugins" + elif section == "inputmethods": return "inputmethods" else: return section SUBDIR = "${@openmoko_base_get_subdir(d)}" -- cgit v1.2.3 From 745c67ffc5c79fe08cd5460ded6317d17517799a Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Mon, 2 Apr 2007 20:42:15 +0000 Subject: classes/base.bbclass: place shasum-native as the first package to build classes/base.bbclass: Make sure shasum-native does not depend on quilt classes/sanity.bbclass: No need to require sha256sum as we use oe_sha256sum packages/shasum: Change the name, make the -native version not have any deps --- classes/base.bbclass | 19 +++++++++++++------ classes/sanity.bbclass | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 6f8196cf80..6011790ebe 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -20,7 +20,7 @@ def base_chk_load_parser(config_path): return parser -def base_chk_file(parser, pn, pv, src_uri, localpath): +def base_chk_file(parser, pn, pv, src_uri, localpath, data): import os, bb # Try PN-PV-SRC_URI first and then try PN-SRC_URI # we rely on the get method to create errors @@ -54,7 +54,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath): raise Exception("Executing md5sum failed") try: - shapipe = os.popen('sha256sum -b ' + localpath) + shapipe = os.popen('PATH=%s oe_sha256sum %s' % (bb.data.getVar('PATH', data, True), localpath)) shadata = (shapipe.readline().split() or [ "" ])[0] shapipe.close() except OSError: @@ -78,16 +78,22 @@ def base_dep_prepend(d): # the case where host == build == target, for now we don't work in # that case though. # - deps = "" + if bb.data.getVar('PN', d, True) == "shasum-native": + deps = "" + else: + deps = "shasum-native " + + # INHIBIT_PATCH_TOOL don't apply the patch tool dependency + inhibit_patch = (bb.data.getVar("INHIBIT_PATCH_TOOL", d, True) == "1") or False # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not # we need that built is the responsibility of the patch function / class, not # the application. patchdeps = bb.data.getVar("PATCHTOOL", d, 1) - if patchdeps: + if patchdeps and not inhibit_patch: patchdeps = "%s-native" % patchdeps if not patchdeps in bb.data.getVar("PROVIDES", d, 1): - deps = patchdeps + deps += patchdeps if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d): if (bb.data.getVar('HOST_SYS', d, 1) != @@ -439,6 +445,7 @@ python base_do_mrproper() { addtask fetch do_fetch[dirs] = "${DL_DIR}" +do_fetch[depends] = "shasum-native:do_populate_staging" python base_do_fetch() { import sys @@ -493,7 +500,7 @@ python base_do_fetch() { (type,host,path,_,_,_) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) try: - if not base_chk_file(parser, pn, pv,uri, localpath): + if not base_chk_file(parser, pn, pv,uri, localpath, d): bb.note("%s-%s-%s has no section, not checking URI" % (pn,pv,uri)) except Exception: raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index f38644b6cb..ec73e0cab7 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -86,7 +86,7 @@ def check_sanity(e): if not check_app_exists('${BUILD_PREFIX}g++', e.data): missing = missing + "C++ Compiler (${BUILD_PREFIX}g++)," - required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk sha256sum md5sum" + required_utilities = "patch diffstat texi2html makeinfo cvs svn git bzip2 tar gzip gawk md5sum" for util in required_utilities.split(): if not check_app_exists( util, e.data ): -- cgit v1.2.3 From cd0eba2a4ed708a7439b36b3b2f0fef0eb451da2 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 4 Apr 2007 23:06:24 +0000 Subject: meta packages: Create a new class, clean up the code and add correct dependencies for bitbake 1.8 --- classes/meta.bbclass | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 classes/meta.bbclass (limited to 'classes') diff --git a/classes/meta.bbclass b/classes/meta.bbclass new file mode 100644 index 0000000000..f7d41eec26 --- /dev/null +++ b/classes/meta.bbclass @@ -0,0 +1,5 @@ + +PACKAGES = "" + +BUILD_ALL_DEPS = "1" +do_build[recrdeptask] = "do_build" \ No newline at end of file -- cgit v1.2.3 From 6a7674dd3d52c00063b5ec4468a75bfa05ef22bd Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 6 Apr 2007 13:30:27 +0000 Subject: insane.bbclass: short circuit architecture check for cross packages (e.g. gcc-cross-sdk) --- classes/insane.bbclass | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index e5a1cd03d4..21348a8bb6 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -255,6 +255,10 @@ def package_qa_check_arch(path,name,d): import bb, os target_os = bb.data.getVar('TARGET_OS', d, True) target_arch = bb.data.getVar('TARGET_ARCH', d, True) + + # FIXME: Cross package confuse this check, so just skip them + if bb.data.inherits_class('cross', d): + return True # avoid following links to /usr/bin (e.g. on udev builds) # we will check the files pointed to anyway... -- cgit v1.2.3 From cd59d6f7582d4ba5c7bce31ec46da02ee2d9c77f Mon Sep 17 00:00:00 2001 From: Rod Whitby Date: Sat, 7 Apr 2007 22:25:12 +0000 Subject: dsmg600-image.bbclass, nas100d-image.bbclass, nslu2le.conf, nslu2be.conf: Added support for building dsmg600 and nas100d images back into the nslu2 machine configuration. --- classes/dsmg600-image.bbclass | 3 ++- classes/nas100d-image.bbclass | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'classes') diff --git a/classes/dsmg600-image.bbclass b/classes/dsmg600-image.bbclass index 6920fe5dbd..5ccf49267b 100644 --- a/classes/dsmg600-image.bbclass +++ b/classes/dsmg600-image.bbclass @@ -16,4 +16,5 @@ dsmg600_pack_image () { rm -rf ${DEPLOY_DIR_IMAGE}/firmupgrade } -IMAGE_POSTPROCESS_COMMAND += "dsmg600_pack_image; " +# dsmg600 is not a separate machine - use the nslu2 machine override. +IMAGE_POSTPROCESS_COMMAND_nslu2 += "dsmg600_pack_image; " diff --git a/classes/nas100d-image.bbclass b/classes/nas100d-image.bbclass index 0d48ebd476..1150116bdb 100644 --- a/classes/nas100d-image.bbclass +++ b/classes/nas100d-image.bbclass @@ -16,4 +16,5 @@ nas100d_pack_image () { rm -rf ${DEPLOY_DIR_IMAGE}/firmupgrade } -IMAGE_POSTPROCESS_COMMAND += "nas100d_pack_image; " +# nas100d is not a separate machine - use the nslu2 machine override. +IMAGE_POSTPROCESS_COMMAND_nslu2 += "nas100d_pack_image; " -- cgit v1.2.3 From 161e164dd087fecf82614aa7f5515f7d46b3ebad Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 9 Apr 2007 21:17:21 +0000 Subject: kernel.bbclass: Add kernel-base package which kernel modules depend on instead of kernel-image. This allows machines to specify that the kernel-image shouldn't be included in a default rootfs, without needing kernel-image to be empty. Set RDEPENDS_kernel-base_MACHINE = for machines that need this as per a discussion on the mailing list. --- classes/kernel.bbclass | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 2434ca1f0a..4cc3784b6f 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -169,13 +169,18 @@ inherit cml1 EXPORT_FUNCTIONS do_compile do_install do_stage do_configure -PACKAGES = "kernel kernel-image kernel-dev" +# kernel-base becomes kernel-${KERNEL_VERSION} +# kernel-image becomes kernel-image-${KERNEL_VERISON} +PACKAGES = "kernel kernel-base kernel-image kernel-dev" FILES = "" FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" FILES_kernel-dev = "/boot/System.map* /boot/config*" -RDEPENDS_kernel = "kernel-image-${KERNEL_VERSION}" +RDEPENDS_kernel = "kernel-base" +RDEPENDS_kernel-base = "kernel-image" PKG_kernel-image = "kernel-image-${KERNEL_VERSION}" +PKG_kernel-base = "kernel-${KERNEL_VERSION}" ALLOW_EMPTY_kernel = "1" +ALLOW_EMPTY_kernel-base = "1" ALLOW_EMPTY_kernel-image = "1" pkg_postinst_kernel-image () { @@ -362,13 +367,13 @@ python populate_packages_prepend () { postinst = bb.data.getVar('pkg_postinst_modules', d, 1) postrm = bb.data.getVar('pkg_postrm_modules', d, 1) - do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_p