'Work out the current kernel architecture (as a kernel arch)'

def get_kernel_build_arch(self, arch=None):

    if (not arch):
        arch = utils.get_current_kernel_arch()
    if re.match('i.86', arch):
        return 'i386'
    elif re.match('sun4u', arch):
        return 'sparc64'
    elif re.match('arm.*', arch):
        return 'arm'
    elif re.match('sa110', arch):
        return 'arm'
    elif re.match('s390x', arch):
        return 's390'
    elif re.match('parisc64', arch):
        return 'parisc'
    elif re.match('ppc.*', arch):
        return 'powerpc'
    elif re.match('mips.*', arch):
        return 'mips'
    else:
        return arch
