From: TJ <grub-devel@iam.tj>
To: grub-devel@gnu.org
Subject: How to receive notification of a new (disk) device being connected?
Date: Thu, 28 Apr 2016 14:03:27 +0100 [thread overview]
Message-ID: <3df1c98b8135d4f64b0f9c3a8fa02df6@iam.tj> (raw)
I'm currently finalising a patch that adds key-file support to
cryptodisk::cryptomount and luks.
As well as being able to grub_device_iterate(hook,...) to search the
existing devices for the key-file the code needs to wait for TIMEOUT
seconds for additional (usually USB Mass Storage) devices to be
connected and when they are search them for the key-file.
Is there an existing mechanism to receive such notifications, or a
blocking call that returns if a device is connected or a timeout is hit?
Otherwise it looks like I'll have to track which devices are connected
when the TIMEOUT loop is first entered, grub_sleep(), then
grub_device_iterate() and see if the device list has any new entries.
Secondly: am I correct to think using grub_search_fs_file(keyfile_name,
variable_name, ...) is the correct way to search for the key-file across
all devices, or do I need to use a specific hint type to indicate all
devices should be searched?
next reply other threads:[~2016-04-28 13:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 13:03 TJ [this message]
2016-04-28 17:55 ` How to receive notification of a new (disk) device being connected? Andrei Borzenkov
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=3df1c98b8135d4f64b0f9c3a8fa02df6@iam.tj \
--to=grub-devel@iam.tj \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).