Exemplo 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)
Exemplo n.º 2
0
def extendBuildprop(edit):
    '''Extend build properties
    
    edit = 1 to open the file in the configured editor once the changes made
    '''
    
    try:    
        path = 'working/mntsystem/build.prop'
        qabfile = os.path.join(KitchenConfig.KitchenConfig.KitchenPath,'processcontrol/queryaddbuild.prop')
        
        logging.info('system::extendBuildprop KitchenConfig.KitchenConfig.KitchenPath ' + KitchenConfig.KitchenConfig.KitchenPath)
        logging.info('system::extendBuildprop path ' + path)
        logging.info('system::extendBuildprop qabfile ' + qabfile)
        query_add_by_file(path,qabfile)  
        if edit ==1:
            kc = KitchenConfig.KitchenConfig
            os.system('sudo ' + kc.editor + ' working/mntsystem/build.prop')
    except Exception as e:
        logerror('system::extendBuildprop ' , e, 1)