qemu

FORK: QEMU emulator
git clone https://git.neptards.moe/neptards/qemu.git
Log | Files | Refs | Submodules | LICENSE

rebuild-expected-aml.sh (2102B)


      1 #!/usr/bin/env bash
      2 
      3 #
      4 # Rebuild expected AML files for acpi unit-test
      5 #
      6 # Copyright (c) 2013 Red Hat Inc.
      7 #
      8 # Authors:
      9 #  Marcel Apfelbaum <marcel.a@redhat.com>
     10 #  Igor Mammedov <imammedo@redhat.com>
     11 #
     12 # This work is licensed under the terms of the GNU GPLv2.
     13 # See the COPYING.LIB file in the top-level directory.
     14 
     15 qemu_arches="x86_64 aarch64"
     16 
     17 if [ ! -e "tests/qtest/bios-tables-test" ]; then
     18     echo "Test: bios-tables-test is required! Run make check before this script."
     19     echo "Run this script from the build directory."
     20     exit 1;
     21 fi
     22 
     23 if grep TARGET_DIRS= config-host.mak; then
     24     for arch in $qemu_arches; do
     25         if  grep TARGET_DIRS= config-host.mak | grep "$arch"-softmmu;
     26         then
     27             qemu_bins="$qemu_bins ./qemu-system-$arch"
     28         fi
     29     done
     30 else
     31     echo "config-host.mak missing!"
     32     echo "Run this script from the build directory."
     33     exit 1;
     34 fi
     35 
     36 if [ -z "$qemu_bins" ]; then
     37     echo "Only the following architectures are currently supported: $qemu_arches"
     38     echo "None of these configured!"
     39     echo "To fix, run configure --target-list=x86_64-softmmu,aarch64-softmmu"
     40     exit 1;
     41 fi
     42 
     43 for qemu in $qemu_bins; do
     44     if [ ! -e $qemu ]; then
     45         echo "Run 'make' to build the following QEMU executables: $qemu_bins"
     46         echo "Also, run this script from the build directory."
     47         exit 1;
     48     fi
     49     TEST_ACPI_REBUILD_AML=y QTEST_QEMU_BINARY=$qemu tests/qtest/bios-tables-test
     50 done
     51 
     52 eval `grep SRC_PATH= config-host.mak`
     53 
     54 old_allowed_dif=`grep -v -e 'List of comma-separated changed AML files to ignore' ${SRC_PATH}/tests/qtest/bios-tables-test-allowed-diff.h`
     55 
     56 echo '/* List of comma-separated changed AML files to ignore */' > ${SRC_PATH}/tests/qtest/bios-tables-test-allowed-diff.h
     57 
     58 echo "The files were rebuilt and can be added to git."
     59 echo "You can use ${SRC_PATH}/tests/data/acpi/disassemle-aml.sh to disassemble them to ASL."
     60 
     61 if [ -z "$old_allowed_dif" ]; then
     62     echo "Note! Please do not commit expected files with source changes"
     63     echo "Note! Please follow the process documented in ${SRC_PATH}/tests/qtest/bios-tables-test.c"
     64 fi