menu.lua (e9c3ceb159b85a0d75ece181a300cacf779a43de) menu.lua (3244729fbb81868b5e4b84f48e7e2ac11c03817e)
1--
2-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3--
4-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org>
5-- Copyright (C) 2018 Kyle Evans <kevans@FreeBSD.org>
6-- All rights reserved.
7--
8-- Redistribution and use in source and binary forms, with or without

--- 411 unchanged lines hidden (view full) ---

420 end
421 ab = tonumber(ab) or 10
422
423 local x = loader.getenv("loader_menu_timeout_x") or 4
424 local y = loader.getenv("loader_menu_timeout_y") or 23
425
426 local endtime = loader.time() + ab
427 local time
1--
2-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3--
4-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org>
5-- Copyright (C) 2018 Kyle Evans <kevans@FreeBSD.org>
6-- All rights reserved.
7--
8-- Redistribution and use in source and binary forms, with or without

--- 411 unchanged lines hidden (view full) ---

420 end
421 ab = tonumber(ab) or 10
422
423 local x = loader.getenv("loader_menu_timeout_x") or 4
424 local y = loader.getenv("loader_menu_timeout_y") or 23
425
426 local endtime = loader.time() + ab
427 local time
428
428 local last
429 repeat
430 time = endtime - loader.time()
429 repeat
430 time = endtime - loader.time()
431 screen.setcursor(x, y)
432 print("Autoboot in " .. time ..
433 " seconds, hit [Enter] to boot" ..
434 " or any other key to stop ")
435 screen.defcursor()
431 if last == nil or last ~= time then
432 last = time
433 screen.setcursor(x, y)
434 print("Autoboot in " .. time ..
435 " seconds, hit [Enter] to boot" ..
436 " or any other key to stop ")
437 screen.defcursor()
438 end
436 if io.ischar() then
437 local ch = io.getchar()
438 if ch == core.KEY_ENTER then
439 break
440 else
441 -- erase autoboot msg
442 screen.setcursor(0, y)
443 print(string.rep(" ", 80))

--- 13 unchanged lines hidden ---
439 if io.ischar() then
440 local ch = io.getchar()
441 if ch == core.KEY_ENTER then
442 break
443 else
444 -- erase autoboot msg
445 screen.setcursor(0, y)
446 print(string.rep(" ", 80))

--- 13 unchanged lines hidden ---