aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sade/label.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace sade the extracted piece of sysinstall with sade the extractedNathan Whitehorn2012-12-301-1646/+0
| | | | | | | | | | | piece of bsdinstall (although this time with a symlink instead of duplicated source code). Discussed on: freebsd-geom MFC after: 3 months Notes: svn path=/head/; revision=244859
* Spelling fixes for usr.sbin/Ulrich Spörlein2011-12-301-8/+8
| | | | Notes: svn path=/head/; revision=228990
* Forgot to add usr.sbin/sade/label.c in the previous commit.Dimitry Andric2011-12-181-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=228683
* Port to new libdialog.Max Khon2011-11-241-9/+11
| | | | Notes: svn path=/head/; revision=227944
* Disk selection dialog is now a normal menu, not a checkboxed menu:Max Khon2011-11-241-165/+106
| | | | | | | | checkboxed menu is confusing and also can not be implemented in new libdialog. Notes: svn path=/head/; revision=227939
* Better to just statically set the name vs. determine at run time.David E. O'Brien2008-05-111-1/+1
| | | | Notes: svn path=/head/; revision=178946
* Clean up several instances of SADE calling itself sysinstall.David E. O'Brien2008-05-111-1/+1
| | | | | | | (do so generically so the same set of changes can be applied to sysinstall) Notes: svn path=/head/; revision=178940
* o Change the warning dialog for the 'W' command in both the labelMike Makonnen2008-05-051-7/+4
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=178769
* Make sade(8) WARNS=3 clean.Xin LI2006-08-081-1/+1
| | | | Notes: svn path=/head/; revision=161099
* Say welcome to 'sade', the SysAdmins Disk Editor. It's the fdisk and ↵Alexander Leidinger2006-08-071-8/+3
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=161060
* Only set the size of /usr to whatever-is-left is whatever-is-left isColin Percival2006-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 Notes: svn path=/head/; revision=157107
* Fix numerous warnings. Aside from menu items in system.c and menu.cJohn Baldwin2006-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. Notes: svn path=/head/; revision=156123
* On i386, 7.0 requires 106MB on /usr. 6.0 requires 101MB.Ceri Davies2005-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 Notes: svn path=/head/; revision=153910
* Change the default partition sizing code in order toColin Percival2005-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) Notes: svn path=/head/; revision=149136
* Create an EFI partition when the user wants auto defaults. There'sMarcel Moolenaar2004-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. Notes: svn path=/head/; revision=133246
* o Save pointers to the chunks for root, home, swap, usr, var and tmp inMarcel Moolenaar2004-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... Notes: svn path=/head/; revision=133241
* Pass the partition type to get_mountpoint() and new_part(). This wayMarcel Moolenaar2004-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. Notes: svn path=/head/; revision=133106
* Move the inclusion of libdisk.h from sysinstall.h to the source filesMarcel Moolenaar2004-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. Notes: svn path=/head/; revision=133040
* Mods for powerpc.Peter Grehan2004-05-151-0/+30
| | | | | | | Submitted by: Suleiman Souhlal <refugee@segfaulted.com> Notes: svn path=/head/; revision=129259
* Change libdisk and sysinstall to use d_addr_t rather than u_long for diskJohn Baldwin2004-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 Notes: svn path=/head/; revision=127081
* o Don't tell that there's such a thing as a C suffix for specifyingMarcel Moolenaar2003-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. Notes: svn path=/head/; revision=122021
* o Add PART_EFI so that we can use it instead of PART_FAT on ia64Marcel Moolenaar2003-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. Notes: svn path=/head/; revision=121890
* o Compile-out "wizard" mode on ia64.Marcel Moolenaar2003-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. Notes: svn path=/head/; revision=121864
* Add __amd64__ ifdefs to enable the bootblock handling code, slices, etc.Peter Wemm2003-05-241-1/+1
| | | | | | | | Approved by: re (murray) Obtained from: obrien Notes: svn path=/head/; revision=115293
* Don't use UFS2 by default during the install process on PC98, as theRobert Watson2003-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 Notes: svn path=/head/; revision=113826
* Throw the switch--change to UFS2 as our default file system format forRobert Watson2003-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 Notes: svn path=/head/; revision=113751
* Change the nominal swap calculation from 1/2 physical memory to 1/8Matthew Dillon2003-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 Notes: svn path=/head/; revision=109827
* Since our default boot block now supports UFS1 and UFS2 even onRobert Watson2002-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. Notes: svn path=/head/; revision=108373
* Update ROOT_MIN_SIZE for i386 to 118MB (and other ROOT_*_SIZE).Jun Kuriyama2002-12-151-4/+4
| | | | Notes: svn path=/head/; revision=107902
* When things get bigger than 99GB our fields run over.Poul-Henning Kamp2002-12-111-5/+20
| | | | | | | | | Use GB from 100GB and upwards. Approved by: re Notes: svn path=/head/; revision=107751
* Reformulate how sysinstall handles file system options in the labelRobert Watson2002-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 Notes: svn path=/head/; revision=107565
* If the user choose to Undo everything in the label editor, only run theJohn Baldwin2002-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 Notes: svn path=/head/; revision=107341
* Add conditional code specific to ia64 to allow newfs(8)-ing FATMarcel Moolenaar2002-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. Notes: svn path=/head/; revision=106885
* Also test for type efi everywhere we currently test for type fat.Marcel Moolenaar2002-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. Notes: svn path=/head/; revision=106839
* Use a clean flags variable when creating chunks from scripts instead ofJohn Baldwin2002-11-121-3/+2
| | | | | | | | | | leaking flags from earlier chunks into later ones. PR: bin/40655 Submitted by: Thomas Zenker <thz@Lennartz-electronic.de> Notes: svn path=/head/; revision=106830
* Remove a line that set the status to success. We already do that at theJohn Baldwin2002-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. Notes: svn path=/head/; revision=106828
* Try to cleanup the non-interactive disk labeling code a bit. ReworkJohn Baldwin2002-11-121-48/+38
| | | | | | | | | | | | 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) Notes: svn path=/head/; revision=106827
* Do a bit of cleanup. new_part() basically ignored the passed in sizeJohn Baldwin2002-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. Notes: svn path=/head/; revision=106826
* Doh, fix a bug in previous commit. The default is to newfs for newJohn Baldwin2002-11-121-1/+1
| | | | | | | partitions, not to !newfs. Notes: svn path=/head/; revision=106823
* When setting the mountpoint name, remember any previous setting of theJohn Baldwin2002-11-121-2/+7
| | | | | | | | | | newfs flag for this partition. PR: bin/31837 Reported by: Oliver Breuninger <ob@www.partner.de> Notes: svn path=/head/; revision=106822
* The hw.physmem sysctl has an unsigned long value now, fix the retrievalThomas Moestl2002-11-021-1/+1
| | | | | | | to match that. Notes: svn path=/head/; revision=106348
* With the recent libdisk changes, alpha doesn't need (as much) special magic.Poul-Henning Kamp2002-10-301-35/+0
| | | | Notes: svn path=/head/; revision=106224
* Sparc64 will not need the same hacks as alpha did. Hopefully alpha wontPoul-Henning Kamp2002-10-291-4/+4
| | | | | | | need them either. Notes: svn path=/head/; revision=106115
* * Negative #if's are harder to read as they don't tell exactly what archDavid E. O'Brien2002-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 Notes: svn path=/head/; revision=104940
* Fix a bug where request_part_size() was hard-coded to check the rootSizeJohn Baldwin2002-06-071-1/+1
| | | | | | | | | variable rather than the one passed in as the first argument. Sponsored by: The Weather Channel Notes: svn path=/head/; revision=98018
* Add a 'diskInteractive' variable that can be set to interactively partitionJohn Baldwin2002-05-311-2/+4
| | | | | | | and label a disk from a sysinstall script. Notes: svn path=/head/; revision=97667
* Fix a signal 11 error that occurs if you try to use the 'T' option onMurray Stokely2002-01-291-1/+2
| | | | | | | | | an existing FreeBSD partition. Reported by: Brent Cook <busterb@mail.utexas.edu> Notes: svn path=/head/; revision=89968
* Add 'R'ecover option that deletes a partition and attemptsMatthew Dillon2002-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. Notes: svn path=/head/; revision=88996
* Enable soft updates by default for everything but the root filesystem.Jordan K. Hubbard2001-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 Notes: svn path=/head/; revision=88321
* cleanupMatthew Dillon2001-12-101-7/+7
| | | | Notes: svn path=/head/; revision=87583