summaryrefslogtreecommitdiffstats
path: root/sbin/disklabel/editor.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Recycle four ancient fields in the disklabel structure, replacing them withderaadt2009-06-041-60/+5
| | | | | | | | | | | | bounds information, ie. the zone of the disk that OpenBSD can use. Have each pre-disklabel parser (MBR, DPME, or per-arch MD disklabel parsers) figure out this area and pass it up to userland. Then, delete all the same disk parsing code from disklabel(8) since the kernel passes it up. Lots and lots of - signs in the disklabel(8) code. Tested on as many platforms as possible, the fallout will be repaired as time goes on. To test, use disklabel -d <drive> and validate that the bounds do not overlap any boot blocks. This same information is used by disklabel -A... OK for the concept from krw, miod, and drahn
* remove unused variablechl2009-06-021-3/+2
| | | | ok krw@
* Add '-h' flag, and '*' as a unit specifier for 'p' Editor command.krw2009-06-021-13/+4
| | | | | | | | | Both cause partition sizes to be displayed using a human readable format with the units automatically chosen by looking at the smallest partition in the disk label. Remove forceable humanization in 'A' code and use '-h' in install scripts. Prodded & ok deraadt@, verbiage tweaks from jmc@
* Always show the start and end of the OpenBSD area in units ofkrw2009-05-311-4/+4
| | | | sectors, not any 'human' unit in force.
* Clean up logic around exit values. Make getasciilabel() return 0krw2009-05-291-5/+5
| | | | | | | | | | for success. Fix a couple of bugs where errors in checklabel() got lost. Make Editor 'q' and 'x' commands exit with 0 (ok) rather than 1. i.e. non-zero exit value now reserved for failure, not a decision to leave the disklabel unchanged. This allows the install script to use the exit value to catch failures to write a disklabel.
* No need to write mount point info twice in 'w' command in Editor.krw2009-05-171-4/+2
|
* Write out mountpoint info in writelabel() after label successfullykrw2009-05-171-4/+2
| | | | | | | | written, rather than every time editor_alloc() is called. Respect '-n' for mountpoint info. Reduces surprise appearance of files when you 'x' out of Editor. "my sunglasses did not go dark" deraadt@
* Initialize mountpoints[] when going past again:, since akrw2009-05-171-2/+6
| | | | | | | | smaller alloc table will have fewer mountpoints and the extras cause confusion. And any info from '/etc/fstab' that was loaded into mountpoints needs to be zapped too. Noticed by jim@
* The auto-allocator does not remember to increase the d_npartitions fieldderaadt2009-05-131-2/+3
| | | | | | | as it adds partitions. What the heck. Set it to MAXPARTITIONS. That is the new way we are treating d_npartitions everywhere in any case. It is the max a label can support. partitions which are not there mark themselves off. ok krw
* Set D_VENDOR when spoofing a label on archs that use D_VENDOR whenkrw2009-05-131-4/+4
| | | | | | | | | | reading the native disklabel. This ensures cylinder alignment. Fix disklabel to do cylinder alignment arithmetic correctly in -A mode. Worked by accident before, since the code was protected by D_VENDOR, which wasn't being set. ok deraadt@
* Various mount point handling fixes, most originally from halex@.krw2009-05-121-75/+70
| | | | | | | | | | | | | Don't do fstabfile check everywhere. Always allocate and handle mount point arrays. Use fstabfile to control 'n' command and writing mount point info. Since mount points are primed from /etc/fstab now, prime origmountpoints so 'U' works. 'D' and 'z' now free current mount point info. 'U' will not lose undo info when repeatedly invoked. 'n' accepts existing mount point name as valid.
* Make sure last, catch-all, auto-allocated partition ends on akrw2009-05-111-2/+10
| | | | | | | | | | cylinder boundary if SUN_CYLCHECK is defined. Don't bother rounding any partition size to cylinder boundary if SUN_CYLCHECK is not defined. Should fix warning message on sparc64 noticed by dlg@. ok deraadt@
* very long lines in comments are uglyderaadt2009-05-111-6/+7
|
* Always save an fstab file, even if it is empty; ok krwderaadt2009-05-111-8/+4
|
* Prevent the entry of duplicate mount points while in Editor mode.krw2009-05-031-3/+12
| | | | ok deraadt@
* Tune the medium profile to provide more /usr space as 'requested' by beckderaadt2009-05-031-5/+5
| | | | | also make the %'s add up to 100 again, which was part of the problem ok krw otto
* in the big configuration, tune /tmp so that it scales up a bit slower,deraadt2009-04-301-4/+5
| | | | | and benefit /home in exchange ok otto
* KNFderaadt2009-04-291-3/+6
|
* increase the max for medium a bit, so e.g. a 6GB disk gets fully usedotto2009-04-291-4/+4
|
* adjust the numbers for the "big" auto-allocation scheme with ottoderaadt2009-04-261-15/+16
|
* Adjust the medium auto scale after looking at how it performs between thederaadt2009-04-261-8/+8
| | | | low and high ends of the disk sizes it applies to; with otto
* smarter auto-allocation; numbers needs tweaking, but we are gettingotto2009-04-261-21/+82
| | | | closer, ok deraadt@ krw@
* Fix 'n' (name mountpoint) Editor command. The check for the presencekrw2009-04-261-3/+3
| | | | of the -f flag was reversed.
* Unrevert reversion of r1.192. This time make sure 'aflag' is treatedkrw2009-04-231-9/+12
| | | | | | | | | | the same way 'dflag' is treated. i.e. reset it when the label is written out so a 'w' followed by a 'q' exits the editor without further questions. Also set it whenever the 'A' command is executed. Suggestions by Alexander Hall. ok deraadt@
* No this change is wrong, because now 'w' followed by 'q' asks if youderaadt2009-04-201-4/+3
| | | | | are sure. This will require another solution, based perhaps on comparing against an earlier form of the label
* Alexander Hall points out that disklabel -AE <disk> followed by quittingsthen2009-04-181-3/+4
| | | | | | without making manual changes does not ask whether you'd like to save the new automatic disklabel. Change to follow the behaviour of -d and ask every time. ok krw@.
* When auto-allocating, check the size of the disk and displaykrw2009-04-121-2/+9
| | | | | offset/size information in MB if the disk is <10G, and in GB otherwise. '-p' will override this default.
* Always display any mountpoint info available. Thus a simple -A willkrw2009-04-111-9/+6
| | | | | | now show the planned mountpoint layout. ok deraadt@
* Treat the list of auto-allocation partitions as a priority list andkrw2009-04-111-8/+4
| | | | | stop auto-allocation as soon as a partition can't fit. Eliminate the 'no space to allocate ...' messages.
* allow /usr/local to be up to 5MB in auto mode; ok krwderaadt2009-04-101-3/+3
|
* Re-work '-A' so that it sets a flag that -E and -w use, and which willkrw2009-04-101-157/+170
| | | | | | | | | | | | | | | just display the auto-allocation plan otherwise. Don't overwrite any spoofed partitions, insert auto allocated partitions where we can. This is much more install script and weird architecture friendly. I'm talking about you, macppc. Many suggestions and code from otto@, feedback from many, cattle prod applied by deraadt@. ok deraadt@ "if it works for >8GB ... put it in" miod@ "to be clear, ok" todd@
* Translate the size values in the auto-allocate table from blocks tokrw2009-04-041-30/+32
| | | | | sectors at runtime instead of constantly converting the sector values in the label to blocks. Adjust names accordingly. No functional change.
* Bring comment into line with other docs. -E(dit) is not just forkrw2009-04-031-3/+3
| | | | new labels.
* Oops. Document new 'U' editor command in '?' output too.krw2009-03-301-8/+9
| | | | Prodded by & ok jmc@
* lint; mostly unused variables, carefully checked against all platformsderaadt2009-03-301-6/+6
|
* otto points out that the -v printing changes are incompatible with thederaadt2009-03-291-6/+4
| | | | | expectation that -R will read the output of disklabel. I suspect we will find another way to do this; ok otto
* do not crash when no mountpoints, spotted by otto; ok krwderaadt2009-03-281-3/+4
|
* Move some output under the control of the '-v' flag. In particular onlykrw2009-03-281-4/+6
| | | | | | | display the partition info by default as is done in the E(ditor). The physical info is now only displayed if '-v' is specified. ok deraadt@
* Add 'U' command to E(ditor). It reverts label to state it was inkrw2009-03-281-71/+64
| | | | | | | | | | | when entering E(ditor) mode. Clean up 'u' code and make more effort to keep label and mountpoint info in sync. Makes 'u' undo-able so those with vi fingers can apply and revert changes (with perhaps a 'p' or two in between) to validate changes. 'U' suggested by deraadt@. ok deraadt@
* for A, use real megs and gigs (power of 2 based); adapt the table tootto2009-03-281-18/+20
| | | | include /usr/src and /usr/obj plus some tweaks; ok deraadt@ krw@
* let u (undo) work for the A command; ok krwderaadt2009-03-221-2/+4
|
* Add 'A' command to Editor mode, and -A flag to automatically execute itkrw2009-03-221-20/+153
| | | | | | | | | on disks without an existing label. The 'A' command allocates all space on the disk into a reasonable partition scheme for a root disk. Feedback from several, time to work on it in-tree. Prodded (repeatedly) by and ok deraadt@
* "Numer of " -> "Number of ". Typo from r1.1.krw2009-03-071-3/+3
|
* On *ppc disks shared with MacOS, walk the Apple partition map to find outmiod2009-01-111-8/+23
| | | | | | | the bounds of the OpenBSD area. Should prevent users from shooting themselves in the feet. ok krw@
* clean up find_bounds(), no binary change; 'dead initialisation' llvm/clang; ok krw millertcnst2008-12-071-8/+7
|
* fix an 11-year-old typo in an if statement; 'null dereference' llvm/clang; ok millertcnst2008-12-071-3/+3
|
* Missing break in case statement.jsg2008-09-031-2/+3
|
* add missing space.sobrado2008-08-101-3/+3
| | | | ok krw@
* Shorten the lines of '?' output in edit mode. A couple were tookrw2008-08-101-12/+12
| | | | | | long (>76 chars) for the install script space on the CD jackets. Requested by deraadt@.
* In interactive mode, always suggest offsets and sizes inside theotto2008-06-251-8/+61
| | | | | | | OpenBSD area and change the 'p' command to only print the boundaries and size of the OpenBSD area and the free space within that area. Introduce a 'l' command to print the header only. With krw@; ok krw@ deraadt@; jmc@ for the man page bits