예제 #1
0
파일: livecd.py 프로젝트: nataliakoval/mic
    def _stage_final_image(self):
        try:
            fs_related.makedirs(self.__ensure_isodir() + "/LiveOS")

            minimal_size = self._resparse()

            if not self.skip_minimize:
                fs_related.create_image_minimizer(self.__isodir + \
                                                      "/LiveOS/osmin.img",
                                                  self._image,
                                                  minimal_size)

            if self.skip_compression:
                shutil.move(self._image, self.__isodir + "/LiveOS/ext3fs.img")
            else:
                fs_related.makedirs(os.path.join(
                                        os.path.dirname(self._image),
                                        "LiveOS"))
                shutil.move(self._image,
                            os.path.join(os.path.dirname(self._image),
                                         "LiveOS", "ext3fs.img"))
                fs_related.mksquashfs(os.path.dirname(self._image),
                           self.__isodir + "/LiveOS/squashfs.img")

            self.__create_iso(self.__isodir)

            if self.pack_to:
                isoimg = os.path.join(self._outdir, self.name + ".iso")
                packimg = os.path.join(self._outdir, self.pack_to)
                misc.packing(packimg, isoimg)
                os.unlink(isoimg)

        finally:
            shutil.rmtree(self.__isodir, ignore_errors = True)
            self.__isodir = None
예제 #2
0
    def _stage_final_image(self):
        try:
            isodir = self._get_isodir()
            fs_related.makedirs(isodir + "/LiveOS")

            minimal_size = self._resparse()

            if not self.skip_minimize:
                fs_related.create_image_minimizer(isodir + "/LiveOS/osmin.img",
                                                  self._image, minimal_size)

            if self.skip_compression:
                shutil.move(self._image, isodir + "/LiveOS/ext3fs.img")
            else:
                fs_related.makedirs(
                    os.path.join(os.path.dirname(self._image), "LiveOS"))
                shutil.move(
                    self._image,
                    os.path.join(os.path.dirname(self._image), "LiveOS",
                                 "ext3fs.img"))
                fs_related.mksquashfs(os.path.dirname(self._image),
                                      isodir + "/LiveOS/squashfs.img")

                self._create_usbimg(isodir)

                if self.pack_to:
                    usbimg = os.path.join(self._outdir, self.name + ".usbimg")
                    packimg = os.path.join(self._outdir, self.pack_to)
                    misc.packing(packimg, usbimg)
                    os.unlink(usbimg)

        finally:
            shutil.rmtree(isodir, ignore_errors=True)
            self._set_isodir(None)
예제 #3
0
    def _stage_final_image(self):
        try:
            fs_related.makedirs(self.__ensure_isodir() + "/LiveOS")

            minimal_size = self._resparse()

            if not self.skip_minimize:
                fs_related.create_image_minimizer(self.__isodir + \
                                                      "/LiveOS/osmin.img",
                                                  self._image,
                                                  minimal_size)

            if self.skip_compression:
                shutil.move(self._image, self.__isodir + "/LiveOS/ext3fs.img")
            else:
                fs_related.makedirs(os.path.join(
                                        os.path.dirname(self._image),
                                        "LiveOS"))
                shutil.move(self._image,
                            os.path.join(os.path.dirname(self._image),
                                         "LiveOS", "ext3fs.img"))
                fs_related.mksquashfs(os.path.dirname(self._image),
                           self.__isodir + "/LiveOS/squashfs.img")

            self.__create_iso(self.__isodir)
        finally:
            shutil.rmtree(self.__isodir, ignore_errors = True)
            self.__isodir = None
예제 #4
0
파일: liveusb.py 프로젝트: saukko/mic
    def _stage_final_image(self):
        try:
            isodir = self._get_isodir()
            fs_related.makedirs(isodir + "/LiveOS")

            minimal_size = self._resparse()

            if not self.skip_minimize:
                fs_related.create_image_minimizer(isodir + "/LiveOS/osmin.img", self._image, minimal_size)

            if self.skip_compression:
                shutil.move(self._image, isodir + "/LiveOS/ext3fs.img")
            else:
                fs_related.makedirs(os.path.join(os.path.dirname(self._image), "LiveOS"))
                shutil.move(self._image, os.path.join(os.path.dirname(self._image), "LiveOS", "ext3fs.img"))
                fs_related.mksquashfs(os.path.dirname(self._image), isodir + "/LiveOS/squashfs.img")

                self._create_usbimg(isodir)

        finally:
            shutil.rmtree(isodir, ignore_errors=True)
            self._set_isodir(None)
예제 #5
0
파일: liveusb.py 프로젝트: 01org/mic
    def _stage_final_image(self):
        try:
            isodir = self._get_isodir()
            fs_related.makedirs(isodir + "/LiveOS")

            minimal_size = self._resparse()

            if not self.skip_minimize:
                fs_related.create_image_minimizer(isodir + "/LiveOS/osmin.img",
                                                  self._image,
                                                  minimal_size)

            if self.skip_compression:
                shutil.move(self._image,
                            isodir + "/LiveOS/ext3fs.img")
            else:
                fs_related.makedirs(os.path.join(
                                        os.path.dirname(self._image),
                                        "LiveOS"))
                shutil.move(self._image,
                            os.path.join(os.path.dirname(self._image),
                                         "LiveOS", "ext3fs.img"))
                fs_related.mksquashfs(os.path.dirname(self._image),
                           isodir + "/LiveOS/squashfs.img")

                self._create_usbimg(isodir)

                if self.pack_to:
                    self.image_files.update({'image_files': self.pack_to})
                    usbimg = os.path.join(self._outdir, self.name + ".usbimg")
                    packimg = os.path.join(self._outdir, self.pack_to)
                    packing(packimg, usbimg)
                    os.unlink(usbimg)
                else:
                    self.image_files.update({'image_files': self.name + ".usbimg"})

        finally:
            shutil.rmtree(isodir, ignore_errors = True)
            self._set_isodir(None)
예제 #6
0
파일: livecd.py 프로젝트: pombreda/mic
    def _stage_final_image(self):
        try:
            fs_related.makedirs(self.__ensure_isodir() + "/LiveOS")

            minimal_size = self._resparse()

            if not self.skip_minimize:
                fs_related.create_image_minimizer(self.__isodir + \
                                                      "/LiveOS/osmin.img",
                                                  self._image,
                                                  minimal_size)

            if self.skip_compression:
                shutil.move(self._image, self.__isodir + "/LiveOS/ext3fs.img")
            else:
                fs_related.makedirs(
                    os.path.join(os.path.dirname(self._image), "LiveOS"))
                shutil.move(
                    self._image,
                    os.path.join(os.path.dirname(self._image), "LiveOS",
                                 "ext3fs.img"))
                fs_related.mksquashfs(os.path.dirname(self._image),
                                      self.__isodir + "/LiveOS/squashfs.img")

            self.__create_iso(self.__isodir)

            if self.pack_to:
                isoimg = os.path.join(self._outdir, self.name + ".iso")
                packimg = os.path.join(self._outdir, self.pack_to)
                packing(packimg, isoimg)
                os.unlink(isoimg)
                self.image_files.update({'image_files': [self.pack_to]})
            else:
                self.image_files.update({'image_files': [self.name + ".iso"]})

        finally:
            shutil.rmtree(self.__isodir, ignore_errors=True)
            self.__isodir = None