From aeb799d556ba3c4b9ef45fc23af204312899db64 Mon Sep 17 00:00:00 2001 From: Luotao Fu Date: Wed, 24 Feb 2010 10:59:56 +0100 Subject: [ptxdist] fix bootloader signature matching The bootloader signature mapping does noet get along with barebox and had a off-by-one error. Also change the output text from "U-Boot" to more generic "Bootloader" to avoid confusion. Signed-off-by: Luotao Fu --- tests/libptxdisttest.kermit | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/libptxdisttest.kermit b/tests/libptxdisttest.kermit index 66c0a9282..84bfcbb26 100644 --- a/tests/libptxdisttest.kermit +++ b/tests/libptxdisttest.kermit @@ -90,25 +90,34 @@ define ptx_lineout { define ptx_uboot_enter_shell { - ptx_test_start "Logging into U-Boot" + ptx_test_start "Logging into Bootloader" # Determine U-Boot version; 20yy.m is treated as V1. # tried to match all V1 signatures with \fpattern, failed badly :( - minput 120 "U-Boot 1." "U-Boot 2." "U-Boot 20" + minput 120 "U-Boot 1." "U-Boot 20" "U-Boot 2." "barebox 2" :eval_again - ptx_check_fail "waiting for u-boot-signature" + ptx_check_fail "waiting for bootloader signature" lineout - if = \v(minput) 2 { - .uboot_prompt = "uboot:" - .uboot_version = 2 - } else { + + switch \v(minput) { + :1 + :2 .uboot_prompt = "uboot>" .uboot_version = 1 + break + :3 + .uboot_prompt = "uboot:" + .uboot_version = 2 + break + :4 + .uboot_prompt = "barebox:" + .uboot_version = 2 + break } # sometimes there are caches for serial inputs containing old data # make sure we act on the newest one - minput 120 "U-Boot 1." "U-Boot 2." "U-Boot 20" \m(uboot_prompt) - if not = \v(minput) 4 goto eval_again + minput 120 "U-Boot 1." "U-Boot 20" "U-Boot 2." "barebox 2" \m(uboot_prompt) + if not = \v(minput) 5 goto eval_again ptx_test_end } -- cgit v1.2.3