summaryrefslogtreecommitdiff
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2010-05-05 16:17:07 +0100
committerJoshua Lock <josh@linux.intel.com>2010-05-06 12:53:16 +0100
commite7fa3529f32f4037fe122699e0d7f3789a871834 (patch)
treed5a8d407a5b0ac84a6a69f5aaff76e114d563da6 /meta/classes/insane.bbclass
parentac023d775b651c9b1e28a7a725e72949fe54ad47 (diff)
downloadopenembedded-core-e7fa3529f32f4037fe122699e0d7f3789a871834.tar.gz
openembedded-core-e7fa3529f32f4037fe122699e0d7f3789a871834.tar.bz2
openembedded-core-e7fa3529f32f4037fe122699e0d7f3789a871834.zip
Update classes to use lib/oe
Adapt modifications from upstream to make Poky classes use lib/oe for the common Python functionality. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass81
1 files changed, 0 insertions, 81 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index d8cc679283..6d82e4df88 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -75,87 +75,6 @@ def package_qa_get_machine_dict():
}
-# factory for a class, embedded in a method
-def package_qa_get_elf(path, bits32):
- class ELFFile:
- EI_NIDENT = 16
-
- EI_CLASS = 4
- EI_DATA = 5
- EI_VERSION = 6
- EI_OSABI = 7
- EI_ABIVERSION = 8
-
- # possible values for EI_CLASS
- ELFCLASSNONE = 0
- ELFCLASS32 = 1
- ELFCLASS64 = 2
-
- # possible value for EI_VERSION
- EV_CURRENT = 1
-
- # possible values for EI_DATA
- ELFDATANONE = 0
- ELFDATA2LSB = 1
- ELFDATA2MSB = 2
-
- def my_assert(self, expectation, result):
- if not expectation == result:
- #print "'%x','%x' %s" % (ord(expectation), ord(result), self.name)
- raise Exception("This does not work as expected")
-
- def __init__(self, name):
- self.name = name
-
- def open(self):
- self.file = file(self.name, "r")
- self.data = self.file.read(ELFFile.EI_NIDENT+4)
-
- self.my_assert(len(self.data), ELFFile.EI_NIDENT+4)
- self.my_assert(self.data[0], chr(0x7f) )
- self.my_assert(self.data[1], 'E')
- self.my_assert(self.data[2], 'L')
- self.my_assert(self.data[3], 'F')
- if bits32 :
- self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS32))
- else:
- self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS64))
- self.my_assert(self.data[ELFFile.EI_VERSION], chr(ELFFile.EV_CURRENT) )
-
- self.sex = self.data[ELFFile.EI_DATA]
- if self.sex == chr(ELFFile.ELFDATANONE):
- raise Exception("self.sex == ELFDATANONE")
- elif self.sex == chr(ELFFile.ELFDATA2LSB):
- self.sex = "<"
- elif self.sex == chr(ELFFile.ELFDATA2MSB):
- self.sex = ">"
- else:
- raise Exception("Unknown self.sex")
-
- def osAbi(self):
- return ord(self.data[ELFFile.EI_OSABI])
-
- def abiVersion(self):
- return ord(self.data[ELFFile.EI_ABIVERSION])
-
- def isLittleEndian(self):
- return self.sex == "<"
-
- def isBigEngian(self):
- return self.sex == ">"
-
- def machine(self):
- """
- We know the sex stored in self.sex and we
- know the position
- """
- import struct
- (a,) = struct.unpack(self.sex+"H", self.data[18:20])
- return a
-
- return ELFFile(path)
-
-
# Known Error classes
# 0 - non dev contains .so
# 1 - package contains a dangerous RPATH