Carlos Perez
Carlos Perez

Reputation: 13

Read keyboard input in linux kernel boot

I compiled linux kernel and I added a message ("Hi, press any key to continue..") to boot process, using pr_alert() function, is working fine, but I need to detect when a keyboard key is pressed to continue with boot process, I don't know what function I can use. please help.

Upvotes: 0

Views: 743

Answers (1)

user149341
user149341

Reputation:

You don't. Blocking for user input should be handled by userspace applications.

If you want to prompt the user for input during startup, you can do this in an init script, possibly in an initrd.

If you need to allow the user to supply configuration information to the kernel, you can do that by accepting a kernel command-line parameter.

Upvotes: 1

Related Questions