Commit Graph

93 Commits

Author SHA1 Message Date
Justin Hibbits
60f18ad0b4 Add partition scheme for mpc85xx devices
Some mpc85xx devices with u-boot need MBR partitioning with a FAT boot
partition.  Since the infrastructure is already in place to have a dedicated
boot partition, this adds the necessary bits to use that infrastructure with
mpc85xx boards.

Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15664
2018-06-07 00:24:10 +00:00
Nathan Whitehorn
8c7de243f4 Fix math error in the computation of the free space after the last partition
on a disk. This resulted in one sector always remaining free at the end.

PR:		bin/228322
Submitted by:	Rikiya Yonemoto
MFC after:	2 weeks
2018-05-18 17:43:15 +00:00
Ed Maste
4a8b3e41f5 bsdinstall: enable SUJ by default (revert r327890)
fsck should be fixed as of r328092.

PR:		225110
Tested by:	dumbbell, Arshan Khanifar <arshankhanifar gmail.com>
2018-01-25 19:57:21 +00:00
Ed Maste
643139e5b1 bsdinstall: disable SUJ by default
SUJ + cg checksums produce spurious warnings after an unclean shutdown
(e.g. a crash).  For now disable SUJ for UFS installs so installing from
a FreeBSD 12 snapshot results in a usable filesystem, until this can be
fixed.

PR:		225110
Submitted by:	Arshan Khanifar <arshankhanifar gmail.com>
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13890
2018-01-12 20:25:57 +00:00
Nathan Whitehorn
8befcf7be1 Add installer support for PS3 and PowerNV systems, also laying the
foundation for invoking efibootmgr as part of new-style EFI booting on
x86. On PS3 and PowerNV, which are booted using Linux kexec from petitboot
rather than by loader(8), install the kernel and the rest of /boot to a
FAT partition and set up the appropriate petitboot configuration file
there.

The new bootconfig installer stage can do platform-dependent modifications
more complex than partition layout and installation of boot blocks and can
be used to (as here) set up some special configuration files, run efibootmgr,
or boot0cfg.

MFC after:	1 month
2018-01-02 05:27:24 +00:00
Nathan Whitehorn
9f7602f019 Teach bsdinstall partedit/sade how to format FAT partitions on GPT, which
have the partition type code "ms-basic-data".

MFC after:	2 weeks
2017-12-31 03:13:45 +00:00
Nathan Whitehorn
6134b18696 Fix bug introduced in r326674, in which efi boot partitions created by
the installer but not mounted (i.e. with boot1.efifat dd'ed to them
rather than the forthcoming proper filesystem) would get newfs_msdos run
on them immediately after the boot code was copied. This would overwrite
the bootstrap code, causing the EFI system partition to be blanked and
resulting in an unbootable system.

PR:		224562
2017-12-28 01:21:30 +00:00
Nathan Whitehorn
52f39da1f8 Support mounted boot partitions in the installer. This allows the platform
layer, for example, to specify that the EFI boot partition should be
mounted at /efi and formatted normally with newfs_msdos rather than
splatted to from /boot/boot1.efifat.

This commit adds only the API for this; actual platform use will come later.
2017-12-08 00:57:13 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Ravi Pokala
40f0d8dc4a When doing a non-interactive installation, don't display an interactive
warning about a filesystem which doesn't have a mountpoint. Presumably, the
person who wrote the install script knew what they were doing.

Submitted by:	Brian Mueller <bmueller@panasas.com>
MFC after:	1 month
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D12346
2017-09-12 22:19:21 +00:00
Ed Maste
c0fcb86aee bsdinstall: correct comment after r320007
Submitted by:	vangyzen
2017-06-16 19:26:33 +00:00
Ed Maste
4ca43ae5f2 bsdinstall: use consistent EFI configuration across platforms
- increase arm64 EFI partition to 200M, as x86
- use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86
- increase ZFS EFI partition to 200M

PR:		201898
Reviewed by:	allanjude, manu
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11239
2017-06-16 18:58:48 +00:00
Enji Cooper
ab9ff47abc sade(8): start new sentence on new line
Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:50:42 +00:00
Enji Cooper
d6f6b20128 style(9): sort headers
MFC after:	2 weeks
MFC with:	r318693
Sponsored by:	Dell EMC Isilon
2017-05-23 06:05:54 +00:00
Enji Cooper
d547c56fdf Some minor style(9) fixes
- Wrap at <80 columns.
- Sort by type

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 06:04:38 +00:00
Marcelo Araujo
63128851f3 Use nitems() from sys/param.h.
Reviewed by:	ngie
MFC after:	2 weeks.
Differential Revision:	https://reviews.freebsd.org/D9942
2017-05-03 14:03:46 +00:00
Conrad Meyer
6c546e77b6 bsdinstall(8): Sprinkle a snprintf to fixed size buffer
Use a snprintf to write an environment variable to a fixed-size buffer to
avoid stack overflow.

Reported by:	Coverity (CWE-120)
CID:		1238926
Sponsored by:	Dell EMC Isilon
2017-04-14 00:36:45 +00:00
Rodney W. Grimes
ce9f2d31b3 Convert absolute links to relative links.
Style.Makefile(9) has been ignored to produce minimal diffs.

Approved by:	grehan (mentor)
MFC after:	1 week
2017-03-07 05:10:38 +00:00
Ravi Pokala
0ee82391df Fix indentation (only line in file w/ 8-space indent rather than hard-tab).
MFH:		1 week
2017-02-08 00:02:54 +00:00
Yoshihiro Takahashi
2b375b4edd Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes:	yes
2017-01-28 02:22:15 +00:00
Wojciech Macek
e24e98d090 bsdinstall: add warning when unsupported partition is modified
Right now is possible to modify bootable partition type to
non-bootable type without getting warning from partedit.
Example: if you auto parition drive for arm64, you will
get freebsd-ufs as bootable partition; now you are able
to change bootable partition type to freebsd-zfs; there
will be no warning and the system will install but
will not be bootable afterwards.

After this fix, partedit will issue the same warning it
does when user attempts to create bootable partition of
not supported type, notyfing a user about incoming
problem and allowing to think the decision over before
commiting the schema.

This has been tested on amd64 and arm64.

Obtained from:         Semihalf
Submitted by:          Dominik Ermel <der@semihalf.com>
Sponsored by:          Cavium
Reviewed by:           nwhitehorn
Differential Revision: https://reviews.freebsd.org/D6879
2016-09-05 08:42:36 +00:00
Dag-Erling Smørgrav
47ead00d5b Ensure that the sector size is a multiple of 4096 to avoid creating
unaligned partitions when the actual sector size is hidden from us.

PR:		211361
MFC after:	3 days
2016-08-15 09:30:21 +00:00
Ed Maste
5fafcca757 bsdinstall: increase EFI partition size to 200MB
A larger EFI file system size will facilitate multi-boot configurations
and the installation other EFI applications like firmware update tools.
200MB matches OS X.

Note that this changes only the partition size, not the file system that
bsdinstall places there. We need to do both, but as the partition size
is difficult to adjust later make this change for now so that at least
systems installed with FreeBSD 11.0 have a partition layout with room
to grow.

Reviewed by:	allanjude, imp
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6935
2016-06-23 18:04:48 +00:00
Wojciech Macek
0fbcaf7657 ARM64: bsdinstall support for creating EFI partitions
This patch enables bsdinstall to create EFI partition during installation and uploading it's contents,
    making the ARM64 FreeBSD installation bootable.

    Obtained from:         Semihalf
    Sponsored by:          Cavium
    Approved by:           re
    Reviewed by:           allanjude, emaste, nwhitehorn, wma
    Differential Revision: https://reviews.freebsd.org/D6853
2016-06-20 06:40:58 +00:00
Ed Schouten
4e7e2cad09 Remove unportable calls to basename().
The POSIX version of basename() doesn't use a 'const char *' argument;
the function may overwrite its input buffer. Instead of copying the
input string, let's just simplify this code by using our getprogname()
function that already returns the name of the application in the right
format.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D6094
2016-04-26 10:04:06 +00:00
Bryan Drewery
7fdd45b091 Use LIBEXECDIR for /usr/libexec.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-26 01:14:40 +00:00
Allan Jude
7059fa6ff8 Add support for two workarounds for known issues booting GPT in legacy mode on some hardware
For Lenovo laptops with buggy bios (x220, t420, t520):
	Write the 0xee entry into the second slot in the pmbr instead of the first

For some Dell and HP models:
	The BIOS gives a warning message when booting in legacy mode from a GPT partitioned disk where the 0xee partition in the pmbr is not flagged active
	For models known to have this problem, mark the pmbr active during installation

Use smbios data to identify machines known to be affected by any of the above, and offer the user the option to apply the workaround

In bsdinstall's ufs auto mode (autopart partition wizard):
	Allow users to select which type of partition table to use
	Keep current defaults: MBR for BIOS, GPT for UEFI
	This allows users to choose GPT for legacy boot if they wish

PR:		184910
PR:		194359
Reviewed by:	Michael Dexter
Approved by:	marcel
MFC after:	3 days
X-MFC-With:	r285594
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3091
2015-07-18 18:49:44 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Nathan Whitehorn
04e98a3724 Use MBR by default on BIOS systems. An increasing number of motherboards
assume that GPT means UEFI boot, resulting in the installation of
uninstallable systems. This needs a little more work before MFC, in
particular based on disk size (> 2 TB + BIOS + MBR is not workable). That
will come soon.
2015-01-30 21:22:18 +00:00
Baptiste Daroussin
c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Nathan Whitehorn
403a3c8c82 Only allow ZFS boot on GPT; the MBR ZFS bootblocks cannot be installed using
gpart bootcode as /boot/zfsboot needs to be split into multiple pieces by
hand and copied to different areas of the partition.
2014-10-12 17:59:31 +00:00
Nathan Whitehorn
be01d6e9f2 Centralize determination of boot firmware (UEFI vs. BIOS/CSM) into a
function x86_bootmethod() and fix deviations from style(9).
2014-10-12 17:50:25 +00:00
Nathan Whitehorn
6e15678a47 Add ZFS support to the bsdinstall partition editor and sade.
Submitted by:	Kurt Lidl (original version)
MFC after:	6 weeks
2014-09-13 18:24:54 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Nathan Whitehorn
963ae465d5 Allow up to 512K for boot code on GPT with BIOS. As pmbr.s says in a comment,
"545K should be enough for any boot code". This rounds down slightly.

Reported by:	Matthew Fuller
MFC after:	2 weeks
2014-07-11 23:41:56 +00:00
Nathan Whitehorn
1ee0f08975 After EFI support was added to the installer, it needed to allow boot
partitions of types other than "freebsd-boot" (in particular, "efi").
This allows the removal of some nasty hacks for supporting PowerPC systems,
in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific
code on MBR.

This changes the installer to use the correct names, which also breaks a
degeneracy in the meaning of "freebsd-boot" that allows the addition
of support for some newer IBM systems that can boot from GPT in addition to
MBR. Since I have no idea how to detect which those systems are, leave
the default on IBM PPC systems as MBR for now.
2014-07-04 15:55:32 +00:00
Baptiste Daroussin
01c2b8ac0d use .Mt to mark up email addresses consistently (part2)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:57:27 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Brooks Davis
525e2a83f6 Revert r261296. This removes the WITHOUT_NCURSESW option.
It was the wrong direction.  We will instead remove use of the
non-wide-character supporting libncurses.
2014-05-15 16:44:25 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Nathan Whitehorn
235591a578 Finish connecting up installer UEFI support. If the kernel was booted using
EFI, set up the disks for an EFI system. If booted from BIOS/CSM, set up
for BIOS.
2014-04-27 15:58:07 +00:00
Nathan Whitehorn
6b446ed5ab Add EFI support to the installer. This requires that the kernel provide
a sysctl to determine what firmware is in use. This sysctl does not exist
yet, so the following blocks are in front of the wheels:
- I've provisionally called this "hw.platform" after the equivalent thing
  on PPC
- The logic to check the sysctl is short-circuited to always choose BIOS.
  There's a comment in the top of the file about how to turn this off.

If IA64 acquired a boot1.efifat-like thing (probably with very few
modifications), the same code could be adapted there.
2014-04-26 16:55:38 +00:00
Brooks Davis
38e233371c Merge from CheriBSD:
commit c1acf022c5
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Jan 17 21:46:44 2014 +0000

    Add an option WITHOUT_NCURSESW to suppress building and linking to
    libncursesw.  While wide character support it useful we'd like to
    only need one ncurses library on embedded systems.

MFC after:	4 weeks
Sponsored by:	DARPA, AFRL
2014-01-30 21:08:36 +00:00