def do_jffs2_umount(self, s): """ Usage: jffs2_umount Unmounts /mnt/jffs2_leapfrog This is a Linux only command. Will be prompted for password, sudo required for commands. """ try: if sys.platform != 'win32': j = jffs2() j.umount() else: self.error('Linux only command.') except Exception, e: self.perror(e)
def do_jffs2_mount(self, s): """ Usage: jffs2_mount <file_name>.jffs2 Mounts <file_name>.jffs2 image to /mnt/jffs2_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': abspath = self._lm.get_abspath(s) j = jffs2() j.mount(abspath) else: self.error('Linux only command.') except Exception, e: self.perror(e)
def do_jffs2_create(self, s): """ Usage: jffs2_create <output file name> <input directory path> Creates an <output file name> image of the <input directory path> File is saved in the current directory. 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': ifile, opath = s.split(' ') abspath = self._lm.get_abspath(opath) j = jffs2() j.create(os.path.join(self._lm.local_path, ifile), abspath) else: self.error('Linux only command.') except Exception, e: self.perror(e)