Bug 233098 - can not find lua loader
Summary: can not find lua loader
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Many People
Assignee: Kyle Evans
URL: https://reviews.freebsd.org/D36490
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2018-11-09 21:13 UTC by rodriguezjulio86
Modified: 2022-09-18 06:29 UTC (History)
11 users (show)

See Also:
kevans: mfc-stable13+
kevans: mfc-stable12+


Attachments
Screenshot failed boot (85.82 KB, image/jpeg)
2019-03-01 22:48 UTC, Trev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rodriguezjulio86 2018-11-09 21:13:05 UTC
Version 12.0 Beta 3

"Startup error in /boot/lua/loader.lua:
LUA ERROR: Cannot open /boot/lua/loader.lua:
no such file or directory"
"can't load kernel"
Comment 1 Trev 2019-03-01 22:48:19 UTC
Created attachment 202490 [details]
Screenshot failed boot

12-STABLE i386 snapshot ISO of 20190207 installer fails to boot with same ewrror -- see attached screendump.

Hardware: macmini2,1
Comment 2 Trev 2019-12-09 01:31:50 UTC
See: https://forums.freebsd.org/threads/loader-lua-file-not-found-solved.73282/

Issue solved by fiddling with BIOS settings (not applicable to my Mac Mini though).
Comment 3 Ruslan Yakauleu 2020-03-25 16:11:49 UTC
Same issue with 12.1-RELEASE DVD on my notebook Toshiba Satellite L300
BIOS SATA Controller setting doesn't help.
Comment 4 John Murphy 2020-04-13 12:33:39 UTC
Same here. Tried every possible combination on a MBR machine and no success with 12.1
I'll have to move away from BSD soon because I can't risk some kind of failure and then the inability to create a new system to recover my files. 
This will be a great pity because the software is great and the community very helpful. But for me this is a showstopper.
The complete absence of a workaround is really, really surprising.
Comment 5 ArturB 2022-04-02 20:42:56 UTC
I encountered this error recently after upgrading from 13.0* to 13.1 RC1, both by using the 'freebsd-update upgrade' command and then when doing a clean install.

It was on an old laptop with a GELI-encrypted UFS filesystem. Reinstalling 13.0 with the exact same procedure (partitioning, etc.) restores proper functionality.

I can provide reproduction details if instructed exactly about what is needed.
Comment 6 Mark Murray freebsd_committer 2022-08-04 13:07:31 UTC
This breaks installing FBSD on Macs under Parallels.
Comment 7 kearark 2022-08-15 05:29:19 UTC
(In reply to Mark Murray from comment #6)
Same for derivatives like pfSense CE 2.6.0

WORKAROUND:

To fix boot error "cannot open /boot/lua/loader.lua" for FreeBSD 12.3 + pfSense CE 2.6.0, in Parallels Desktop 18, enable EFI in boot flags:

Shutdown VM > edit configuration > Hardware > Boot Order > click "Advanced" button > in boot flags, add `vm.bios.efi=1`.
Comment 8 Kyle Evans freebsd_committer 2022-09-08 00:48:44 UTC
Noted review (https://reviews.freebsd.org/D36490) fixes this at least on Parallels, if other cases are in BIOS boots they could conceivably be hitting the same issue. Let's take over this PR for that specific issue, and if it doesn't end up fixed by that for some set of folks then we'll collect more details.
Comment 9 commit-hook freebsd_committer 2022-09-08 15:05:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=72291cee075d9ef1a608b2a67762b44e024cc0d4

commit 72291cee075d9ef1a608b2a67762b44e024cc0d4
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-09-08 00:35:06 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-09-08 15:05:08 +0000

    stand: i386: take into account disk sector size for blk calculation

    disk_blocks assumes BIOSDISK_SECSIZE, but the media may not be using
    it.  In particular, bioscd on Parallels presents a 2K sector size, so
    we end up with a short disk_blocks and subsequent validation fails when
    trying to read /boot/lua.

    PR:             233098
    Reviewed by:    imp, tsoome
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D36490

 stand/i386/libi386/biosdisk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 10 commit-hook freebsd_committer 2022-09-18 06:27:22 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7e04dc0797f3265a10975cac2670f0407487a925

commit 7e04dc0797f3265a10975cac2670f0407487a925
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-09-08 00:35:06 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-09-18 06:26:40 +0000

    stand: i386: take into account disk sector size for blk calculation

    disk_blocks assumes BIOSDISK_SECSIZE, but the media may not be using
    it.  In particular, bioscd on Parallels presents a 2K sector size, so
    we end up with a short disk_blocks and subsequent validation fails when
    trying to read /boot/lua.

    PR:             233098
    Reviewed by:    imp, tsoome

    (cherry picked from commit 72291cee075d9ef1a608b2a67762b44e024cc0d4)

 stand/i386/libi386/biosdisk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 11 commit-hook freebsd_committer 2022-09-18 06:28:25 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8a832ed2f8c1f87f6461d7a6932cec357b04e538

commit 8a832ed2f8c1f87f6461d7a6932cec357b04e538
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-09-08 00:35:06 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-09-17 19:32:52 +0000

    stand: i386: take into account disk sector size for blk calculation

    disk_blocks assumes BIOSDISK_SECSIZE, but the media may not be using
    it.  In particular, bioscd on Parallels presents a 2K sector size, so
    we end up with a short disk_blocks and subsequent validation fails when
    trying to read /boot/lua.

    PR:             233098
    Reviewed by:    imp, tsoome

    (cherry picked from commit 72291cee075d9ef1a608b2a67762b44e024cc0d4)

 stand/i386/libi386/biosdisk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 12 Kyle Evans freebsd_committer 2022-09-18 06:29:55 UTC
Please open a new report for any similar errors that still reproduce after upcoming snapshots. Thanks!