All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com,
	peter.maydell@linaro.org, wei@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] tests/migration: Add source to PC boot block
Date: Mon, 12 Feb 2018 14:32:27 +0100	[thread overview]
Message-ID: <20180212133227.4lmmxomnddrb2vmt@kamzik.brq.redhat.com> (raw)
In-Reply-To: <20180205181846.29996-1-dgilbert@redhat.com>

On Mon, Feb 05, 2018 at 06:18:46PM +0000, Dr. David Alan Gilbert (git) wrote:
> diff --git a/tests/migration/rebuild-x86-bootblock.sh b/tests/migration/rebuild-x86-bootblock.sh
> new file mode 100755
> index 0000000000..c40f025e1a
> --- /dev/null
> +++ b/tests/migration/rebuild-x86-bootblock.sh
> @@ -0,0 +1,37 @@
> +#!/bin/sh
> +# Copyright (c) 2016 Red Hat, Inc. and/or its affiliates
> +# This work is licensed under the terms of the GNU GPL, version 2 or later.
> +# See the COPYING file in the top-level directory.
> +#
> +# Author: dgilbert@redhat.com
> +
> +ASMFILE=tests/migration/x86-a-b-bootblock.s
> +HEADER=tests/migration/x86-a-b-bootblock.h
> +
> +if [ ! -e "$ASMFILE" ]
> +then
> +  echo "Couldn't find $ASMFILE" >&2
> +  exit 1
> +fi
> +
> +ASM_WORK_DIR=/tmp/X86BB$$

mktemp?

> +mkdir $ASM_WORK_DIR &&
> +as --32 -march=i486 "$ASMFILE" -o $ASM_WORK_DIR/bb.o &&
> +objcopy -O binary $ASM_WORK_DIR/bb.o $ASM_WORK_DIR/bb.boot &&
> +dd if=$ASM_WORK_DIR/bb.boot of=$ASM_WORK_DIR/bb.bootsect \
> +  bs=256 count=2 skip=124 &&
> +xxd -i $ASM_WORK_DIR/bb.bootsect |

Is xxd now considered a common enough tool for portable scripts? I've
always liked xxd for manual use, but scripted with 'od'.

> +sed -e 's/_tmp.*_bootsect/x86_bootsect/' -e 's/.*int.*//' > \
> +  $ASM_WORK_DIR/bb.hex &&
> +cat - $ASM_WORK_DIR/bb.hex <<HERE > "$HEADER"
> +/* This file is automatically generated from
> + * tests/migration/x86-a-b-bootblock.s, edit that and then run
> + * tests/migration/rebuild-x86-bootblock.sh to update,
> + * and then remember to send both in your patch submission.
> + */
> +HERE
> +
> +rm $ASM_WORK_DIR/bb.hex $ASM_WORK_DIR/bb.bootsect $ASM_WORK_DIR/bb.boot
> +rm $ASM_WORK_DIR/bb.o
> +rmdir $ASM_WORK_DIR
> +

Thanks,
drew

  parent reply	other threads:[~2018-02-12 13:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 18:18 [Qemu-devel] [PATCH v2] tests/migration: Add source to PC boot block Dr. David Alan Gilbert (git)
2018-02-09 21:47 ` Wei Huang
2018-02-12 13:32 ` Andrew Jones [this message]
2018-02-12 15:07   ` Dr. David Alan Gilbert
2018-02-12 16:14     ` Wei Huang
2018-02-12 16:32     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180212133227.4lmmxomnddrb2vmt@kamzik.brq.redhat.com \
    --to=drjones@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=wei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.