Commit Graph

157 Commits

Author SHA1 Message Date
David E. O'Brien
1ff2ab846d Better to just statically set the name vs. determine at run time. 2008-05-11 17:23:57 +00:00
David E. O'Brien
228a522072 Clean up several instances of SADE calling itself sysinstall.
(do so generically so the same set of changes can be applied to sysinstall)
2008-05-11 07:13:08 +00:00
Mike Makonnen
cc63a90dc8 o Change the warning dialog for the 'W' command in both the label
and partition editors to reflect the fact that this is a stand-alone
  application, not sysinstall(8).
o Change an instance of sade(8) refering to itself as sysinstall(8) in
  a confirmation dialog.

MFC after: 1 week
2008-05-05 06:31:41 +00:00
Xin LI
c7d9f7f033 Make sade(8) WARNS=3 clean. 2006-08-08 13:45:46 +00:00
Alexander Leidinger
2e14ff0f41 Say welcome to 'sade', the SysAdmins Disk Editor. It's the fdisk and disklabel part
of sysinstall. So sysinstall may retire now, we have the important non-install part
of it covered.

ATM it doesn't understand GEOM stuff (like mirror, stripe, raid, ...), but patches
to change this and to clean it up internally are more than welcome.

Submitted by:	mami@nyitolap.hu
2006-08-07 23:35:49 +00:00
Colin Percival
256c62e23f Only set the size of /usr to whatever-is-left is whatever-is-left is
greater than the size we autosized.  Without this fix, systems with
drives under 10GB can end up with very small /usr partitions...

Broken since:	January 2002
Tripped over by: simon
2006-03-24 22:45:24 +00:00
John Baldwin
9d4514b0fd Fix numerous warnings. Aside from menu items in system.c and menu.c
this now compiles on i386 with WARNS?= 3.  Most of the fixes included
adding missing 'static' keywords to internal functions, using fully-defined
terminators in statically defined arrays of structs, and various
signed vs unsigned mismatches.  Also G/C'd unused configSecurity()
function.
2006-02-28 21:49:33 +00:00
Ceri Davies
17418fea72 On i386, 7.0 requires 106MB on /usr. 6.0 requires 101MB.
Bump USR_MIN_SIZE to 128MB, so that an auto-layout install won't fail
due to /usr being too small.

MFC After:	8 days
2005-12-30 21:45:10 +00:00
Colin Percival
398b037d7d Change the default partition sizing code in order to
1. Provide larger /, /var, and /tmp partitions (the last increase was
in 2001, and we now have both larger hard drives and more space-hungry
software.)
2. If there is enough space available, allocate extra space to /var
sufficient to store a crash dump.

On systems where harddrivesize > 3 * RAMsize + 10GB, the default sizes
will now be as follows:
swap	RAMsize * 2
/ 	512 MB
/tmp	512 MB
/var	1024 MB + RAMsize
/usr	the rest (8GB or more)

On systems where harddrivesize > RAMsize / 8 + 2 GB, the default sizes
will be in the following ranges, with space allocated proportionally:
swap	RAMsize / 8 -- RAMsize * 2
/	256 MB	    -- 512 MB
/tmp	128 MB      -- 512 MB
/var	128 MB      -- 1024 MB
/usr	1536 MB     -- 8192 MB

On systems with even less disk space, the existing behaviour is not
changed.

Approved by:	re (kensmith)
MFC after:	1 day
		(or once people stop arguing about colours of paint)
2005-08-16 13:19:17 +00:00
Marcel Moolenaar
2508030586 Create an EFI partition when the user wants auto defaults. There's
some confusion as to how large the EFI system partition should be,
but 100MB seems to be either the maximum, the minimum or the default
size, so make the EFI partition 100MB.
2004-08-07 04:03:18 +00:00
Marcel Moolenaar
e66a84ac14 o Save pointers to the chunks for root, home, swap, usr, var and tmp in
global variables. On ia64, save a pointer to the efi chunk as well.
o  At the same time, change checkLabels() to define these globals instead
   of having the caller of checkLabels() pass addresses to variables for
   these. Change the two callers correspondingly.
o  Spent a bit more time adjusting try_auto_label() to prepate for having
   the EFI partition created on ia64.
o  Remove efi_mountpoint(). The EFI chunk is now available without having
   to iterate over the disks and chunks to find it every time we need it.
o  On ia64, now that the root chunk is globally available, set the
   vfs.root.mountfrom tunable in loader.conf. This avoids that one cannot
   boot into FreeBSD after an install. The kernel cannot find the root
   device without a little help...
2004-08-07 01:19:54 +00:00
Marcel Moolenaar
711cc43515 Pass the partition type to get_mountpoint() and new_part(). This way
we'll actually create an EFI partition with a FAT file system instead
of an UFS file system. It also allows us to give a sensible default
mount point for EFI partitions so that people don't have to guess.
This also means that we can now remove new_efi_part(), which did the
same thing as new_part(), except it created a FAT file system. The
function wasn't called when the EFI partition was created from scratch
though, which was the problem. By passing the partition type to the
various functions, we can deal with EFI without having to duplicate
code.
2004-08-04 05:40:15 +00:00
Marcel Moolenaar
498609452e Move the inclusion of libdisk.h from sysinstall.h to the source files
that actually need it. This makes it easier for a platform porter to
find the files that may need tweaking to support whatever MD specific
partitioning is needed. It also helps to prevent that the libdisk API
gets exposed and/or used where it's not needed.
2004-08-02 23:18:48 +00:00
Peter Grehan
ee607da1b8 Mods for powerpc.
Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
2004-05-15 05:06:19 +00:00
John Baldwin
707e509a1e Change libdisk and sysinstall to use d_addr_t rather than u_long for disk
addresses.  For arch's with 64-bit longs, this is a nop, but for i386 this
allows sysinstall to properly handle disks and filesystems > 1 TB.

Changes from the original patch include:
- Use d_addr_t rather than inventing a blkcnt type based on int64_t.
- Use strtoimax() rather than strtoull() to parse d_addr_t's from config
  files.
- Use intmax_t casts and %jd rather than %llu to printf d_addr_t values.

Tested on:	i386
Tested by:	kuriyama
Submitted by:	julian
MFC after:	1 month
2004-03-16 17:07:06 +00:00
Marcel Moolenaar
16918a3363 o Don't tell that there's such a thing as a C suffix for specifying
a partition size on ia64. It's not true.
o  Ask for a mountpoint for EFI partitions as well and check that it
   isn't "/".
o  On ia64 we may need to add EFI partitions. Make sure we pass the
   right arguments to Create_Chunk_DWIM() in that case.
2003-11-04 02:04:36 +00:00
Marcel Moolenaar
697defc485 o Add PART_EFI so that we can use it instead of PART_FAT on ia64
to better deal with the fact that we need an EFI partition and
   that we need to have a mountpoint for it.
o  When creating a new partition, add EFI to the list of types
   the user can select from. This makes it easy to create an EFI.
o  Do not include wizard.c on ia64.
o  The user cannot create a partition on ia64 that's a multiple of
   the cylinder size. We don't have a notion of cyclinders.
2003-11-02 08:58:57 +00:00
Marcel Moolenaar
f7da19f20b o Compile-out "wizard" mode on ia64.
o  Also allow swap and filesystem partitions outside a freebsd slice.
   This is typically the case for GPT.
o  Allow chunks of type "whole" to be displayed at the top. This is
   to allow a GPT disk to be labeled. We need a slice out of which we
   can make partitions, but a GPT disk doesn't have slices. For GPT
   disks a chunk of type "whole" can then be used as a placeholder.
2003-11-01 20:14:06 +00:00
Peter Wemm
5e8db10ac1 Add __amd64__ ifdefs to enable the bootblock handling code, slices, etc.
Approved by:	re (murray)
Obtained from:	obrien
2003-05-24 21:12:14 +00:00
Robert Watson
b5abb6e6b0 Don't use UFS2 by default during the install process on PC98, as the
PC98 boot blocks don't support UFS2.  We keep newfs(8) defaulting to
UFS2.

Warn users that FreeBSD can only boot from a root file system smaller
than 1.5TB; hopefully this will get fixed by the patches currently
floating around on -CURRENT.

Reviewed by:	nyan
2003-04-21 20:57:20 +00:00
Robert Watson
b459937e0c Throw the switch--change to UFS2 as our default file system format for
FreeBSD 5.1-RELEASE and later:

- newfs(8) will now create UFS2 file systems unless UFS1 is specifically
  requested (-O1).  To do this, I just twiddled the Oflag default.

- sysinstall(8) will now select UFS2 as the default layout for new
  file systems unless specifically requested (use '1' and '2' to change
  the file system layout in the disk labeler).  To do this, I inverted
  the ufs2 flag into a ufs1 flag, since ufs2 is now the default and
  ufs1 is the edge case.  There's a slight semantic change in the
  key behavior: '2' no longer toggles, it changes the selection to UFS2.

This is very similar to a patch David O'Brien sent me at one point, and
that I couldn't find.

Approved by:	re (telecon)
Reviewed by:	mckusick, phk, bmah
2003-04-20 14:08:05 +00:00
Matthew Dillon
e027a83457 Change the nominal swap calculation from 1/2 physical memory to 1/8
physical memory.  The default is still 2x physical memory.  The nominal
calculation is used to back-off swap auto-allocation ('A'uto command)
when the disk is not large enough to accomodate all filesystem auto-defaults.
This gives other partitions (like /usr) more priority over swap on smaller
disks.

This should help solve reported auto-sizing failures on machines with small
hard drives and huge amounts of memory.  For example, a machine with 2G of
disk and 4G of memory will fail to auto-size without this fix.

MFC after:	3 days
2003-01-25 19:32:35 +00:00
Robert Watson
1fb6584d21 Since our default boot block now supports UFS1 and UFS2 even on
i386, remove the seatbelt preventing users from setting the UFS2 flag
on the root file system on i386.  This seatbelt did not exist on
other platforms.

MFC candidate.
2002-12-28 23:33:09 +00:00
Jun Kuriyama
b3e8a7eb8f Update ROOT_MIN_SIZE for i386 to 118MB (and other ROOT_*_SIZE). 2002-12-15 12:05:00 +00:00
Poul-Henning Kamp
b6cf3e46b4 When things get bigger than 99GB our fields run over.
Use GB from 100GB and upwards.

Approved by:	re
2002-12-11 17:36:34 +00:00
Robert Watson
bf1e70b230 Reformulate how sysinstall handles file system options in the label
editor, in order to support specifying UFS2 as a newfs option.

(1) Support three different newfs types: NEWFS_UFS, NEWFS_MSDOS, and
    NEWFS_CUSTOM.  Don't mix up the arguments to them: you can't use
    soft updates on an msdos file system.

(2) Distinguish adding new arguments to the newfs command line from
    replacing it.  Permit the addition of new arguments by the user for
    NEWFS_UFS.  If we entirely replace the command line provided by
    sysinstall, call it NEWFS_CUSTOM.  'N' will now add additional
    arguments; 'Z' will opt to replace the newfs command line entirely,
    but will prompt the user with their current command line as a
    starting point.

(3) Construct the newfs command line dynamically based on the options
    provided by the user at label-time.  Right now, this means selecting
    UFS1 vs. UFS2, and the soft updates flag.  Drop in some variables
    to support ACLs and MAC Multilabel in the future also, but don't
    expose them now.

This provides sysinstall with the ability to do more "in band" editing
of the newfs command line, so we can provide more support for the user,
but doesn't sacrifice the ability to entirely specify the newfs command
line of the user is willing to give up on the cushiness factor.  It
also makes it easier for us to specify defaults in the future, and
define conditional behavior based on user configuration selections.
For now, we default to UFS1, and permit UFS2 to be used as the root
only on non-i386 systems.

While I was there, I dropped the default fragment and block sizes,
since newfs has much more sensible defaults now.

Reviewed by:	jhb, marcel
Approved by:	re
ia64 bits from:	marcel
2002-12-03 22:25:47 +00:00
John Baldwin
7382b0bfa5 If the user choose to Undo everything in the label editor, only run the
fdisk editor if WITH_SLICES.  Before this on arch's that didn't support
slices such as alpha and sparc64 you would drop into the fdisk editor after
doing an Undo in the label editor.

Approved by:	re
2002-11-27 19:46:18 +00:00
Marcel Moolenaar
658b45adb4 Add conditional code specific to ia64 to allow newfs(8)-ing FAT
partitions marked as being of type efi. This change adds code to
1. actually run the newfs command at mount time (install.c),
2. display the newfs state on screen (label.c)
3. allow toggling of the newfs state (label.c)

Even though newfs(8)-ing FAT partitions can be of use on i386
machines in general, it has been opted to minimize impact for
now.
2002-11-14 01:46:20 +00:00
Marcel Moolenaar
df81b3e662 Also test for type efi everywhere we currently test for type fat.
With this change there's no a priori difference between EFI and
FAT partitions. With this change and the corresponding change to
libdisk, we can create EFI partitions, just like regular FAT
partitions.
2002-11-13 05:39:59 +00:00
John Baldwin
8af5a8f998 Use a clean flags variable when creating chunks from scripts instead of
leaking flags from earlier chunks into later ones.

PR:		bin/40655
Submitted by:	Thomas Zenker <thz@Lennartz-electronic.de>
2002-11-12 21:18:54 +00:00
John Baldwin
e324564167 Remove a line that set the status to success. We already do that at the
beginning, so the best this could achieve would be to mask an earlier
failure.  Break instead of continue for another failure case.
2002-11-12 21:12:42 +00:00
John Baldwin
f193ff8342 Try to cleanup the non-interactive disk labeling code a bit. Rework
the loop that runs through the environment variables to be a bit more
intuitive.  Also, change some 'continue's in failure cases to 'break's
instead.  If we are going to fail, we should just do it.

PR:		bin/40654
Submitted by:	Thomas Zenker <thz@Lennartz-electronic.de> (partially)
2002-11-12 21:09:58 +00:00
John Baldwin
1a91c66103 Do a bit of cleanup. new_part() basically ignored the passed in size
argument as of revision 1.52 (July 12, 1996, about a month after I
graduated from high school) when 'newfs -u' support was axed, so remove it.
This also allows us to remove a hack in the create partition case where we
created the partition twice since we didn't have the size the first time.
2002-11-12 20:48:49 +00:00
John Baldwin
ff02a1197f Doh, fix a bug in previous commit. The default is to newfs for new
partitions, not to !newfs.
2002-11-12 20:40:15 +00:00
John Baldwin
a872d3c73b When setting the mountpoint name, remember any previous setting of the
newfs flag for this partition.

PR:		bin/31837
Reported by:	Oliver Breuninger <ob@www.partner.de>
2002-11-12 20:26:52 +00:00
Thomas Moestl
b95b5e06d0 The hw.physmem sysctl has an unsigned long value now, fix the retrieval
to match that.
2002-11-02 17:19:18 +00:00
Poul-Henning Kamp
6c47398ce1 With the recent libdisk changes, alpha doesn't need (as much) special magic. 2002-10-30 20:55:25 +00:00
Poul-Henning Kamp
39da086a6b Sparc64 will not need the same hacks as alpha did. Hopefully alpha wont
need them either.
2002-10-29 07:38:05 +00:00
David E. O'Brien
eec2e4bdde * Negative #if's are harder to read as they don't tell exactly what arch
something applies to.  So change #ifndef to an explicit list of defines.
* Treate sparc64 and ia64 as 64-bit platforms, which means larger roots.
* sparc64 should halt back to the firmware, not reset.
* sparc64 doesn't need to play MS-DOS/BIOS partition crap games.

Reviewed by:	jake
2002-10-11 22:30:09 +00:00
John Baldwin
2a0eb0b58c Fix a bug where request_part_size() was hard-coded to check the rootSize
variable rather than the one passed in as the first argument.

Sponsored by:	The Weather Channel
2002-06-07 15:32:05 +00:00
John Baldwin
df349781bf Add a 'diskInteractive' variable that can be set to interactively partition
and label a disk from a sysinstall script.
2002-05-31 13:38:17 +00:00
Murray Stokely
7cdcc9fecd Fix a signal 11 error that occurs if you try to use the 'T' option on
an existing FreeBSD partition.

Reported by:	Brent Cook <busterb@mail.utexas.edu>
2002-01-29 22:35:40 +00:00
Matthew Dillon
7cf138022c Add 'R'ecover option that deletes a partition and attempts
to recover its space into the previous partition.  Revert 'D'elete
to not attempt to recover any space.

Do not auto-create /home as per release engineers decision (though
I think this is a mistake).  However, all of this code will be
replaced later on anyway either with Jordan's stuff or with
some other sort of templater, so it isn't a big deal.
2002-01-07 07:51:24 +00:00
Jordan K. Hubbard
f3c7fb1696 Enable soft updates by default for everything but the root filesystem.
The user can still toggle it back off in the label editor (or post-install
for that matter) if they explicitly do not want soft updates to be used
for some reason.

Agreed to be a good thing by:	kirk
2001-12-20 23:39:30 +00:00
Matthew Dillon
b706fc664f cleanup 2001-12-10 02:18:05 +00:00
Matthew Dillon
173592263d Add auto-fill-on-delete. When deleting an 'A'uto created partition
sysinstall will automatically expand the previous partition to take up
the freed up space.  So you can 'D'elete /home and /usr will get the
combined space, or you can 'D'elete /tmp and /var will get the combined space.

This gives the user, developer, or lay person a huge amount of flexibility
in constructing partitions from an 'A'uto base.  It takes only 3 or 4
keystrokes to achieve virtually any combination of having or not having
a /tmp and/or /home after doing an 'A'uto create.

Change 'A'uto creation of /var/tmp to 'A'uto creation /tmp, which should
be less controversial.

MFC after:	6 days
2001-12-09 23:40:02 +00:00
Matthew Dillon
06f33c6e7a Cleanup sysinstall's 'A'uto partitioning mode to provide more reasonable
defaults both in regards to the size of the partitions that are created
and in regards to safety and functional separation.

Still TODO: extend the previous partition to cover a deleted partition
if the previous partiton was auto-created, and supply some sort of
solution for /tmp.

Reviewed by:	Just about everyone
Approved by:	Nobody except maybe my pet mouse fred
Obtained from:	God, so complain to HIM
MFC after:	1 week
2001-12-09 09:47:09 +00:00
David E. O'Brien
557f299a51 Tweak the Alpha partition warning wording and comment a little. 2001-07-13 16:45:00 +00:00
David E. O'Brien
224b4c7715 Rudamentary attempt to reconize when `a' is not the first partition on the
Alpha.  (the Alpha will not boot except from the first partition)

PR:		23064
Submitted by:	Kees Jan Koster <kjkoster@kjkoster.org>
2001-07-13 16:37:03 +00:00
Jordan K. Hubbard
69a66c62c2 Make soft updates option print more nicely and stop overflow of
right-hand margin when set in 2nd column.  Also do a small amount of
code cleanup.
2001-05-06 02:52:45 +00:00