From: Andrey Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Add testpci command (v2)
Date: Thu, 11 Oct 2012 06:54:44 +0400 [thread overview]
Message-ID: <1349924084.1949.4.camel@opensuse.site> (raw)
In-Reply-To: <20121011002145.GV2289@earth.li>
В Ср., 10/10/2012 в 17:21 -0700, Jonathan McDowell пишет:
> On Thu, Sep 27, 2012 at 02:42:11PM -0700, Jonathan McDowell wrote:
> > I have a machine with both Linux and Windows installed on the hard
> > drive. Linux runs on the bare metal and I occasionally run the Windows
> > install in a VM using KVM pointed at /dev/sda. However if I'm not quick
> > enough, or Windows decides to reboot when I'm not around to notice, the
> > grub running under KVM will decide to boot Linux and much confusion
> > ensues.
> >
> > I couldn't find an easy way to test what the running environment was, so
> > I knocked up a simple testpci command that allows me to test for the
> > existence of a PCI device and change the default boot option based on
> > that. I have:
> >
> > | if testpci 8086:1237; then
> > | set default="2"
> > | fi
> >
> > in my grub.cfg to correctly select the Windows partition if the qemu
> > provided host bridge is present.
>
> So, a v2, changing to use --vendor/--product and also adding
> --subvendor/--subproduct as it was pointed out to me that the subsystem
> information can be used to confirm the hypervisor presence. I now have:
>
> | if testpci --vendor=0x8086 --subvendor=0x1af4 --subproduct=0x1100; then
> | set default="2"
> | fi
>
> which looks for an Intel device that has a Red Hat / KVM subsystem ID.
>
Could you also add minimal documentation for it? Otherwise nobody will
even know that command exists :(
next prev parent reply other threads:[~2012-10-11 2:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 21:42 [PATCH] Add testpci command Jonathan McDowell
2012-09-28 1:14 ` Seth Goldberg
2012-09-28 1:16 ` Seth Goldberg
2012-09-28 12:10 ` Andrey Borzenkov
2012-09-28 16:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-09-28 16:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-10-11 0:21 ` [PATCH] Add testpci command (v2) Jonathan McDowell
2012-10-11 2:54 ` Andrey Borzenkov [this message]
2012-10-12 22:18 ` [PATCH] Add testpci command (v3) Jonathan McDowell
2013-01-20 22:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-01-25 5:12 ` [PATCH] Add testpci command (v4) Jonathan McDowell
2013-01-25 5:22 ` Andrey Borzenkov
2013-01-25 8:42 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-01-25 10:06 ` Andrey Borzenkov
2013-01-28 6:47 ` [PATCH] Add testpci command (v5) Jonathan McDowell
2013-04-05 8:26 ` [PATCH] Add testpci command (v4) Vladimir 'φ-coder/phcoder' Serbinenko
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=1349924084.1949.4.camel@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
/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.