aboutsummaryrefslogtreecommitdiff
path: root/sbin/bsdlabel/bsdlabel.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Deal with vestiges of d_boot[01].Ruslan Ermilov2003-02-231-16/+2
| | | | Notes: svn path=/head/; revision=111286
* If we fail to open O_RDWR, try opening O_RDONLY, if we use ioctlsPoul-Henning Kamp2003-01-261-0/+6
| | | | | | | | | to fiddle the disk we can get away with it. Try to use DIOCBSDBB to write boot code. Notes: svn path=/head/; revision=109901
* IA64 still needs to be able to run on MBR+BSD combination, so put disklabelPoul-Henning Kamp2003-01-261-0/+1
| | | | | | | | | back. Pointed out by: peter Notes: svn path=/head/; revision=109891
* Drop the silly notion that i386 has two bootstrap files now that sys/bootPoul-Henning Kamp2003-01-261-138/+24
| | | | | | | | | | | creates a single file named just "boot". Apart from the fact that the option "-s" is now gone and that "-b" should be pointed at /boot/boot instead of /boot/boot1, this patch should be a no-op. Notes: svn path=/head/; revision=109889
* Remove #if checks for NUMBOOT==0, it's not relevant for any architecturePoul-Henning Kamp2003-01-261-30/+0
| | | | | | | | and if we get such an architecture, we can just avoid using the relevant options. Notes: svn path=/head/; revision=109887
* Offer better advice in #error.Poul-Henning Kamp2003-01-261-5/+3
| | | | | | | Remove yet a usage message about -N/-W Notes: svn path=/head/; revision=109884
* Remove ia64 and powerpc #ifdefs: this is i386/pc98/alpha only code.Poul-Henning Kamp2003-01-261-3/+3
| | | | Notes: svn path=/head/; revision=109882
* Remove #ifdef __sparc64__ code. GEOM uses native SUN labels on this arch,Poul-Henning Kamp2003-01-261-59/+2
| | | | | | | so no hacks are needed. Notes: svn path=/head/; revision=109879
* Fix typo in last commit.Poul-Henning Kamp2003-01-261-84/+87
| | | | | | | Rearrange bits in writelabel() a bit for improved readability. Notes: svn path=/head/; revision=109878
* Remember to remove -N and -W from usage.Poul-Henning Kamp2003-01-261-2/+0
| | | | Notes: svn path=/head/; revision=109875
* Don't fiddle write-protect status of disklabel, it's a discontinued feature.Poul-Henning Kamp2003-01-261-8/+0
| | | | Notes: svn path=/head/; revision=109874
* Retire the "-N" and "-W" options which implemented write-protectionPoul-Henning Kamp2003-01-261-25/+3
| | | | | | | | | | | | | | | | | | | | | | for the disklabel: This facility is OBE. First of all, we cannot sensibly implement this in a properly stacked environment. Second, if we did, it would confuse the heck out of users who wouldn't be able to "start from scratch" by dd(8)'ing /dev/zero onto /dev/da0. Third, the offered protection is not comprehensive: no other software would respect it. Fourth and finally, the disklabel is already protected against tampering if it controls open partitions. Uselessness of these options discussed with: peter Notes: svn path=/head/; revision=109872
* Clear part_set, part_size_type and part_offset_type before parsing theDag-Erling Smørgrav2003-01-161-0/+3
| | | | | | | | | | | ascii label; otherwise checklabel() might report spurious errors because of leftovers from a previous pass. Reviewed by: bde MFC after: 1 week Notes: svn path=/head/; revision=109378
* Rename the dos_partition structure for pc98 to pc98_partition.Yoshihiro Takahashi2003-01-041-1/+11
| | | | Notes: svn path=/head/; revision=108650
* Relax partition overlap check to allow Vinum partitions to overlapGreg Lehey2002-12-021-3/+6
| | | | | | | | | | | | | | | other partitiosns. This is necessary when migrating conventional partitions to Vinum and was broken by recent more stringent overlap checks. This is arguably the wrong way to do it. A better method would be to have the loader understand a subset of Vinum partitioning and allow an install directly to Vinum, but until then, this is the best we have. Reviewed by: jhb Approved by: re (rwatson) Notes: svn path=/head/; revision=107534
* Everything in the disklabel is unsigned so make all the input routinesJulian Elischer2002-11-181-57/+52
| | | | | | | | | | | | | | | take unsigned values. his allows one to label disk with the number of blocks > 31 bits (though less then 32 bits) e.g. # size offset fstype [fsize bsize bps/cpg] c: 3125755904 0 unused 0 0 # (Cyl. 0 - 194569*) d: 3125755840 64 unused 0 0 # (Cyl. 0*- 194569*) which is needd to test UFS2 Notes: svn path=/head/; revision=107041
* Fix to support pc98.Yoshihiro Takahashi2002-10-081-0/+4
| | | | Notes: svn path=/head/; revision=104674
* Don't be noisy if DIOCWLABEL fails, it's probably because we're writingPoul-Henning Kamp2002-10-051-2/+1
| | | | | | | | | the first label to the raw disk. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104543
* Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:Poul-Henning Kamp2002-10-011-0/+1
| | | | | | | | | | | | | | | | | | | Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h. These two new copies are still intact copies of disklabel.h and therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them in programs which already include <sys.disklabel.h> is currently a no-op. This commit adds a number of such #includes. Once I have verified that I have fixed all the places which need fixing, I will commit the updated versions of the three #include files. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=104272
* Construct new disklabels based on the medias stated parameters inPoul-Henning Kamp2002-09-201-20/+47
| | | | | | | | | | userland, rather than expect all possible GEOMetries to know about BSD disklabels. Sponsored by: DARPA & NAI Labs Notes: svn path=/head/; revision=103669
* s/filesystem/file system/g as discussed on -developersTom Rhodes2002-08-211-2/+2
| | | | Notes: svn path=/head/; revision=102231
* Fix more breakage due to FSTYPENAMES/DKTYPENAMES split.Bosko Milekic2002-08-161-0/+1
| | | | | | | Also submitted by: David Wolfskill <david@catwhisker.org> Notes: svn path=/head/; revision=101994
* Apply __FBSDID(); fix local variable(names) that stomp on globalMark Murray2002-07-031-23/+28
| | | | | | | definitions; fix some const strings; fix some signedness issues. Notes: svn path=/head/; revision=99365
* Oops, unbreak parsing of the `type' field in getasciilabel(). I hadIan Dowse2002-06-051-1/+3
| | | | | | | | | | changed a `goto' to a `continue' in revision 1.52, but it continued the wrong loop. Noticed by: bde Notes: svn path=/head/; revision=97855
* correct comment (replace i386 with __i386__)Alfred Perlstein2002-05-301-2/+2
| | | | Notes: svn path=/head/; revision=97553
* Fix some serious brain damage in the default block/frag/cpg parametersIan Dowse2002-05-301-9/+7
| | | | | | | | | | | | | | | | that are used if none at all are specified for a partition. Don't keep replaying the last field if we run out of fields when processing a line. Use a 8:1 frag:block ratio for both defaults. More work here is required. I think disklabel should not attempt to choose default filesystem parameters, and instead let newfs pick any defaults if required. PR: i386/38703 Reported by: Martin Kraemer <Martin.Kraemer@Fujitsu-Siemens.com> Notes: svn path=/head/; revision=97535
* Split out the code for parsing the partition specification linesIan Dowse2002-05-301-129/+134
| | | | | | | into a separate function to avoid some over-long lines. Notes: svn path=/head/; revision=97534
* Spread the word of PowerPC.Benno Rice2002-05-211-1/+1
| | | | Notes: svn path=/head/; revision=97047
* Retire the bogus uses of the disklabel field d_sbsize and begin toPoul-Henning Kamp2002-05-121-7/+1
| | | | | | | | | | initialize it to zero so we don't have to have everbody and their aunt including FFS specific header files. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=96475
* Get us to WARNS=2 with a bit of constification and some printf fiddling.Poul-Henning Kamp2002-04-071-25/+18
| | | | | | | | | | Pick up the c-partitions magicness from sys/disklabel.h instead of defining our own magicness for it, remove trivial comment. Sponsored by: DARPA and NAI Labs. Notes: svn path=/head/; revision=94065
* Nuke a totally pointless optional debug optionPoul-Henning Kamp2002-04-071-15/+0
| | | | | | | Sponsored by: DARPA and NAI Labs. Notes: svn path=/head/; revision=94061
* Remove remaining traces of d_boot[01]Poul-Henning Kamp2002-04-041-2/+0
| | | | Notes: svn path=/head/; revision=93809
* Kill only usage of the undocumnted and unuse d_boot[01] fields ofPoul-Henning Kamp2002-04-031-28/+0
| | | | | | | | | struct disklabel. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=93724
* Remove stray registerWarner Losh2002-03-191-1/+1
| | | | Notes: svn path=/head/; revision=92715
* o remove __PWarner Losh2002-03-181-72/+48
| | | | | | | | | o Use ANSI function definitions o const poison o remove register Notes: svn path=/head/; revision=92541
* Add complete Sparc64 support.David E. O'Brien2002-03-111-17/+64
| | | | | | | | | Submitted by: tmm Dike out vax support. Notes: svn path=/head/; revision=92058
* * Support the Sparc64.David E. O'Brien2002-03-111-7/+5
| | | | | | | | * Do not default to any particular platform. Require that we explicitly support a particular platform. Notes: svn path=/head/; revision=92057
* A bit of premptive GEOM POLA magic: If we don't get a virgin disklabelPoul-Henning Kamp2002-03-031-6/+16
| | | | | | | from /dev/food0, then try from /dev/f00d0c, in strange cases this work. Notes: svn path=/head/; revision=91603
* Silence non-constant format string warnings by marking functionsKris Kennaway2001-08-191-1/+1
| | | | | | | | | | as __printflike()/__printf0like(), adding const, or adding missing "%s" format strings, as appropriate. MFC after: 2 weeks Notes: svn path=/head/; revision=81911
* Fix the type of the NULL arg to execl()Brian Somers2001-07-091-1/+1
| | | | | | | Idea from: Theo de Raadt <deraadt@openbsd.org> Notes: svn path=/head/; revision=79452
* Nuke unused variables.Dima Dorfman2001-06-241-3/+0
| | | | Notes: svn path=/head/; revision=78735
* Say "add -r" rather than 'use -r' since the former is more correct.Warner Losh2001-04-241-2/+1
| | | | | | | | The latter implies to many people that they use only -r, which is incorrect. Notes: svn path=/head/; revision=75915
* First attempt to not overflow in disk space calculations. Use off_tWarner Losh2001-03-051-5/+5
| | | | | | | | for the size variable used to calculate the size of the partition. Also use ULL suffix for constants to ensure that we use 64 bit math. Notes: svn path=/head/; revision=73573
* Allow for easier configuration when using disklabel. A sampleJohn W. De Boskey2001-02-251-147/+413
| | | | | | | | | | | | | | | | | | | | | | | | | | | | being: # size offset fstype [fsize bsize bps/cpg] a: 400M 0 4.2BSD 4096 16384 75 # (Cyl. 0 - 812*) b: 1G * swap c: * * unused e: 204800 * 4.2BSD f: 5g * 4.2BSD g: * * 4.2BSD These patches are the original work of Randell Jesup, and I believe Matt Dillon, with additional work by Warner Losh. Please let me know if I've left someone out. Incorporated into this is the fix for PR bin/22727. This patchset still has style issues and a possible problem on large disks. However, it was a agreed to get these committed before performing major surgery on them. PR: bin/22727 Submitted by: Randell Jesup <rjesup@wgate.com> Notes: svn path=/head/; revision=73034
* Add support for virgin disklabelsJordan K. Hubbard2000-10-311-4/+11
| | | | | | | Submitted by: dillon Notes: svn path=/head/; revision=68044
* Turn dkcksum() into an __inline function.Poul-Henning Kamp2000-09-161-1/+0
| | | | | | | Change its type to u_int_16_t. Notes: svn path=/head/; revision=65921
* A local WIP snook in rev 1.31.David E. O'Brien2000-04-211-6/+2
| | | | | | | Noticed by: bde Notes: svn path=/head/; revision=59457
* Found more places where 'r' was being prepended to the device name.David E. O'Brien2000-04-201-4/+8
| | | | Notes: svn path=/head/; revision=59429
* Add include of errno.h where needed, remove extern int errno where not.Warner Losh2000-04-141-3/+1
| | | | | | | These commits were inspired by a similar commit to netbsd. Notes: svn path=/head/; revision=59216
* Don't prepend "r" for the raw device anymore.David E. O'Brien2000-04-101-1/+1
| | | | Notes: svn path=/head/; revision=59114