hi, all,

I am using the new uefi, it use the cursor movement and the Enter to enter the entry.

So I use the config file to write it, but I found it can not work well. the config is below.
boot_cmds_ramdisk_sata = expect "Move Highlight",
            sendline "\033[B",
            sendline "\033[B",
            sendcontrol "M",
            sendline "\033[B",
            sendline "\033[B",
            sendline "\033[B",
            sendline "\033[B",
            sendline "\033[B",
            sendline "\033[B",
            sendcontrol "M",
            expect "D02",
            sendline "provision {SERVER_IP} -u htsat -p hello8943217 -f Image_D02 -a 10000",
            expect "succ" ,
            sendline "norwfmem 100000 100000 1f00000",
            expect "OK",
            sendline "provision {SERVER_IP} -u htsat -p hello8943217 -f hip05-d02.dtb -a 100000",
            expect "succ",
            sendline "spiwfmem 100000 300000 100000",
            expect "OK",
            expect "OK",
            sendline "exit",
            expect "Select Language",
            sendline "\033[B",
            sendline "\033[B",
            sendcontrol "M",
            sendline "\033[B",
            sendline "\033[B",
            sendline "\033[B",
            sendline "\033[B",
            sendcontrol "M"


After I read the source code of LAVA. I found it use the pexpect.spawn to interact with the terminal, So I directly writte a python file to directly use spawn to interact with the terminal, and it can work well . The source code is below. 
import sys
from pexpect import spawn

child = spawn("board_connect 2")     # this is similar with minicom
logfile = "/tmp/test_for_terminal.log"
fd = open(logfile, 'a+')
child.logfile = fd
child.expect("to stop automatical booting", timeout=120)
child.sendline("b")
child.expect("Move Highlight")
## boot from sata
child.sendline("\033[B")
child.sendline("\033[B")
child.sendcontrol("M")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendcontrol("M")
child.expect("D02")
child.sendline("provision 192.168.6.100 -u htsat -p hello8943217 -f Image_D02 -a 10000")
child.expect("succ")
child.sendline("norwfmem 100000 100000 1f00000")
child.expect("OK")
child.sendline("provision 192.168.6.100 -u htsat -p hello8943217 -f hip05-d02.dtb -a 100000")
child.expect("succ")
child.sendline("spiwfmem 100000 300000 100000")
child.expect("OK")
child.expect("OK")
#child.interact()
child.sendline("exit")
child.expect("Select Language")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendcontrol("M")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendline("\033[B")
child.sendcontrol("M")
child.interact()

So I don't know why in LAVA it can not work. Also I have realized a function named sendcursor similar with the sendcontrol in the lava_dispatcher package especially in the /usr/lib/python2.7/dist-package/lava_dispatcher/utils.py, and it call the pexpect.spawn.sendline to send contents to the child process. But it still have the same phenomenon with using sendline(namely won't select the entry in the uefi menu).   Does this problem is caused by the dashboard showing?

The attached files are the log files when I use the python file to execute the interaction and the one when LAVA execute it.   Thanks for your help.

Elaine
Hisilicon turing software and architecture