2 # Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates
3 # This work is licensed under the terms of the GNU GPL, version 2 or later.
4 # See the COPYING file in the top-level directory.
6 # Author: dgilbert@redhat.com
8 ASMFILE
=$PWD/tests
/migration
/x86-a-b-bootblock.s
9 HEADER
=$PWD/tests
/migration
/x86-a-b-bootblock.h
11 if [ ! -e "$ASMFILE" ]
13 echo "Couldn't find $ASMFILE" >&2
17 ASM_WORK_DIR
=$
(mktemp
-d --tmpdir X86BB.XXXXXX
)
19 as
--32 -march=i486
"$ASMFILE" -o x86.o
&&
20 objcopy
-O binary x86.o x86.boot
&&
21 dd if=x86.boot of
=x86.bootsect bs
=256 count
=2 skip
=124 &&
23 sed -e 's/.*int.*//' > x86.hex
&&
24 cat - x86.hex
<<HERE > "$HEADER"
25 /* This file is automatically generated from
26 * tests/migration/x86-a-b-bootblock.s, edit that and then run
27 * tests/migration/rebuild-x86-bootblock.sh to update,
28 * and then remember to send both in your patch submission.
32 rm x86.hex x86.bootsect x86.boot x86.o
33 cd ..
&& rmdir "$ASM_WORK_DIR"