summaryrefslogtreecommitdiff
path: root/sbin/disklabel/interact.c
AgeCommit message (Collapse)Author
2021-11-03disklabel(8): convert malloc(x * y) to reallocarrnia
2016-01-31PR/50729: Izumi Tsutsui: Add "SMALLPROG"-like options to disklabel(8)christos
2013-05-03Make disklabel a MI tool. It will use MACHINE/MACHINE_ARCH to determinematt
the disklabel params as well as allowing command-line options of -M <machine> and -B {le,be} to specify MACHINE and byteorder to be used.
2013-01-17move dk_ioctl to a header file for the benefit of x-building.christos
2013-01-15- simplify getinput.christos
- add adjust command.
2011-01-06Change printf formats to match the data type of the values beingapb
printed. There's now a lot of PRIu16 and PRIu32, some PRIu8, some SCNu32, and a few cases where %u and %d were reversed. Multiplication of 32-bit and 8-bit values is cast to uint64_t and printed with PRIu64. Inspired by a report from Patrick Welche on current-users.
2010-05-28Change getnum() to use intmax_t instead of int, so it doesn't overflowdholland
between 2^31 and 2^32. Adjust call sites accordingly. PR 43354.
2009-11-28- Display "Enter '?' for help" when starting interactive modeabs
- Use %.40g rather than %g when printing sectors and MB for existing partition size/offset. Changes [1.93802e+06c, 1953525105s, 953870M]: to: [1938021c, 1953525105s, 953869.6875M]:
2009-10-21Remove 3rd and 4th clauses in christos' license. OK christos.snj
2009-03-16fix sign-compare issueslukem
2006-11-26Add a '-l' flag and a 'L' command to interactive mode to list all knownjmmv
file system types. (Similar to what fdisk does for partition types.) Closes PR bin/12954.
2006-03-18Avoid indexing beyond the end of a malloced array.dsl
Rework loop to be less confusing. Coverty 519 made me read this code, but this isn't the 'bug' it found.
2006-03-17Gracefully handle out of memory condition.rumble
2005-10-19Rototil the way disklabel -r reads and writes labels.dsl
In particular the 'read' part plays 'hunt the disklabel' in order to get a label into a local buffer - from where it can be displayed/edited. The 'write' part makes a separate scan of the disk looking for places to write the label. The main changes are: - It can no longer write the first 8k of the mbr to the pbr (or v.v.) - All labels on the disk (that it can find) get updated during a write - With -A all the labels are displayed (inc. those deleted by -D) - Addition of -D which will delete (by one's complimenting dk_magic{2}) and existing labels before writing labels to the expected locations. - -v gives some verbose output to stderr, -vv more etc A better basis for processing incorrect endian labels, or labels from other architectures.
2005-06-27Move WARNS=3 to the Makefile.inc, and add a little const to the remainingchristos
programs that did not compile before.
2005-06-12Make disklabel(8) into a host-tool, "nbdisklabel." Move disklabel.cdyoung
to main.c to avoid a name collision with lib/libc/gen/disklabel.c when we build nbdisklabel. Still todo: commit host-tool build infrastructure to src/tools/disklabel/.
2005-04-07Recognize more units and be more helpful when we enter bad units.christos
2003-12-29Add missing ' in prompt text.jdc
Pointed out by Allen Briggs.
2003-12-29Add the ability to define a partition as starting after another partition.jdc
If chaining is on, display all changed partitions (not just this one). OK'ed by Christos.
2003-10-20Handle partition offset and size as unsigned entities.pooka
2002-06-29disallow creation of partitions which start beyond (or extend beyond)grant
the end of the disk.
2001-10-19minor WARNS=2 stufflukem
2001-05-26- KNF printlabel.cchristos
- add a function to print only one partition's info. - print the partition information if it was modified in interactive mode. - improve on the chaining code. [still assumes that partition offsets increase monotonically]. We could check for overlap too.
2000-12-24move showinfo() and showpartition() into separate file, for use bylukem
other programs. slightly change argument signature so that globals aren't depended upon.
2000-12-24- convert to KNF ANSI style guidelukem
- reorder arguments of runcmd(), getnum(), defnum() to be consistent with other functions (pass struct disklabel * first)
2000-09-04in cmd_name(), put the default prompt into a temporary buffer ratherlukem
than overwrite the existing d_packname. noted by enami@.
2000-08-14* use strcasecmp() instead of strcmp() so that filesystem type and disk typelukem
searchs (amongst others) are case insensitive. * in interactive mode (-i), when editing entries display supported disk types and filesystem types when given `?' (when ``[?]'' appears in the prompt this feature is supported for the question). * support `m' as a suffix equivalent to `M' * in interactive mode, be a bit more sensible about handling errors and EOF * implement dumpnames(), which takes a char ** and size, and displays as per ls -F (sorted, listed vertically) but indented by one tab * don't assume d_typename and d_packname are NUL terminated * fix up some comments and some warning messages (bad cut & pastos :) * deprecate deffstypename() and getfstypename() * be consistent when using sizeof()
1999-12-17Use '$' instead of '-' to select remainder of disk interactivelyabs
1999-12-17When setting size of partitions interactively allow '-' for remainder of diskabs
1999-11-26allow changing partition info from inside the interactive handler.mrg
1999-09-05Accept 'Y' for label disk as well as 'y'abs
1999-05-03Add a 'chain' command in interactive mode that allows you to vary thechristos
size of the partitions, while the starting point gets adjusted automagically. This chaining works for partitions that are not 'unused'.
1998-11-12Adjust for DKTYPENAME changes.christos
1997-10-13The number of fs types is FSMAXTYPES not DKMAXTYPES.bouyer
Correct read of formatted file (used with -e or -R) so that fstype with spaces will work. Also enlarge the fstype field by 2 chars so that "Linux Ext2" will not be truncated.
1997-09-18Don't pass return value of writelabel() to strerror(), sinceenami
the value is not a errno but just 0 or 1.
1997-06-30Fix warnings.christos
1997-03-18Off by one.christos
1997-03-09fix reversed test for maxpartitions.christos
1997-03-09Jason says: Use getmaxpartitions(3) to determine the number of partitionschristos
allowed in this architecture.
1997-03-08Add -i (interactive mode to create/edit labels) inspired by the SunOS/Solarischristos
format/partition command.