def __init__(self, d): super(QemuTarget, self).__init__(d) self.image_fstype = self.get_image_fstype(d) self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) self.origrootfs = os.path.join( d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype) self.rootfs = os.path.join( self.testdir, d.getVar("IMAGE_LINK_NAME", True) + '-testimage.' + self.image_fstype) self.kernel = os.path.join( d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin') dump_target_cmds = d.getVar("testimage_dump_target", True) dump_host_cmds = d.getVar("testimage_dump_host", True) dump_dir = d.getVar("TESTIMAGE_DUMP_DIR", True) # Log QemuRunner log output to a file import oe.path bb.utils.mkdirhier(self.testdir) self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime) logger = logging.getLogger('BitBake.QemuRunner') loggerhandler = logging.FileHandler(self.qemurunnerlog) loggerhandler.setFormatter( logging.Formatter("%(levelname)s: %(message)s")) logger.addHandler(loggerhandler) oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True) if d.getVar("DISTRO", True) == "poky-tiny": self.runner = QemuTinyRunner( machine=d.getVar("MACHINE", True), rootfs=self.rootfs, tmpdir=d.getVar("TMPDIR", True), deploy_dir_image=d.getVar("DEPLOY_DIR_IMAGE", True), display=d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True), logfile=self.qemulog, kernel=self.kernel, boottime=int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True))) else: self.runner = QemuRunner( machine=d.getVar("MACHINE", True), rootfs=self.rootfs, tmpdir=d.getVar("TMPDIR", True), deploy_dir_image=d.getVar("DEPLOY_DIR_IMAGE", True), display=d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True), logfile=self.qemulog, boottime=int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)), dump_dir=dump_dir, dump_host_cmds=d.getVar("testimage_dump_host", True)) self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
def __init__(self, d): super(QemuTarget, self).__init__(d) self.image_fstype = self.get_image_fstype(d) self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) self.origrootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype) self.rootfs = os.path.join(self.testdir, d.getVar("IMAGE_LINK_NAME", True) + '-testimage.' + self.image_fstype) self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE") + '-' + d.getVar('MACHINE') + '.bin') if d.getVar("DISTRO", True) == "poky-tiny": self.runner = QemuTinyRunner(machine=d.getVar("MACHINE", True), rootfs=self.rootfs, tmpdir = d.getVar("TMPDIR", True), deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True), display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True), logfile = self.qemulog, kernel = self.kernel, boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True))) else: self.runner = QemuRunner(machine=d.getVar("MACHINE", True), rootfs=self.rootfs, tmpdir = d.getVar("TMPDIR", True), deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True), display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True), logfile = self.qemulog, boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)))
def __init__(self, d, logger, image_fstype=None): import oe.types super(QemuTarget, self).__init__(d, logger) self.rootfs = '' self.kernel = '' self.image_fstype = '' if d.getVar('FIND_ROOTFS') == '1': self.image_fstype = image_fstype or self.get_image_fstype(d) self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype) self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin') self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) dump_target_cmds = d.getVar("testimage_dump_target") dump_host_cmds = d.getVar("testimage_dump_host") dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") if not dump_dir: dump_dir = os.path.join(d.getVar('LOG_DIR'), 'runtime-hostdump') use_kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) # Log QemuRunner log output to a file import oe.path bb.utils.mkdirhier(self.testdir) self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime) self.loggerhandler = logging.FileHandler(self.qemurunnerlog) self.loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) self.logger.addHandler(self.loggerhandler) oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True) if d.getVar("DISTRO") == "poky-tiny": self.runner = QemuTinyRunner(machine=d.getVar("MACHINE"), rootfs=self.rootfs, tmpdir = d.getVar("TMPDIR"), deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"), display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), logfile = self.qemulog, kernel = self.kernel, boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")), tmpfsdir = d.getVar("RUNQEMU_TMPFS_DIR"), logger = logger) else: self.runner = QemuRunner(machine=d.getVar("MACHINE"), rootfs=self.rootfs, tmpdir = d.getVar("TMPDIR"), deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"), display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), logfile = self.qemulog, boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")), use_kvm = use_kvm, dump_dir = dump_dir, dump_host_cmds = d.getVar("testimage_dump_host"), logger = logger, tmpfsdir = d.getVar("RUNQEMU_TMPFS_DIR"), serial_ports = len(d.getVar("SERIAL_CONSOLES").split())) self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
def __init__(self, td, logger, image_fstype=None, **kwargs): import oe.types super(QemuTarget, self).__init__(td, logger, **kwargs) self.rootfs = '' self.kernel = '' self.image_fstype = '' if td['FIND_ROOTFS'] == '1': self.image_fstype = image_fstype or self.get_image_fstype(td) self.rootfs = os.path.join( td['DEPLOY_DIR_IMAGE'], td['IMAGE_LINK_NAME'] + '.' + self.image_fstype) self.kernel = os.path.join( td['DEPLOY_DIR_IMAGE'], td["KERNEL_IMAGETYPE"] + '-' + td['MACHINE'] + '.bin') self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) dump_target_cmds = td['testimage_dump_target'] dump_host_cmds = td['testimage_dump_host'] dump_dir = td['TESTIMAGE_DUMP_DIR'] qemu_use_kvm = td['QEMU_USE_KVM'] if qemu_use_kvm and \ (oe.types.boolean(qemu_use_kvm) and "x86" in td['MACHINE'] or \ td['MACHINE'] in qemu_use_kvm.split()): use_kvm = True else: use_kvm = False # Log QemuRunner log output to a file import oe.path bb.utils.mkdirhier(self.testdir) self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime) loggerhandler = logging.FileHandler(self.qemurunnerlog) loggerhandler.setFormatter( logging.Formatter("%(levelname)s: %(message)s")) self.logger.addHandler(loggerhandler) oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True) if td['DISTRO'] == "poky-tiny": self.runner = QemuTinyRunner( machine=td['MACHINE'], rootfs=self.rootfs, tmpdir=td['TMPDIR'], deploy_dir_image=td['DEPLOY_DIR_IMAGE'], display=td['DISPLAY'], logfile=self.qemulog, kernel=self.kernel, boottime=int(td['TEST_QEMUBOOT_TIMEOUT']), logger=logger) else: self.runner = QemuRunner(machine=td['MACHINE'], rootfs=self.rootfs, tmpdir=td['TMPDIR'], deploy_dir_image=td['DEPLOY_DIR_IMAGE'], display=td['DISPLAY'], logfile=self.qemulog, boottime=int(td['TEST_QEMUBOOT_TIMEOUT']), use_kvm=use_kvm, dump_dir=dump_dir, dump_host_cmds=td['testimage_dump_host'], logger=logger) self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
def __init__(self, d, image_fstype=None): super(QemuTarget, self).__init__(d) self.rootfs = '' self.kernel = '' self.image_fstype = '' if d.getVar('FIND_ROOTFS') == '1': self.image_fstype = image_fstype or self.get_image_fstype(d) self.rootfs = os.path.join( d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype) self.kernel = os.path.join( d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin') self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) dump_target_cmds = d.getVar("testimage_dump_target") dump_host_cmds = d.getVar("testimage_dump_host") dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") qemu_use_kvm = d.getVar("QEMU_USE_KVM") if qemu_use_kvm and \ (qemu_use_kvm == "True" and "x86" in d.getVar("MACHINE") or \ d.getVar("MACHINE") in qemu_use_kvm.split()): use_kvm = True else: use_kvm = False # Log QemuRunner log output to a file import oe.path bb.utils.mkdirhier(self.testdir) self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime) loggerhandler = logging.FileHandler(self.qemurunnerlog) loggerhandler.setFormatter( logging.Formatter("%(levelname)s: %(message)s")) logger.addHandler(loggerhandler) oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True) if d.getVar("DISTRO") == "poky-tiny": self.runner = QemuTinyRunner( machine=d.getVar("MACHINE"), rootfs=self.rootfs, tmpdir=d.getVar("TMPDIR"), deploy_dir_image=d.getVar("DEPLOY_DIR_IMAGE"), display=d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), logfile=self.qemulog, kernel=self.kernel, boottime=int(d.getVar("TEST_QEMUBOOT_TIMEOUT"))) else: self.runner = QemuRunner( machine=d.getVar("MACHINE"), rootfs=self.rootfs, tmpdir=d.getVar("TMPDIR"), deploy_dir_image=d.getVar("DEPLOY_DIR_IMAGE"), display=d.getVar("BB_ORIGENV", False).getVar("DISPLAY"), logfile=self.qemulog, boottime=int(d.getVar("TEST_QEMUBOOT_TIMEOUT")), use_kvm=use_kvm, dump_dir=dump_dir, dump_host_cmds=d.getVar("testimage_dump_host")) self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)