def execute_img(self, _buildenv, _target, builddir, loop_dev): part_nr = self.node.et.attrib['part'] aname = self.node.et.attrib['artifact'] img_mnt = os.path.join(builddir, 'imagemnt') device = "%sp%s" % (loop_dev, part_nr) with ImgMountFilesystem(img_mnt, device) as mnt_fs: fname = mnt_fs.fname(self.node.et.text) cmd = 'cp "%s" "%s"' % (os.path.join(builddir, aname), fname) do(cmd)
def execute_img(self, _buildenv, _target, builddir, loop_dev): script = '\n'.join( line.lstrip(" \t") for line in self.node.et.text.strip("\n").splitlines()) mnt = os.path.join(builddir, 'imagemnt') dev = "%sp%s" % (loop_dev, self.node.et.attrib["part"]) with ImgMountFilesystem(mnt, dev) as fs: do("/bin/sh", stdin=script, env_add={"ELBE_MNT": fs.path})
def execute_img(self, _buildenv, target, builddir, loop_dev): part_nr = self.node.et.attrib['part'] aname = self.node.et.attrib['artifact'] img_mnt = os.path.join(builddir, 'imagemnt') device = "%sp%s" % (loop_dev, part_nr) with ImgMountFilesystem(img_mnt, device) as mnt_fs: fname = mnt_fs.glob(self.node.et.text) if not fname: logging.error('No file matching "%s" found', self.node.et.text) raise FinetuningException('No File found') if len(fname) > 1: logging.info('Pattern "%s" matches %d files', self.node.et.text, len(fname)) raise FinetuningException('Patter matches too many files') cmd = 'cp "%s" "%s"' % (fname[0], os.path.join(builddir, aname)) do(cmd) target.images.append(aname)