summaryrefslogtreecommitdiffstats
path: root/sbin/disklabel/editor.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Updated disklabel format to support larger disks and partitions. Weotto2007-05-291-17/+24
| | | | | | | | | | | free room in struct partition by packing fragment size and fragments/block more tighlty and use the resulting space to make offset and size 48 bits. For the disk part we use spare fields in struct disklabel. Kernel converts in-mem copy of the on-disk label if needed, disklabel(8) writes new version. We are careful to only change fields not used by bootloaders. Conception of basic scheme by deraadt. ok deraadt@ krw@
* fix rounding in the modify case; ok millert@ miod@otto2007-04-291-5/+5
|
* includes that are not needed anymorederaadt2007-04-261-5/+2
|
* Eliminate CPU_BIOS from userland and wd(4) by always using the BIOSkrw2007-04-261-88/+20
| | | | | | | | | | | | | | geometry in the disklabel when there is a BIOS geometry to provide. This removes the option to set a disklabel to 'BIOS' geometry via the 'g b' command in the editor. Makes reported geometry more consistant and moves MD code to MD land where it should be. Doc help from jmc@, Feedback from millert@, marco@, weingart@, kettenis@. ok deraadt@
* Check for zero divisor _before_ dividing; do not use floatingotto2007-03-181-5/+5
| | | | | point arithmetic to round to a cylinder boundary when a simple integer expression can do the job as well. ok millert@ miod@
* Refactor & fix computation of offset for next partition. Now theotto2007-03-131-10/+15
| | | | | | | | | code is almost readable. Keep in mind that the starting offset is inclusive, but the ending offset is exclusive. I heard rumors that disklabel was misbehaving in some cases before, but espie@ was the only one to provide me with enough details to actually find the problem. ok millert@ tom@
* If a default label has been created with the -d command line option orkrw2007-03-021-6/+14
| | | | | | the 'D' editor command and has not been written to disk when the user issues the 'q' editor command, ask if the label should be written to disk before exiting.
* Always write the disklabel to disk when asked, even if it appears tokrw2007-02-221-6/+4
| | | | | | | be unchanged. Fixes PR#5209. Proper behaviour of 'q'uit still under discussion. ok ray@ millert@ ckuethe@ nick@
* Friends don't let friends look for disklabels in Free/NetBSD MBRkrw2006-10-141-6/+4
| | | | | partitions since the kernel doesn't put them or look for them there anymore.
* Eliminate redundant get_le() in favour of letoh32(). Add letoh32()krw2006-07-011-4/+4
| | | | | | | calls in alpha, hppa, hppa64 and mips63 when accessing the two DOS MBR u_int32_t fields dp_size and dp_start. No functional change.
* man page is gzip'd, should store as unsigned char array.deraadt2006-04-261-3/+3
|
* Remove duplicate code, okay ray@pedro2006-04-141-4/+2
|
* Avoid an out-of-bounds array access in editor_delete() for invalid partitionmiod2005-12-051-7/+10
| | | | | | name; spotted by Laurent Coustet (ed, debian-fr net) ok deraadt@ otto@
* Fix conversion of K units to handle case where sector size > 1024. e.g.krw2005-11-161-3/+6
| | | | | | Sony Hi-MD usb drive. ok millert@
* Print disk size and free space in requested unit. Some refactoring tootto2005-01-071-33/+5
| | | | avoid code duplication as well. ok marco@ deraadt@
* A compare function for heapsort(3) should not just subtract twootto2004-12-111-4/+10
| | | | | | offsets, it does not work if the difference is large. Problem found by Jean-Gerard Pailloncyi who had false warnings of overlapping partitions. ok millert@ tedu@
* gzip embedded man pages, and pipe through gunzip when viewing.otto2004-11-061-6/+10
| | | | ok deraadt@
* Allow one more char for fstype, to avoid truncation of ISO9660 fstype.otto2004-10-041-3/+3
| | | | spotted by and ok krw@
* Tidy disklabel output for todays big disks. Based on a diff from fotto2004-09-281-25/+8
| | | | at obiit dot org in PR 3847. ok tedu@ deraadt@ millert@
* Handle geometry parameters as unsigned quantities, getting rid ofotto2004-08-031-10/+10
| | | | | | | | negative number of sectors on large disks and other similar problems. Also make reading of ASCII disk labels more robust by using strtonum(3) instead of atoi(3). ok millert@ deraadt@
* Add support for % and & units to indicate percent of total space andmillert2003-12-291-5/+18
| | | | percent of available space respectively. From Sebastian Horzela.
* make disklabel docs more readable: more logical SYNOPSIS; sort options;jmc2003-12-201-11/+11
| | | | | | | make internal editor help and usage() match the docs; make sure all the forms described in SYNOPSIS are explained; various other tweaks. input from millert@; ok deraadt;
* realloc fixes; ok hoderaadt2003-09-241-4/+6
|
* exclude __sparc64__ since it can handle 16k blocks. from jason@tedu2003-08-291-3/+3
|
* sparcs cannot handle booting from > 8k block partitions, so set the roottedu2003-08-281-2/+7
| | | | partition block size back down.
* spacesderaadt2003-07-291-9/+9
|
* new default frag/block sizes.tedu2003-07-161-5/+5
| | | | reminded by millert@
* Sync with share/misc/license.template and add missing DARPA creditmillert2003-06-171-9/+9
| | | | where applicable.
* ansificationderaadt2003-06-111-133/+39
|
* Use an ISC-tyle license for all my code; it is simpler and more permissive.millert2003-06-031-23/+12
|
* o replace a strncpy + manual NUL terminate w/ strlcpymillert2003-04-051-8/+5
| | | | | o remove NUL termination of d_packname since it is not needed. krw@ OK
* add support for printing disklabels in units other than sectors fromtedu2003-02-131-4/+4
| | | | | | the cmdline based on a patch by mho at mho.nu ok and input by millert@
* rm trailing whitespacetodd2002-06-091-5/+5
|
* strcpy, sprintf death; mpech okderaadt2002-05-221-4/+6
|
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-45/+45
|
* Fix `necesary' typos; Alexander Yurchenkomillert2002-01-241-4/+4
| | | | | Alas many of these were introduced by yours truly as necessary just doesn't look right to me for some reason ;-)
* major -Wall cleanup, almost completederaadt2001-07-071-5/+7
|
* When zeroing out the parition table, make 'c' the entire disk, not justmillert2001-05-191-4/+3
| | | | | the OpenBSD portion of the disk. This is conistent with the idea of 'c' throughout the program.
* correct warning; maurice@maurice.wan.nlderaadt2001-03-121-3/+3
|
* Use clearerr(3) to clear EOF on stdin when aborting a command due to ^D.millert2000-10-221-2/+4
| | | | | Fixes a bug exposed by the last revision (we got away with before it due to the rewind(3) calls).
* Get rid of fflush(stdout); rewind(stdin); pairs since we should notmillert2000-08-131-8/+2
| | | | | have to worry about stdout == stdin (and since this is done inconsistently it is useless anyway). Pointed out by map@infinitum.ch.
* Don't exit just because we couldn't get the default label...millert2000-06-041-11/+12
|
* Add 'D' and 'z' commands to editor to use the default partition andmillert2000-06-041-17/+69
| | | | to zero out the partition table respectively.
* Reserve the first cylinder for bootblock if NUMBOOT=1. Basically treatmillert2000-05-051-9/+7
| | | | | | it the same as the space we reserver on i386 to avoid fdisk trouncing. The user can change this via the 'b' command and a message is printed at startup to this effect.
* Add "expert mode" and don't prompt for fsize/bsize/cpg unless an expertmillert2000-04-041-22/+26
| | | | | | | | | | | next_offset() now takes a pointer to the partition size as its second argument instead of a pointer to the partition. This allows us to get the offset earlier on and sort_partitions() will not try and include the partition we are trying to create in its list. In free_chunks() start looking for things at starting_sector, not 0, to avoid getting starting offsets that precede the start of the OpenBSD part of the disk.
* Don't use the BIOS geometry by default, it causes too many problems.millert2000-03-231-19/+2
|
* missing newlinederaadt2000-02-211-3/+3
|
* put in a check for architectures that demand that partition A start at sector 0deraadt1999-07-141-2/+7
|
* Handle PAGER in a manner consistent with the Single Unix Specification:pjanzen1999-06-101-3/+3
| | | | | that is, use PAGER rather than "more" if it is defined and non-null, not just if it is defined.
* typo; mcsmart@engin.umich.eduaaron1999-06-061-3/+3
|