Esempio n. 1
0
def flash_menu():
    '''display flash menu and process results'''

    try:
    
        ri = rominfo.rominfo
        
        my_menu = dict([
            ('a1', 'flash misc'), 
            ('b2', 'flash kernel'), 
            ('c3', 'flash boot'), 
            ('e4', 'flash recovery'), 
            ('g5', 'flash system'), 
            ('h6', 'flash parameters'),
            
            ('i7', 'clear cache'),
            ('j8', 'clear userdata'),
            ('k9', 'reboot'),
            ('pp', 'Pull ROM'),
            ('t=', '='), 
            ('vm', 'main menu'), 
            ('z=', '=')
            ])
            
        choice = mymenu(my_menu,'Enter selection :',checkvalid = True)
        
        if choice in ('1'):
            flash_singleimage('working/misc.img',ri.misc.flashdata())
        elif choice in ('2'):
            flash_singleimage('working/kernel.img',ri.kernel.flashdata())
        elif choice in ('3'):
            flash_singleimage('working/boot.img',ri.boot.flashdata())    
        elif choice in ('4'):
            flash_singleimage('working/recovery.img',ri.recovery.flashdata())
        elif choice in ('5'):
            flash_singleimage('working/system.img',ri.system.flashdata())
        elif choice in ('6'):
            flash_parameters()
        elif choice in ('7'):
            flash_clear('cache')
        elif choice in ('8'):
            flash_clear('userdata')
        elif choice in ('9'):
            flash_reboot()
        elif choice in ('Pp'):
            pullROM()
        elif choice in('Rr'):
            repairparams()
        else:
            pass
        
        if choice not in ('m','M'):
            flash_menu()    
        
    except Exception as e:
        logerror('flash::flash_menu ',e,1)
Esempio n. 2
0
def flash_menu():
    '''display flash menu and process results'''

    try:

        ri = rominfo.rominfo

        my_menu = dict([('a1', 'flash misc'), ('b2', 'flash kernel'),
                        ('c3', 'flash boot'), ('e4', 'flash recovery'),
                        ('g5', 'flash system'), ('h6', 'flash parameters'),
                        ('i7', 'clear cache'), ('j8', 'clear userdata'),
                        ('k9', 'reboot'), ('pp', 'Pull ROM'), ('t=', '='),
                        ('vm', 'main menu'), ('z=', '=')])

        choice = mymenu(my_menu, 'Enter selection :', checkvalid=True)

        if choice in ('1'):
            flash_singleimage('working/misc.img', ri.misc.flashdata())
        elif choice in ('2'):
            flash_singleimage('working/kernel.img', ri.kernel.flashdata())
        elif choice in ('3'):
            flash_singleimage('working/boot.img', ri.boot.flashdata())
        elif choice in ('4'):
            flash_singleimage('working/recovery.img', ri.recovery.flashdata())
        elif choice in ('5'):
            flash_singleimage('working/system.img', ri.system.flashdata())
        elif choice in ('6'):
            flash_parameters()
        elif choice in ('7'):
            flash_clear('cache')
        elif choice in ('8'):
            flash_clear('userdata')
        elif choice in ('9'):
            flash_reboot()
        elif choice in ('Pp'):
            pullROM()
        elif choice in ('Rr'):
            repairparams()
        else:
            pass

        if choice not in ('m', 'M'):
            flash_menu()

    except Exception as e:
        logerror('flash::flash_menu ', e, 1)
Esempio n. 3
0
def rkmainmenu():
    '''Main menu for interaction with user
    
    This is a version 1 menu this needs to inspect the state of the current 
    working ROM and offer options as appropriate'''
    try:
        
        main_menu = dict([
            ('a1', 'Pick up img and create locations'), 
            ('b2', 'Clean, brand and root system and boot images'), 
            ('c3', 'Make ROM kits'),  
            ('d4', 'Clean workspace (removes working files)'), 
            #('f5', 'Wipe workspace, and unpacked'),
            ('g=', '='), 
            ('hb', 'boot menu'),
            ('ir', 'recovery menu'),
            ('js', 'system menu'),
            ('kk', 'kernel menu'),
            ('lp', 'parameter menu'),
            ('mf', 'flash menu'),
            #('ng', 'graphics'),
            ('p=', '='),
            ('qw', 'broWse'),
            ('t=', '='), 
            ('yx', 'eXit'), 
            ('z=', '=')
            ])
            
        choice = mymenu(
                    main_menu
                    ,'Enter selection :'
                    ,checkvalid = True)
        
        if choice in ('1'):
            setworkingROM()
        elif choice in ('2'):
            cleanroot()
        elif choice in ('3'):
            makeROMkits()
        elif choice in ('4'):
            cleanworkspace()
        #elif choice in ('5'):
        #    wipeworkspace()
        elif choice in ('b','B'):
            bootmenu()
        elif choice in ('s','S'):
            systemmenu()
        elif choice in ('r','R'):
            recoverymenu()
        elif choice in ('p','P'):
            parameter_menu()
        elif choice in ('f','F'):
            flash_menu()
        elif choice in ('r','R'):
            repairparams()
        elif choice in ('k','K'):
            kernel_menu()
        elif choice in ('W','w'):
            browse('')
        elif choice in ('x','X'):
            pprint('=')
            pprint('Exiting')
            pprint('=')
            
        if choice not in ('x', 'X'):
            rkmainmenu()
        
    except Exception as e:
        logerror('rkmainmenu::menu ',e,1)
Esempio n. 4
0
def rkmainmenu():
    '''Main menu for interaction with user
    
    This is a version 1 menu this needs to inspect the state of the current 
    working ROM and offer options as appropriate'''
    try:

        main_menu = dict([
            ('a1', 'Pick up img and create locations'),
            ('b2', 'Clean, brand and root system and boot images'),
            ('c3', 'Make ROM kits'),
            ('d4', 'Clean workspace (removes working files)'),
            #('f5', 'Wipe workspace, and unpacked'),
            ('g=', '='),
            ('hb', 'boot menu'),
            ('ir', 'recovery menu'),
            ('js', 'system menu'),
            ('kk', 'kernel menu'),
            ('lp', 'parameter menu'),
            ('mf', 'flash menu'),
            #('ng', 'graphics'),
            ('p=', '='),
            ('qw', 'broWse'),
            ('t=', '='),
            ('yx', 'eXit'),
            ('z=', '=')
        ])

        choice = mymenu(main_menu, 'Enter selection :', checkvalid=True)

        if choice in ('1'):
            setworkingROM()
        elif choice in ('2'):
            cleanroot()
        elif choice in ('3'):
            makeROMkits()
        elif choice in ('4'):
            cleanworkspace()
        #elif choice in ('5'):
        #    wipeworkspace()
        elif choice in ('b', 'B'):
            bootmenu()
        elif choice in ('s', 'S'):
            systemmenu()
        elif choice in ('r', 'R'):
            recoverymenu()
        elif choice in ('p', 'P'):
            parameter_menu()
        elif choice in ('f', 'F'):
            flash_menu()
        elif choice in ('r', 'R'):
            repairparams()
        elif choice in ('k', 'K'):
            kernel_menu()
        elif choice in ('W', 'w'):
            browse('')
        elif choice in ('x', 'X'):
            pprint('=')
            pprint('Exiting')
            pprint('=')

        if choice not in ('x', 'X'):
            rkmainmenu()

    except Exception as e:
        logerror('rkmainmenu::menu ', e, 1)