Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1p5rN6-0007Kc-0C for mharc-grub-devel@gnu.org; Thu, 15 Dec 2022 11:46:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5rN3-0007KJ-Sn for grub-devel@gnu.org; Thu, 15 Dec 2022 11:46:10 -0500 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5rMz-00061S-UN for grub-devel@gnu.org; Thu, 15 Dec 2022 11:46:09 -0500 Received: by mail-qt1-x836.google.com with SMTP id i20so5560973qtw.9 for ; Thu, 15 Dec 2022 08:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pz72018wxz1b5uWFmKfKQgTDM2AzfNDLtd438mmhGB0=; b=jcqfeyqhOuxsVKgiv1XNX5/bxy7Yc8yUzyNaz/NrJDmihSjkgZGL5a53y0l2Ytybq8 aLXoCJj9PO2xX0JNaLfhkFuVfsX/SGCcaGd1gDCO9CPvMEWOwfTkWESk1RQhOtgLHXot WtISfqvrLN6jEkf+6ra3iga3Hv55m7kMqFcVhADxw990ESSQSS9IILnTKoClCoOfDk2I qDpdIultcF9MVAnQS9JEnuqab5ZBB9uKGuMHJ7hQ5cGVtNTzE0tMMetMNRuJp5B5KgYi SGXc6im6JeeGQ/ttPW9Q8vULGZUtG0cr43xyod+pwjOKW6tGiF7t+qwNYcqUDjgg+TGr PTkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pz72018wxz1b5uWFmKfKQgTDM2AzfNDLtd438mmhGB0=; b=ivaWYh1BLt0jtGkBzQugTZi3ctW8cbs/9eL+Q294cYfBzWgHbRblrX/0HDrhYpo9iK I9bJuNvzUNUdx/DeIcWIzVe6ze8rBJQG6PqLYFoXZeDZfgOvR/YPgDya7IpxrYClZ6A0 OMwPChKmNmIU4ywuzv2R8sS84CqSci2Ppxefycn+DTGe6tyoeUqGZk/ZAF5pYmEr1bEO lPcIQPEIgRwV5PRXUgIt6fsYzOw0gGiz1TmCMmx7mx+Hyjq50KkodJ3uGKPHk5ma7B7W rxjiP2E/oHxnAZ8Z543CoFq1SCknswRbGeWHz0QAqVtLw+Hhr7jwF5T4xwLuBJ15tjA0 bFJg== X-Gm-Message-State: ANoB5plKAUBEsxGZDDyYlyx3ho0Lo/QKIOtoTJ8tetPYqqw+BUJLbTqX 2FEOii0QQvrIUW7LqlNjX71yfwFWVL+a7ojM X-Google-Smtp-Source: AA0mqf7NsKn1OL/vFrdYDUjpThnxCZsoQpoYSLNXwlus7vB+kef2XfWlbdvpvgcV0obNVd4bIrb7ww== X-Received: by 2002:a05:622a:5c8f:b0:3a8:199b:dcac with SMTP id ge15-20020a05622a5c8f00b003a8199bdcacmr21305225qtb.15.1671122764239; Thu, 15 Dec 2022 08:46:04 -0800 (PST) Received: from crass-HP-ZBook-15-G2.lan ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id d18-20020ac84e32000000b0039cc82a319asm3647201qtw.76.2022.12.15.08.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 08:46:03 -0800 (PST) From: Glenn Washburn To: "grub-devel @ gnu . org" , Daniel Kiper Cc: Glenn Washburn Subject: [PATCH] grub-shell: Add grub output logfile with grub-shell --debug Date: Thu, 15 Dec 2022 10:45:46 -0600 Message-Id: <20221215164546.106592-1-development@efficientek.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=development@efficientek.com; helo=mail-qt1-x836.google.com X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2022 16:46:10 -0000 This allows seeing full qemu output of grub-shell, which can be invaluable when debugging failing tests. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 6cb72403e3..5593be5718 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -376,6 +376,9 @@ echo "${halt_cmd}" >>${cfgfile} test -z "$debug" || echo "GRUB script: ${cfgfile}" >&2 test -z "$debug" || echo "GRUB testcase script: ${tmpfile}" >&2 + +goutfile="$work_directory/grub-qemu.log" +test -z "$debug" || echo "GRUB output log: ${goutfile}" >&2 test -z "$debug" || echo "Boot device: ${boot}" >&2 isofile="$work_directory/grub.iso" @@ -503,7 +506,7 @@ if [ x$boot = xnet ]; then cp "${cfgfile}" "$netdir/boot/grub/grub.cfg" cp "${source}" "$netdir/boot/grub/testcase.cfg" [ -z "$files" ] || copy_extra_files "$netdir" $files - timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | do_trim + timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | tee "${goutfile}" | do_trim elif [ x$boot = xemu ]; then rootdir="$work_directory/rootdir" grubdir="$rootdir/boot/grub" @@ -522,18 +525,19 @@ elif [ x$boot = xemu ]; then [ -z "$files" ] || copy_extra_files "$rootdir" $files roottar="$work_directory/root.tar" (cd "$rootdir"; tar cf "$roottar" .) - "${builddir}/grub-core/grub-emu" -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim + "${builddir}/grub-core/grub-emu" -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | tee "${goutfile}" | do_trim test -n "$debug" || rm -rf "$rootdir" test -n "$debug" || rm -f "$roottar" else - timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -${device}"${isofile}" ${bootdev} | cat | tr -d "\r" | do_trim + timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -${device}"${isofile}" ${bootdev} | cat | tr -d "\r" | tee "${goutfile}" | do_trim fi if [ x$boot = xcoreboot ]; then test -n "$debug" || rm -f "${imgfile}" fi test -n "$debug" || rm -f "${isofile}" test -n "$debug" || rm -rf "${rom_directory}" -test -n "$debug" || rm -f "${tmpfile}" "${cfgfile}" +test -n "$debug" || rm -f "${tmpfile}" "${cfgfile}" "${goutfile}" + exit 0 -- 2.34.1