summaryrefslogtreecommitdiff
path: root/sbin/disklabel
AgeCommit message (Collapse)Author
2009-08-12Crank the /usr sizes in the large configurationTheo de Raadt
ok krw otto
2009-08-07move editor_allocspace & mpsave out to extern.h so that disklabel.cMartynas Venckus
gets the declarations it uses. ok krw@
2009-07-27add a section on automatic disk allocation, to give an idea ofJason McIntyre
how -A and A will carve up your disk; help/ok krw deraadt
2009-06-26since nitems() is not yet fit for userland consumption, provide itTheo de Raadt
ourselves ok krw
2009-06-11'd *' == 'z' == zero_partitions(). Mount point info needs to beKenneth R Westerback
cleared in both cases. So just do it inside zero_partitions() since we are looping over all the partitions there anyway. Should fix an install corner case discovered by todd@.
2009-06-04Recycle four ancient fields in the disklabel structure, replacing them withTheo de Raadt
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
2009-06-02remove unused variableCharles Longeau
ok krw@
2009-06-02Add '-h' flag, and '*' as a unit specifier for 'p' Editor command.Kenneth R Westerback
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@
2009-05-31Always show the start and end of the OpenBSD area in units ofKenneth R Westerback
sectors, not any 'human' unit in force.
2009-05-31'-d' works everywhere now. And it ignores the OpenBSD disk label,Kenneth R Westerback
not OpenBSD partitions.
2009-05-31Never 'humanize' the sector offsets of partitions or 'total sectors'.Kenneth R Westerback
If we are humanizing then add a comment to 'total sectors' line rather than replacing 'total sectors' with a new header. Suggestion and ok deraadt@
2009-05-29Clean up logic around exit values. Make getasciilabel() return 0Kenneth R Westerback
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.
2009-05-17No need to write mount point info twice in 'w' command in Editor.Kenneth R Westerback
2009-05-17Write out mountpoint info in writelabel() after label successfullyKenneth R Westerback
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@
2009-05-17Initialize mountpoints[] when going past again:, since aKenneth R Westerback
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@
2009-05-13The auto-allocator does not remember to increase the d_npartitions fieldTheo de Raadt
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
2009-05-13Set D_VENDOR when spoofing a label on archs that use D_VENDOR whenKenneth R Westerback
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@
2009-05-12Various mount point handling fixes, most originally from halex@.Kenneth R Westerback
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.
2009-05-11Make sure last, catch-all, auto-allocated partition ends on aKenneth R Westerback
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@
2009-05-11very long lines in comments are uglyTheo de Raadt
2009-05-11Always save an fstab file, even if it is empty; ok krwTheo de Raadt
2009-05-05use logical or when it's intended to be a logical or; ok krw@Otto Moerbeek
2009-05-03Prevent the entry of duplicate mount points while in Editor mode.Kenneth R Westerback
ok deraadt@
2009-05-03Tune the medium profile to provide more /usr space as 'requested' by beckTheo de Raadt
also make the %'s add up to 100 again, which was part of the problem ok krw otto
2009-04-30in the big configuration, tune /tmp so that it scales up a bit slower,Theo de Raadt
and benefit /home in exchange ok otto
2009-04-30Prime mountpoint info with any fstab info that is available, withKenneth R Westerback
or without the '-f' option being present. Now you can see in Editor mode or 'disklabel <dev>' where the partitions that exist will be mounted in the current configuration. Tweaks (and libc fixes) from, and ok deraadt@
2009-04-29KNFTheo de Raadt
2009-04-29increase the max for medium a bit, so e.g. a 6GB disk gets fully usedOtto Moerbeek
2009-04-26adjust the numbers for the "big" auto-allocation scheme with ottoTheo de Raadt
2009-04-26Adjust the medium auto scale after looking at how it performs between theTheo de Raadt
low and high ends of the disk sizes it applies to; with otto
2009-04-26smarter auto-allocation; numbers needs tweaking, but we are gettingOtto Moerbeek
closer, ok deraadt@ krw@
2009-04-26Fix 'n' (name mountpoint) Editor command. The check for the presenceKenneth R Westerback
of the -f flag was reversed.
2009-04-23Unrevert reversion of r1.192. This time make sure 'aflag' is treatedKenneth R Westerback
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@
2009-04-20No this change is wrong, because now 'w' followed by 'q' asks if youTheo de Raadt
are sure. This will require another solution, based perhaps on comparing against an earlier form of the label
2009-04-18Alexander Hall points out that disklabel -AE <disk> followed by quittingStuart Henderson
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@.
2009-04-12When auto-allocating, check the size of the disk and displayKenneth R Westerback
offset/size information in MB if the disk is <10G, and in GB otherwise. '-p' will override this default.
2009-04-11Always display any mountpoint info available. Thus a simple -A willKenneth R Westerback
now show the planned mountpoint layout. ok deraadt@
2009-04-11readlabel() either errored out or returned a pointer to the globalKenneth R Westerback
'lab'. So there is no need for the return value. Just use &lab wherever it was used. No functional change. Slightly different version read ok to blambert@
2009-04-11Treat the list of auto-allocation partitions as a priority list andKenneth R Westerback
stop auto-allocation as soon as a partition can't fit. Eliminate the 'no space to allocate ...' messages.
2009-04-10allow /usr/local to be up to 5MB in auto mode; ok krwTheo de Raadt
2009-04-10Re-work '-A' so that it sets a flag that -E and -w use, and which willKenneth R Westerback
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@
2009-04-04Translate the size values in the auto-allocate table from blocks toKenneth R Westerback
sectors at runtime instead of constantly converting the sector values in the label to blocks. Adjust names accordingly. No functional change.
2009-04-03Bring comment into line with other docs. -E(dit) is not just forKenneth R Westerback
new labels.
2009-04-01the note explaining partition letters is not a caveat, it is integral toJason McIntyre
the way disklabel works; move it into DESCRIPTION ok krw
2009-03-31When warning about a non-zero partition offset, show DL_GETPOFFSET()Kenneth R Westerback
and not DL_GETPSIZE().
2009-03-31Beef up description of 'c' partition in CAVEATS and remove mentions ofKenneth R Westerback
'c' from descriptions of d(elete) and z(ero) commands. Feedback from jmc@ Slightly different version ok jmc@ deraadt@
2009-03-31Tweak comment to remove discussion of now non-existant 2 stageKenneth R Westerback
boot loaders and update list of NUMBOOT>0 archs. ok deraadt@
2009-03-31Remove lies about and tweak descriptions of built-in label editor,Kenneth R Westerback
a.k.a. '-E'. Feedback from otto@ jmc@
2009-03-30Oops. Document new 'U' editor command in '?' output too.Kenneth R Westerback
Prodded by & ok jmc@
2009-03-30Document new 'U' editor command.Kenneth R Westerback
Prodded by & ok jmc@