Esempio n. 1
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)
Esempio n. 2
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()