Exemplo n.º 1
0
def recoverymenu():
    '''display recovery menu and process results'''
    try:
        my_menu = dict([
            ('a1', 'unpack recovery.img'), 
            ('b2', 'browse recovery'), 
            #('c3', 'init.d support'), 
            ('e5', 'finalise recovery'), 
            #('f6', 'Pack Kernel with fun_ CWM recovery'), 
            ('g=', '='), 
            ('h3', 'Custom remove'),
            ('j4', 'Custom deploy'),
            ('t=', '='), 
            ('vm', 'main menu'), 
            ('z=', '=')
            ])
        choice = mymenu(my_menu,'Enter selection :')

        if choice in ('1'):
            unpackrecovery()
        elif choice in ('2'):
            browse_recovery()
        elif choice in ('5'):
            finalise_recovery()
        #elif choice in ('6'):
        #    pack_CWM_recovery()
        else:
            pass
        
        if choice not in ('m','M'):
            recoverymenu()   
    except Exception as e:
        logerror('recovery::recoverymenu ',e,1)
Exemplo n.º 2
0
def parameter_menu():
    '''display parameter menu and process results'''
    
    try:
        my_menu = dict([
            ('a1', 'read parameters'), 
            ('b2', 'display parameters'), 
            ('c3', 'Edit Parameters'), 
            #('e5', 'finalise recovery'), 
            #('g=', '='), 
            #('h3', 'Custom remove'),
            #('j4', 'Custom deploy'),
            ('t=', '='), 
            ('vm', 'main menu'), 
            ('z=', '=')
            ])
        choice = mymenu(my_menu,'Enter selection :',checkvalid = True)

        if choice in ('1'):
            parse_parameter()
        elif choice in ('2'):
            display_params()
        elif choice in ('3'):
            editparameter_menu()
        elif choice in ('rR'):
            repairparams()
        else:
            pass
        
        if choice not in ('m','M'):
            parameter_menu()   

    except Exception as e:
        logerror('parameter::parameter_menu ',e,1)
Exemplo n.º 3
0
def parameter_menu():
    '''display parameter menu and process results'''

    try:
        my_menu = dict([
            ('a1', 'read parameters'),
            ('b2', 'display parameters'),
            ('c3', 'Edit Parameters'),
            #('e5', 'finalise recovery'),
            #('g=', '='),
            #('h3', 'Custom remove'),
            #('j4', 'Custom deploy'),
            ('t=', '='),
            ('vm', 'main menu'),
            ('z=', '=')
        ])
        choice = mymenu(my_menu, 'Enter selection :', checkvalid=True)

        if choice in ('1'):
            parse_parameter()
        elif choice in ('2'):
            display_params()
        elif choice in ('3'):
            editparameter_menu()
        elif choice in ('rR'):
            repairparams()
        else:
            pass

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

    except Exception as e:
        logerror('parameter::parameter_menu ', e, 1)
Exemplo n.º 4
0
def bootmenu():
    '''display boot menu and process results'''
    try:
        my_menu = dict([
            ('a1', 'unpack boot.img'), 
            ('b2', 'build prop edits'), 
            ('c3', 'init.d support'), 
            ('d4', 'brand boot.img'), 
            ('e5', 'finalise boot'), 
            ('g=', '='), 
            ('h6', 'Custom remove'),
            ('j7', 'Custom deploy'),
            ('k8', 'Custom extend'),
            ('l9', 'Custom extend init.rk30board.rc'),
            ('p=', '='), 
            ('qw', 'broWse'),
            ('t=', '='), 
            ('vm', 'main menu'), 
            ('z=', '=')
            ])
        choice = mymenu(my_menu,'Enter selection :')

        if choice in ('1'):
            unpackboot()
        elif choice in ('2'):
            initrc_mount_system_rw(1)
        elif choice in ('3'):
            addinitd_support(1)
        elif choice in ('4'):
            brand_boot(1)
        elif choice in ('5'):
            finalise_boot()
        elif choice in ('6'):
            custom_remove('working/boot/')    
        elif choice in ('7'):
            custom_deploy('working/boot/')
        elif choice in ('8'):
            path = 'working/boot/init.rc'
            query_add_by_file(path,os.path.join(KitchenConfig.KitchenConfig.KitchenPath
                ,'processcontrol/queryaddinitrc'))     
            os.system('sudo ' + KitchenConfig.KitchenConfig.editor + ' ' + path)
        elif choice in ('9'):
            path = 'working/boot/init.rk30board.rc'
            query_add_by_file(path,os.path.join(KitchenConfig.KitchenConfig.KitchenPath
                ,'processcontrol/queryaddrk30board'))  
            logging.debug('boot::bootmenu sudo ' + KitchenConfig.KitchenConfig.editor + ' ' + path)
            os.system('sudo ' + KitchenConfig.KitchenConfig.editor + ' ' + path)
        elif choice in ('W','w'):
            browse_boot()
        else:
            pass
        
        if choice not in ('m','M'):
            bootmenu()  
              
    except Exception as e:
        logerror('boot::bootmenu ',e,1)
Exemplo n.º 5
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)
Exemplo n.º 6
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)
Exemplo n.º 7
0
def kernel_menu():
    ''' stand alone menu'''
    
    try:
        ri = rominfo.rominfo
        
        if ri.kernelImageSize <> '':
            getkerneldata()
            my_menu = dict([
                ('aa', 'Get Kernel image info'), 
                ('bb', 'Brand Kernel'), 
                ('t=', '='), 
                ('vm', 'main menu'), 
                ('z=', '=')
                ])
        else:
             my_menu = dict([
                ('aa', 'Get Kernel image info'), 
                ('t=', '='), 
                ('vm', 'main menu'), 
                ('z=', '=')
                ])   
                
        choice = mymenu(my_menu,'Enter selection :')
        
        if choice in ('a'):
            getkerneldata()
        elif choice in ('b'):
            if w > 0:
                brandkernel();
        elif choice in ('m','M'):
            
            pprint('=')
            pprint('Exiting')
            pprint('=')
            
        if choice not in ('m', 'M'):
            kernel_menu()         
            
    except Exception as e:
        logerror('kernel::kernelmenu ' ,e,1)        
Exemplo n.º 8
0
def systemmenu():
    '''display system menu and process results'''
    
    my_menu = dict([
        ('a1', 'mount system.img'), 
        ('b2', 'unmount system'), 
        ('c=', '='),
        ('d3', 'grow system'),
        ('e5', 'custom remove'),
        ('g6', 'custom deploy'), 
        ('h7', 'custom build prop change'), 
        ('p=', '='), 
        ('qw', 'broWse'),
        ('s=', '='),
        ('tm', 'main menu'), 
        ('z=', '=')
        ])
    choice = mymenu(my_menu,'Enter selection :')

    if choice in ('1'):
        mountsystem()
    elif choice in ('2'):
        finalisesystem()
    elif choice in ('3'):
        growsystem()
    elif choice in ('5'):
        customremove('working/mntsystem/')    
    elif choice in ('6'):
        custom_deploy('working/mntsystem/')
    elif choice in ('7'):
        extendBuildprop(1)
    elif choice in ('W','w'):
        browse_system()
    else:
        pass
    
    if choice not in ('m','M'):
        systemmenu()
Exemplo n.º 9
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)
Exemplo n.º 10
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)