summaryrefslogtreecommitdiffstats
path: root/sbin/disklabel/editor.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Do not adjust (uhm.. zero) the swap 'b' partition size if physmem isderaadt2021-03-091-2/+2
| | | | | | zero (should not happen, but did), because the auto-allocate code will put a filesystem on that partition. ok otto kurt
* unbreak getline() conversion in disklabelnaddy2021-02-031-5/+6
|
* replace fgetln(3) with getline(3) in disklabelnaddy2021-02-021-14/+12
| | | | | | | Since getline() returns a C string, we don't need to carry around the length separately. ok millert@
* fix mistaken operator precedence in a pointer dereference in disklabelnaddy2021-01-311-3/+3
| | | | ok millert@
* Make /usr maximum 6G and grow it faster; ok lots of devsotto2019-11-191-3/+3
|
* Bump /usr on big auto-allocation table; ok krw@ sthen@ phessler@otto2019-08-211-2/+2
|
* snprintf/vsnprintf return < 0 on error, rather than -1.deraadt2019-07-031-3/+3
|
* Add '*' to disklabel(8) editor prompt when in-memory copy of disklabelkrw2019-04-291-2/+4
| | | | | | | | | has been modified. Use name of disk being edited in fdisk(8) editor prompt. Idea from tb@. ok tb@ deraadt@
* Add comment to prod updates to regress/sbin/disklabelkrw2019-04-031-1/+7
| | | | | *.ok files whenever space_allocation tables are modified.
* Use consistant idiom for checking return value ofkrw2019-04-021-10/+13
| | | | | | | | ioctl() (i.e. == -1). Don't prepend 'ioctl ' to ioctl name in error or warning messages. Always put the ioctl name in emitted messages. No intentional functional change.
* when using the auto partitioner, grow minimum size for /usr to 1300M.phessler2019-03-311-3/+3
| | | | | | | bare minimum /usr for all sets on amd64 is 920M used space, and we need some more for upgrades, as well as relinking libs and kernels. OK deraadt@
* Enhance prompt shown during -E label editing. Alwayskrw2019-03-311-2/+2
| | | | | display the disk device whose label is being edited. Change '>' to '#' when in expert mode.
* update the error message for the interactive 'n' command to show thatjmc2019-03-071-2/+2
| | | | | | -F or -f is required; ok krw
* Compute params of shrunk partition and not of resized one; ok krw@otto2019-02-211-5/+5
|
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-251-2/+2
|
* FS_BOOT partitions are just partitions. Not free(ish) space.krw2018-11-251-2/+1
| | | | ok deraadt@ as part of larger diff
* Increase /usr/local max size to 20 GB in default templatesolene2018-09-211-2/+2
| | | | ok krw@ deraadt@ jca@
* Increase minimum size for /usr/obj partition to 5 Gig. This allowsbluhm2018-09-181-2/+2
| | | | | to run make build and make regress after a default install. OK deraadt@
* Tighten validation tests on an obscure corner case ofkrw2018-09-111-7/+16
| | | | | | | | trying to align partitions to size <= 0 or past the end of the disk. Emit error message in this case as in other align errors. Looks good to otto@.
* Practice safe free()'ing by setting alloc to NULL tokrw2018-08-301-1/+2
| | | | | | | | prevent double free. Spotted by jsg@, simpler fix by myself and miko@. ok jsg@
* Never let FS_RAID partition be named, a.k.a. given a mount point.krw2018-08-301-40/+38
| | | | | | | Nuke pointless and inconsistant error message before one get_mp() invocation. ok otto@
* Tweak messages emitted by editor_resize() so "Partition x shrunk ..."krw2018-08-281-6/+10
| | | | | | | is only printed if the disklabel gets modified. Also, include the new size. On failure just report "Amount too big.".
* Always check the return values of get_[fsize|bsize|cpg].krw2018-08-231-10/+18
| | | | | | Accept partition changes only if all succeed. ok tb@ deraadt@
* Unbreak 'R'esize.krw2018-08-211-4/+5
| | | | | | Problem noted and fix tested by jcs@. ok otto@
* Oops. Missing chunk from previous 'secs' -> 'ui'.krw2018-08-041-2/+2
|
* Rename local variable 'secs' to 'ui' to be consistant with all otherkrw2018-08-041-8/+8
| | | | uses of getuint64(). No change to executable.
* errno is never checked after a call to getuint64(). So there is nokrw2018-08-021-2/+1
| | | | | point to getuint64() setting it to EINVAL when the user enters an invalid value or aborts input with a ^D.
* Cleanup and clarify getuint64() by using thekrw2018-07-121-104/+49
| | | | | | | | same functions as auto-allocation. parse_sizespec() and apply_unit(). No intentional functional change. Looked good to tb@
* Cleanup and clarify the has_overlap() logic so it can be read bykrw2018-07-121-46/+36
| | | | | | | | | | normal people and is more efficient to boot. The only intentional functional change was to use mergesort() instead of heapsort() so that partitions with the same offset retain their order in the emitted verbiage. Looked good to tb@, ok kn@
* Add recommended error checks around the use of strtod() inkrw2018-07-071-3/+6
| | | | | | parse_sizespec(). ok otto@
* Reduce display_edit() parameter list by one. Just callkrw2018-07-031-5/+6
| | | | | | | editor_countfree() in the function body rather than in the invocation. ok millert@
* Nuke some leading spaces and mis-indentations that crept in over thekrw2018-07-031-5/+5
| | | | | | years. ok otto@
* Rework partition offset/size rounding logic, removing it fromkrw2018-07-011-133/+155
| | | | | | | | | | | | | | | | getuint64() which struggled to know what to do. Add it to the places rounding is actually wanted by creating and using alignpartition() which takes parameters to determine what is rounded, to what boundaries and in what direction. Simplifies and clarifies logic. Various minor verbiage tweaks and shuffling of output under expert mode to improve output during alignments. Been in snaps for a couple of weeks. much back & forth with and ok otto@
* Add getnumber() to extract simple deciaml values from thekrw2018-04-271-38/+52
| | | | | | | user. Doesn't handle units, '*', etc. Replace the more complex getuint64 when getting things like the number of tracks per cylinder. ok otto@
* Create and use a couple of #defines for the magic returnkrw2018-04-271-36/+42
| | | | | | values of getuint64 that indicate errors. Suggested by & ok otto@
* No need for two copies of tricky user input gathering code. Just usekrw2018-04-261-22/+15
| | | | | | | | getstring() to get the string and then parse that in getuint64(). Fix a mis-use of %lld and some whitespace while passing. ok otto@
* Add some range checks to make sure we don't attempt to store valueskrw2018-04-261-9/+39
| | | | | | | too large for the receiving fields. Change a couple of do{}while() to for(;;) for consistancy. Tweaks & ok otto@
* Fix previous. Adding "offset" to "maxval" was required.yasuoka2018-04-261-2/+2
| | | | ok otto krw
* Consolidate duplicate error messages, 'return' is not a function sokrw2018-04-261-125/+87
| | | | | | | | | space before '(', eliminate extraneous '{}'. Start of cleaning up user input processing. No intentional functional change. ok otto@ give or take a few '{}' removals.
* Round user input to cylinder boundaries more betterer.krw2018-04-061-13/+13
| | | | | | Improve emitted verbiage while there. tweaks & ok otto@
* Check required partition size against the size of the largest freekrw2018-03-081-28/+25
| | | | | | | chunk, not the total amount of free space on the disk. Removes need for 'totsecs'. ok otto@ as part of larger diff now completely committed
* Calculate chunk size after adjusting both the chunk offset and chunkkrw2018-03-081-12/+16
| | | | | | | end in SUN_CYLCHECK case. Fixes potential off-by-one in calculating the number of cylinders available in a chunk. ok otto@ as part of larger diff
* Instead of a SUN_CYLCHECK block in both parts of an if/else, with akrw2018-03-081-13/+8
| | | | | | | goto from one to the other, just move the logic after the if/else. One less #ifdef. Decrements total_secs in either case. ok otto@ as part of larger diff
* Bail out of a strategy early if the sum of the minsz values exceedskrw2018-03-081-4/+6
| | | | | | the space available. ok otto@ as part of larger diff
* Bail out of a strategy early if it requires more partitions than arekrw2018-03-081-2/+7
| | | | | | available. ok otto@ as part of larger diff
* Simplify the strategy looping.krw2018-03-081-12/+10
| | | | ok otto@ as part of larger diff
* Add if (D_VENDOR) check to last SUN_CYLCHECK block lacking it.krw2018-03-041-8/+8
| | | | | | | | | | | | While there move local variable declaration inside the 'if' and eliminate separate SUN_CYLCHECK block containing said local variable declaration. Add check for attempt to resize a partition to 0, and simplify logic a bit by recognizing that this means the number of sectors will always be > 0. ok otto@
* Tweak a couple of long lines.krw2018-03-021-4/+5
|
* Always call get_cpg() after calling get_bsize(). Initializekrw2018-03-021-4/+11
| | | | | | | p_cpg inside get_cpg() instead of separately, much like get_fsize() and get_bsize() work. ok otto@
* Check for a negative value and overflow in getuint64() when performingmillert2018-03-011-6/+11
| | | | | multiplication and division. Based on a diff from otto@. OK otto@ krw@