[ipxe-devel] menu-timeout

Matteo Guglielmi Matteo.Guglielmi at dalco.ch
Thu Jan 23 10:55:49 UTC 2020


Currently it's not possible unless the 'read' command

is equipped with a --timeout option (just like 'menu').



This would be extremely helpful since it would allow

ipxe scripts to be executed completely unattended

(taking all the defaults) and, at the same time, give

the possibility to modify anything.



menu....

choose --timeout 1000 --default install selected || exit

echo -n Enter label: ${} && read --timeout 1000 selected

goto ${selected}


:install
set boot-path http://10.123.123.1/fai
initrd ${boot-path}/initrd
kernel ${boot-path}/vmlinuz
set cmdline ip=dhcp root=10.123.123.1:/srv/fai/nfsroot:vers=3 rootovl FAI_FLAGS=verbose,sshd,reboot FAI_ACTION=install consoleblank=0 nomodeset
echo -n Kernel cmdline: ${} && read --timeout 1000 cmdline
imgargs vmlinuz initrd=initrd ${cmdline}


Is it possible to ask for this feature?



Thank you.


________________________________
From: ipxe-devel <ipxe-devel-bounces at lists.ipxe.org> on behalf of Bottom Poster <stappers at stappers.nl>
Sent: Wednesday, January 22, 2020 9:35:53 PM
To: ipxe-devel at lists.ipxe.org
Subject: Re: [ipxe-devel] menu-timeout



In-Reply-To: <8bf4eeb16a364e27aadab1eec0ee5f7a at dalco.ch>
Previous-Subject: Re: [ipxe-devel] Select menu item by typing in its name

On Wed, Jan 22, 2020 at 08:25:17PM +0000, Matteo Guglielmi wrote:
>
> this is an ipxe script which I generate via php.
>
> What I would also need to preserve is the timeout option of
> the choose function so that if I do not type anything, the
> predefined item kicks in.
>
>
> Is this possible or not?

Tell us.

>
> #!ipxe
>
> set menu-timeout 10000
> set menu-default local
> set cluster_name BOB
>
> :start
> menu iPXE boot menu for => ${hostname} <= on ${cluster_name}
> item --gap -- --------------------------------------------------------------------------
> item local local
> item install install
> item rescue rescue
> item rescuerw rescuerw
> item reboot reboot
> item --gap -- --------------------------------------------------------------------------
> choose --timeout ${menu-timeout} --default ${menu-default} selected || exit
> goto ${selected}
>
> :local
> # boot from first drive
> sanboot --no-describe --drive 0x80
>
> :install
> set boot-path http://10.123.123.1/fai
> initrd ${boot-path}/initrd
> kernel ${boot-path}/vmlinuz
> imgargs vmlinuz initrd=initrd ip=dhcp root=10.123.123.1:/srv/fai/nfsroot:vers=3 rootovl FAI_FLAGS=verbose,sshd,reboot FAI_ACTION=install consoleblank=0 nomodeset
> boot
>
> :rescue
> set boot-path http://10.123.123.1/rescue
> initrd ${boot-path}/initramfs
> kernel ${boot-path}/vmlinuz
> imgargs vmlinuz initrd=initramfs root=10.123.123.1:/srv/live/cos8:vers=3 rootovl rootflags=nolock selinux=0 divider=10 elevator=noop preempt=0 rdblacklist=nouveau nouveau.modeset=0 rdblacklist=radeon radeon.modeset=0 consoleblank=0 rdblacklist=ast net.ifnames=0 biosdevname=0 nomodeset
> boot
>
> :rescuerw
> set boot-path http://10.123.123.1/rescue
> initrd ${boot-path}/initramfs
> kernel ${boot-path}/vmlinuz
> imgargs vmlinuz initrd=initramfs root=10.123.123.1:/srv/live/cos8:vers=3 rw rootflags=nolock selinux=0 divider=10 elevator=noop preempt=0 rdblacklist=nouveau nouveau.modeset=0 rdblacklist=radeon radeon.modeset=0 consoleblank=0 rdblacklist=ast net.ifnames=0 biosdevname=0 nomodeset
> boot
>
> :reboot
> reboot
_______________________________________________
ipxe-devel mailing list
ipxe-devel at lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo/ipxe-devel



More information about the ipxe-devel mailing list