コード例 #1
0
ファイル: initramfs.py プロジェクト: maspap/OpenLFConnect
def extract(path, suffix):
    if cbf.check(path, True):
        cbf.extract(path)
        path = os.path.join(os.path.dirname(path), 'zImage')

    irfs = initramfs(suffix)
    if irfs.gzip_find(irfs.file_open(path), True):
        irfs.extract(path)
        print 'Initramfs extracted.'
    else:
        error('Does not appear to be proper zImage.')
コード例 #2
0
    def do_cbf_unwrap(self, s):
        """
Usage:
    cbf_unwrap <file path>

Removes the CBF wrapper and prints a summary.
CBF is used on kernels and surgeon, to wrap a zImage or Image file.

Saves the image file to the same directory the cbf file was in.
        """
        try:
            self._lm.is_empty(s)
            self._lm.set_local()
            abspath = self._lm.get_abspath(s)
            cbf.extract(abspath)
            self._lm.last_location()
        except Exception, e:
            self._lm.last_location()
            self.perror(e)