Exemplo n.º 1
0
def getpartinfo(clsvar, msg_client):

    emmcsl4a.disableAirplaneMode(False)

    ## ______________ gather the device info, and make the marker on device   __________________
    emmcfunc.gatherEmmcDeviceInfo(clsvar)

    ## ______________ setup of test parameters   __________________
    clsvar.setupMarkforUserdata = "crc32"  # "addrfillpartial", "addrfillfull"
    if clsvar.EmmcGBSize <= 8:
        clsvar.sizetestblock = 16384  ## 8MB
    elif clsvar.EmmcGBSize <= 16:
        clsvar.sizetestblock = 16384 * 2  ## 16MB
    else:
        clsvar.sizetestblock = 16384 * 4  ## 32MB

    listskipblockname = ["persist", "mpt", "system", "cache"]
    clsvar.addrcrcstartblock = 0
    clsvar.crc0filladdress = False

    result = emmcfunc.skipCheckingBlock(clsvar, msg_client, listskipblockname)
    if result == False:
        msg_client.SendMsg("failed of skipCheckingBlock")
        exit()

    ## ______________ prepare the Partition with Mark .   __________________
    msg_client.SendMsg("main before BuildCRC32Table")

    result = emmcfunc.BuildCRC32Table(clsvar, msg_client)
    if result == False:
        msg_client.SendMsg("failed of BuildCRC32Table")
        exit()

    ## ______________ print the partition summary .   __________________
    emmcfunc.printpartitioninfo(clsvar, msg_client)
Exemplo n.º 2
0
def pretask(clsvar, msg_client) :
    if clsvar.boolbuildcrc32 == False :
        return

    emmcsl4a.disableAirplaneMode(False)

    msg_client.SendMsg ("main before tasksleep" )

    listskipblockname = [ "persist", "mpt", "system", "cache", "userdata"]

    result = emmcfunc.skipCheckingBlock(clsvar, msg_client, listskipblockname)
    if result == False :
        msg_client.SendMsg("failed of skipCheckingBlock")
        exit()

    ## ______________ prepare the Partition with Mark .   __________________
    msg_client.SendMsg ("main before BuildCRC32Table" )

    result = emmcfunc.BuildCRC32Table(clsvar, msg_client)
    if result == False :
        msg_client.SendMsg("failed of BuildCRC32Table")
        exit()

    ## ______________ save the clsvar .   __________________
    # with open('clsvar.pickle', 'wb') as handle:
    #     pickle.dump(clsvar, handle)
    #     msg_client.SendMsg("saved the clsvar.pickle")



    ## ______________ verify the Partition with the previous mark .   __________________
    # emmcfunc.setFakeEmmcWrite(clsvar, msg_client, True)

    ## ______________ print the partition summary .   __________________
    emmcfunc.printpartitioninfo(clsvar, msg_client)
Exemplo n.º 3
0
def taskEmmcpoweronoff(clsvar, msg_client):
    msg_client.SendMsg("begining,entering" )
    try:
        subtaskEmmcpoweronoff(clsvar, msg_client)
    except Exception as e:
        import traceback
        msgerr = traceback.format_exc()
        msgerr = msgerr.replace("\n", "$")

        ## replace the "\n" with "$"
        msg_client.SendMsg("error,taskEmmcpoweronoff")
        msg_client.SendMsg(msgerr)
    finally:
        funcOperCmdStop(clsvar, msg_client)
        emmcfunc.printpartitioninfo(clsvar, msg_client)
        msg_client.SendMsg("ending,leaving" )
Exemplo n.º 4
0
def taskEmmcpoweronoff(clsvar, msg_client):
    msg_client.SendMsg("begining,entering")
    try:
        subtaskEmmcpoweronoff(clsvar, msg_client)
    except Exception as e:
        import traceback
        msgerr = traceback.format_exc()
        msgerr = msgerr.replace("\n", "$")

        ## replace the "\n" with "$"
        msg_client.SendMsg("error,taskEmmcpoweronoff")
        msg_client.SendMsg(msgerr)
    finally:
        funcOperCmdStop(clsvar, msg_client)
        emmcfunc.printpartitioninfo(clsvar, msg_client)
        msg_client.SendMsg("ending,leaving")
Exemplo n.º 5
0
def getpartinfo(clsvar, msg_client) :

    emmcsl4a.disableAirplaneMode(False)




    ## ______________ gather the device info, and make the marker on device   __________________
    emmcfunc.gatherEmmcDeviceInfo(clsvar )

    ## ______________ setup of test parameters   __________________
    clsvar.setupMarkforUserdata = "crc32"  # "addrfillpartial", "addrfillfull"
    if clsvar.EmmcGBSize <= 8 :
        clsvar.sizetestblock = 16384  ## 8MB
    elif clsvar.EmmcGBSize <= 16 :
        clsvar.sizetestblock = 16384 * 2   ## 16MB
    else :
        clsvar.sizetestblock = 16384 * 4   ## 32MB

    listskipblockname = [ "persist", "mpt", "system", "cache"]
    clsvar.addrcrcstartblock = 0
    clsvar.crc0filladdress = False

    result = emmcfunc.skipCheckingBlock(clsvar, msg_client, listskipblockname)
    if result == False :
        msg_client.SendMsg("failed of skipCheckingBlock")
        exit()

    ## ______________ prepare the Partition with Mark .   __________________
    msg_client.SendMsg ("main before BuildCRC32Table" )

    result = emmcfunc.BuildCRC32Table(clsvar, msg_client)
    if result == False :
        msg_client.SendMsg("failed of BuildCRC32Table")
        exit()



    ## ______________ print the partition summary .   __________________
    emmcfunc.printpartitioninfo(clsvar, msg_client)
Exemplo n.º 6
0
import pickle

import sys
import os
import emmcfunc
import emmctest

if __name__ == "__main__":
    os.chdir("/sdcard/com.hipipal.qpyplus/scripts3")

    ## ______________ initialize the variables class   __________________
    if os.path.exists("clsvar.pickle"):
        with open('clsvar.pickle', 'rb') as handle:
            clsvar = pickle.load(handle)
    else:
        print("No clsvar.pickle")
        exit()

    # clsvar.modelname = "testmodel"
    # clsvar.DeviceSerialNo = "testNo"

    ## ______________ initialize the msg client class   __________________
    # SERVERIP = '172.21.26.41'
    SERVERIP = '192.168.219.152'

    msg_client = emmctest.clsMsgClent(clsvar.DeviceSerialNo, clsvar.modelname,
                                      SERVERIP)
    # msg_client.onlylocal = True

    emmcfunc.printpartitioninfo(clsvar, msg_client)