Commit Graph

72 Commits

Author SHA1 Message Date
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
Simon J. Gerraty
3caf0790a8 Merge head@256284 2013-10-13 02:35:19 +00:00
Simon J. Gerraty
34b33809b7 Updated dependencies 2013-10-13 00:24:00 +00:00
Nathan Whitehorn
8d795806e9 Add installer support for CHRP/PAPR PowerPC systems that use MBR+BSD
formatting, like x86, but with an additional MBR slice containing a raw
boot partition.

Approved by:	re (gjb)
2013-09-23 14:18:34 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Baptiste Daroussin
76f8eb196c Fix bindings of keys when in the partition editor. By adding the usual input binding to the "partlist" sub window.
This is a workaround, as for unknown yet reason the keys binded on the Partition Edition window are the one from partlist instead of the one from standard "formfield"

Reported by:	alfred, nwhitehorn
2013-06-17 15:16:14 +00:00
Antoine Brodin
290b7b224a Add some missing DPADD. 2013-05-11 13:46:05 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien
d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Nathan Whitehorn
f0ddc92d27 Improve error handling and remove an unnecessary check on geom provider
type. GEOM provider names can't duplicate (or shouldn't -- devfs will either
break or only use the first one if they do) so using the first provider
by that name is a sufficient check. This also lets the scripted partitioner
install onto gmirror and geli and such things.
2013-01-22 17:06:28 +00:00
Nathan Whitehorn
a6b612e920 If no partition configuration is specified in {}, use the automatic setup
the interactive installer uses.

Example: bsdinstall scriptedpart ada0
Result: Use entire disk for a FreeBSD system with default partition layout
2013-01-20 23:04:21 +00:00
Nathan Whitehorn
5eca7e06a1 Add a simple scripted partitioner. Documentation and more scripting support
will come soon. This lets the install process have a line like:

bsdinstall scriptedpart 'ada0 GPT {1.5G freebsd-ufs /, 10G freebsd-swap,
    auto freebsd-ufs /usr}'

to set up a system with a 1.5GB /, some swap space, and a /usr using the
rest of ada0.

MFC after:	1 month
2013-01-20 22:25:58 +00:00
Nathan Whitehorn
c4bd43b00b Make "Finish" the default choice in the partition editor. This lets you
successfully complete an installation with all defaults by pressing
Enter repeatedly until your machine reboots.

MFC after:	3 weeks
2013-01-20 03:55:08 +00:00
Joel Dahl
0510534298 Remove EOL whitespace. 2013-01-12 08:44:54 +00:00
Nathan Whitehorn
ec8edf9362 Make sade actually be a symlink to partedit, as per the commit message in
r244859, rather than a hardlink. This fixes installation if /usr/sbin
is on a different filesystem than /usr/libexec.

Submitted by:	se
2013-01-02 13:25:11 +00:00
Nathan Whitehorn
2befb3613f Add a man page for the new sade(8), which is mostly the same uninformative
manpage as the old sade(8).
2012-12-30 14:44:14 +00:00
Nathan Whitehorn
934f522a9f Replace sade the extracted piece of sysinstall with sade the extracted
piece of bsdinstall (although this time with a symlink instead of duplicated
source code).

Discussed on:	freebsd-geom
MFC after:	3 months
2012-12-30 14:35:00 +00:00
Nathan Whitehorn
4f5fcf8d00 If invoked as sade, don't complain about having a filesystem on / already
-- it's something you expect (and indeed hope for).

MFC after:	1 week
2012-12-30 14:33:16 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Eitan Adler
3f0d78d510 Remove variables which are initialized but never used thereafter reported by gcc46 warning
Approved by:	cperciva
MFC After:	3 days
2012-06-19 06:09:47 +00:00