summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/label.c
Commit message (Collapse)AuthorAgeFilesLines
* Increase USR_MIN_SIZE to 160 because it requires more disk space.nyan2006-11-281-1/+1
| | | | MFC after: 3 days
* Only set the size of /usr to whatever-is-left is whatever-is-left iscperciva2006-03-241-0/+1
| | | | | | | | 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
* Fix numerous warnings. Aside from menu items in system.c and menu.cjhb2006-02-281-1/+0
| | | | | | | | 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.
* On i386, 7.0 requires 106MB on /usr. 6.0 requires 101MB.ceri2005-12-301-1/+1
| | | | | | | 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
* Change the default partition sizing code in order tocperciva2005-08-161-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Create an EFI partition when the user wants auto defaults. There'smarcel2004-08-071-0/+22
| | | | | | 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.
* o Save pointers to the chunks for root, home, swap, usr, var and tmp inmarcel2004-08-071-57/+52
| | | | | | | | | | | | | | | 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...
* Pass the partition type to get_mountpoint() and new_part(). This waymarcel2004-08-041-61/+29
| | | | | | | | | | | | 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.
* Move the inclusion of libdisk.h from sysinstall.h to the source filesmarcel2004-08-021-0/+1
| | | | | | | 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.
* Mods for powerpc.grehan2004-05-151-0/+30
| | | | Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
* Change libdisk and sysinstall to use d_addr_t rather than u_long for diskjhb2004-03-161-32/+37
| | | | | | | | | | | | | | | | 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
* o Don't tell that there's such a thing as a C suffix for specifyingmarcel2003-11-041-7/+22
| | | | | | | | 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.
* o Add PART_EFI so that we can use it instead of PART_FAT on ia64marcel2003-11-021-25/+52
| | | | | | | | | | 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.
* o Compile-out "wizard" mode on ia64.marcel2003-11-011-4/+26
| | | | | | | | | 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.
* Add __amd64__ ifdefs to enable the bootblock handling code, slices, etc.peter2003-05-241-1/+1
| | | | | Approved by: re (murray) Obtained from: obrien
* Don't use UFS2 by default during the install process on PC98, as therwatson2003-04-211-0/+4
| | | | | | | | | | | 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
* Throw the switch--change to UFS2 as our default file system format forrwatson2003-04-201-7/+21
| | | | | | | | | | | | | | | | | | | | 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
* Change the nominal swap calculation from 1/2 physical memory to 1/8dillon2003-01-251-1/+1
| | | | | | | | | | | | | | 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
* Since our default boot block now supports UFS1 and UFS2 even onrwatson2002-12-281-7/+2
| | | | | | | | 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.
* Update ROOT_MIN_SIZE for i386 to 118MB (and other ROOT_*_SIZE).kuriyama2002-12-151-4/+4
|
* When things get bigger than 99GB our fields run over.phk2002-12-111-5/+20
| | | | | | Use GB from 100GB and upwards. Approved by: re
* Reformulate how sysinstall handles file system options in the labelrwatson2002-12-031-50/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* If the user choose to Undo everything in the label editor, only run thejhb2002-11-271-0/+2
| | | | | | | | 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
* Add conditional code specific to ia64 to allow newfs(8)-ing FATmarcel2002-11-141-2/+48
| | | | | | | | | | | 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.
* Also test for type efi everywhere we currently test for type fat.marcel2002-11-131-1/+1
| | | | | | | 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.
* Use a clean flags variable when creating chunks from scripts instead ofjhb2002-11-121-3/+2
| | | | | | | leaking flags from earlier chunks into later ones. PR: bin/40655 Submitted by: Thomas Zenker <thz@Lennartz-electronic.de>
* Remove a line that set the status to success. We already do that at thejhb2002-11-121-2/+1
| | | | | beginning, so the best this could achieve would be to mask an earlier failure. Break instead of continue for another failure case.
* Try to cleanup the non-interactive disk labeling code a bit. Reworkjhb2002-11-121-49/+39
| | | | | | | | | 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)
* Do a bit of cleanup. new_part() basically ignored the passed in sizejhb2002-11-121-19/+11
| | | | | | | 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.
* Doh, fix a bug in previous commit. The default is to newfs for newjhb2002-11-121-1/+1
| | | | partitions, not to !newfs.
* When setting the mountpoint name, remember any previous setting of thejhb2002-11-121-2/+7
| | | | | | | newfs flag for this partition. PR: bin/31837 Reported by: Oliver Breuninger <ob@www.partner.de>
* The hw.physmem sysctl has an unsigned long value now, fix the retrievaltmm2002-11-021-1/+1
| | | | to match that.
* With the recent libdisk changes, alpha doesn't need (as much) special magic.phk2002-10-301-35/+0
|
* Sparc64 will not need the same hacks as alpha did. Hopefully alpha wontphk2002-10-291-4/+4
| | | | need them either.
* * Negative #if's are harder to read as they don't tell exactly what archobrien2002-10-111-5/+5
| | | | | | | | | 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
* Fix a bug where request_part_size() was hard-coded to check the rootSizejhb2002-06-071-1/+1
| | | | | | variable rather than the one passed in as the first argument. Sponsored by: The Weather Channel
* Add a 'diskInteractive' variable that can be set to interactively partitionjhb2002-05-311-2/+4
| | | | and label a disk from a sysinstall script.
* Fix a signal 11 error that occurs if you try to use the 'T' option onmurray2002-01-291-1/+2
| | | | | | an existing FreeBSD partition. Reported by: Brent Cook <busterb@mail.utexas.edu>
* Add 'R'ecover option that deletes a partition and attemptsdillon2002-01-071-3/+14
| | | | | | | | | | 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.
* Enable soft updates by default for everything but the root filesystem.jkh2001-12-201-1/+1
| | | | | | | | 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
* cleanupdillon2001-12-101-7/+7
|
* Add auto-fill-on-delete. When deleting an 'A'uto created partitiondillon2001-12-091-21/+35
| | | | | | | | | | | | | | | | 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
* Cleanup sysinstall's 'A'uto partitioning mode to provide more reasonabledillon2001-12-091-112/+243
| | | | | | | | | | | | | | 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
* Tweak the Alpha partition warning wording and comment a little.obrien2001-07-131-5/+5
|
* Rudamentary attempt to reconize when `a' is not the first partition on theobrien2001-07-131-1/+23
| | | | | | | Alpha. (the Alpha will not boot except from the first partition) PR: 23064 Submitted by: Kees Jan Koster <kjkoster@kjkoster.org>
* Make soft updates option print more nicely and stop overflow ofjkh2001-05-061-5/+8
| | | | | right-hand margin when set in 2nd column. Also do a small amount of code cleanup.
* Remove now obsolete check for root filesystems > cyl 1024. The bootjkh2001-05-031-14/+4
| | | | | | loader can handle such cases. Noted by: olgeni
* Bump the default / size up another 10MB to 120MB.obrien2001-04-051-1/+1
| | | | Requested by: jhb
* Fix a bug with setting the soft updates option from a script.jkh2001-03-231-4/+3
| | | | | | Eliminate an old warning brought about by insufficient foresight when creating the Menu structure. Have I ever mentioned that sysinstall really needs to be rewritten?
* Really finish softupdate setting from the label editor and fixjkh2001-03-121-16/+20
| | | | | | | | | | a few cosmetic problems: o Allow it to work with scripts (see man page or install.cfg file). o Preserve old softupdates flag across newfs toggles o Clean up partitioned/labelled flag handling o Don't ask for MBR choice again if you've already written it out. o Actually document the new features.
OpenPOWER on IntegriCloud