[ipxe-devel] Allow user to edit a kernel command line before booting with a read timeout

Matteo Guglielmi Matteo.Guglielmi at dalco.ch
Fri Apr 23 15:06:24 UTC 2021


Just for the record,

thanks to Michael the read function is now patched and this is a working
snippet that makes use of it (the || operator after the read function is
necessary to avoid script failures when the timeout occurs):


set menu-timeout 1000
set read-timeout 1000
set menu-default localboot

... your menu items here

choose --timeout ${menu-timeout} --default ${menu-default} selected || exit
echo -n Enter label: ${}
read --timeout ${read-timeout} selected ||
goto ${selected}



________________________________
From: Michael Brown <mcb30 at ipxe.org>
Sent: Friday, April 23, 2021 1:43:33 PM
To: Matteo Guglielmi; IPXE-DEV
Subject: Re: [ipxe-devel] Allow user to edit a kernel command line before booting with a read timeout

On 23/04/2021 11:46, Matteo Guglielmi wrote:
> Would it be possible to ask for a read --timeout option
> in order to automate the following script (unattended
> boot)?
>
> set cmdline selinux=0 console=ttyS0,115200n8 console=tty0
> echo -n Kernel command line: ${}
> read --timeout 5 cmdline
> chain http://my.web.server/vmlinuz ${cmdline}

Done:

   https://github.com/ipxe/ipxe/commit/b2501dd12
   https://github.com/ipxe/ipxe/commit/323af9ee8

The timeout is in milliseconds (for consistency with all other iPXE
--timeout options).

Michael


More information about the ipxe-devel mailing list