Esempio n. 1
0
    def do_ubi_create(self, s):
        """
Usage:
    ubi_create <erootfs|bulk> <output file name> <input directory path>

Creates an Explorer UBI image <output file name> of the <input directory path>.
File is saved to the current directory.

Caution this image is specifically for the Explorer.

This is a Linux only command.

Will be prompted for password, sudo required for commands.
        """
        try:
            self._lm.is_empty(s)
            if sys.platform != 'win32':
                ubi_version = self._profile.get['olfc']['ubi_version']

                if ubi_version < 1:
                    self.error('UBI not available for this device.')

                part, ofile, ipath = s.split(' ')
                abspath = self._lm.get_abspath(ipath)
                u = ubi(ubi_version)
                u.create(part, os.path.join(self._lm.local_path, ofile), abspath)
            else:
                self.error('Linux only command.')
        except Exception, e:
            self.perror(e)
Esempio n. 2
0
    def do_ubi_mount(self, s):
        """
Usage:
    ubi_mount <file.ubi>

Mounts an Explorer erootfs.ubi image to /mnt/ubi_leapfrog
This is a Linux only command.

Will be prompted for password, sudo required for commands.
        """
        try:
            self._lm.is_empty(s)

            if sys.platform != 'win32':
                ubi_version = self._profile.get['olfc']['ubi_version']

                if ubi_version < 1:
                    self.error('UBI not available for this device.')
                elif ubi_version > 1:
                    self.error('This UBI can not be mounted.')

                fw_version, path = s.split(' ')
                if fw_version not in ['1', '2']:
                    self.error('Can not determine firmware version')

                abspath = self._lm.get_abspath(path)
                u = ubi(fw_version)
                u.mount(abspath)
            else:
                self.error('Linux only command.')
        except Exception, e:
            self.perror(e)
Esempio n. 3
0
    def do_ubi_umount(self, s):
        """
Usage:
    ubi_umount

Unmounts /mnt/ubi_leapfrog
This is a Linux only command.

Will be prompted for password, sudo required for commands.
        """
        try:
            if sys.platform != 'win32':
                u = ubi()
                u.umount()
            else:
                self.error('Linux only command.')
        except Exception, e:
            self.perror(e)