Bug 192962 - Boot loader too large with Aug-11 FreeBSD/i386 11-CURRENT snapshot
Summary: Boot loader too large with Aug-11 FreeBSD/i386 11-CURRENT snapshot
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: John Baldwin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-24 09:19 UTC by Joel Dahl
Modified: 2014-09-06 15:26 UTC (History)
3 users (show)

See Also:


Attachments
bootmethod_i386.patch (551 bytes, patch)
2014-08-27 20:57 UTC, John Baldwin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Dahl freebsd_committer 2014-08-24 09:19:48 UTC
Today I installed 11-CURRENT from the 20140811 FreeBSD/i386 snapshot on my IBM T43 laptop but encountered some problems. The memstick installation went fine and I pretty much used default values everywhere, but upon reboot I get ”Boot loader too large”. Nothing more.

The freebsd-boot partition seems to be too big, so I had to manually resize it to 512k with gpart[*] after the installation. The default value was 800. It booted OK after this change.

This is really annoying. Manual tinkering shouldn't be required IMHO. Why isn't it set to 512k by default if it works?

The handbook (2.6.3) says the following: ”the freebsd-boot partition should be no larger than 512K due to current boot code limitations”. So it feels weird that the installer chooses a different value.

[*] gpart resize -i 1 -s 512k ada1
Comment 1 John Baldwin freebsd_committer freebsd_triage 2014-08-25 20:14:58 UTC
Can you provide the output of 'gpart show'?  It would be nice to see it before you fixed it, but even now it might be useful to see how large the "hole" is between the end of your freebsd-boot partition and the start of the next partition.

Note that the maximum size for the boot partition was recently changed from 64k to 512k in http://svnweb.freebsd.org/base?view=revision&revision=268540, but that size should be fine.
Comment 2 Nathan Whitehorn freebsd_committer 2014-08-25 20:18:35 UTC
The issue here is that bsdinstall made an 800 KB partition because it thinks the system booted by UEFI. Part of this is lazy coding on my part, which can be fixed, but the problem is triggered by the fact that the i386 kernel does not expose the machdep.bootmethod sysctl that the amd64 one does. I can fix this in bsdinstall, but we may also want to provide the same sysctl on i386 for consistency.
Comment 3 Joel Dahl freebsd_committer 2014-08-26 19:15:12 UTC
OK, so I'll wait for a patch from Nathan.
Comment 4 John Baldwin freebsd_committer freebsd_triage 2014-08-27 20:57:16 UTC
Created attachment 146407 [details]
bootmethod_i386.patch

This adds machdep.bootmethod for i386.  It is hardcoded to BIOS for now.  PC98 might also need this?
Comment 5 Nathan Whitehorn freebsd_committer 2014-08-27 21:15:19 UTC
Comment on attachment 146407 [details]
bootmethod_i386.patch

Looks good to me.
Comment 6 Nathan Whitehorn freebsd_committer 2014-08-27 21:17:22 UTC
(In reply to Nathan Whitehorn from comment #5)
> Comment on attachment 146407 [details]
> bootmethod_i386.patch
> 
> Looks good to me.

Also, PC98 doesn't need that because it doesn't use the same installer bits.
Comment 7 commit-hook freebsd_committer 2014-08-29 21:09:08 UTC
A commit references this bug:

Author: jhb
Date: Fri Aug 29 21:08:41 UTC 2014
New revision: 270826
URL: http://svnweb.freebsd.org/changeset/base/270826

Log:
  MFamd64: Add a machdep.bootmethod sysctl to inform the installer which
  firmware method was used for booting.  This is hardcoded to BIOS on i386.

  PR:		192962
  Reviewed by:	nwhitehorn
  MFC after:	1 week

Changes:
  head/sys/i386/i386/machdep.c
Comment 8 John Baldwin freebsd_committer freebsd_triage 2014-08-29 21:15:07 UTC
Committed to HEAD.
Comment 9 commit-hook freebsd_committer 2014-09-06 15:15:46 UTC
A commit references this bug:

Author: jhb
Date: Sat Sep  6 15:15:06 UTC 2014
New revision: 271191
URL: http://svnweb.freebsd.org/changeset/base/271191

Log:
  MFC 270826:
  MFamd64: Add a machdep.bootmethod sysctl to inform the installer which
  firmware method was used for booting.  This is hardcoded to BIOS on i386.

  PR:		192962
  Approved by:	re (gjb)

Changes:
_U  stable/10/
  stable/10/sys/i386/i386/machdep.c
Comment 10 John Baldwin freebsd_committer freebsd_triage 2014-09-06 15:26:54 UTC
Merged to 10.