summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/libdisk.h
Commit message (Collapse)AuthorAgeFilesLines
* With the old sade removed, libdisk is no longer used by anything in HEADnwhitehorn2012-12-301-368/+0
| | | | | and uses a number of problematic pre-gpart interfaces. Since it has been entirely obsoleted by interfaces in geom, remove it.
* Remove an errant `#define dprintf printf'. It seems to be leftoverdas2012-01-201-2/+0
| | | | | debugging code that nothing depends on. (I've had this in my tree for years without issue.)
* Add MIPS support to libdiskgonzo2008-05-041-1/+2
| | | | Approved by: cognet (mentor)
* Enclose entire header in #ifndef _LIBDISK_H_mtm2007-11-201-0/+5
|
* Add a dummy arm Write_Disk() function, and compile libdisk on arm.cognet2006-01-251-1/+2
|
* PowerPC support.grehan2004-04-211-1/+3
| | | | | submitted by: Suleiman Souhlal <refugee@segfaulted.com> approved by: phk, jhb
* Make libdisk WARNS=4 clean.kuriyama2004-03-301-0/+1
| | | | Glanced by: jhb
* Change libdisk and sysinstall to use d_addr_t rather than u_long for diskjhb2004-03-161-17/+17
| | | | | | | | | | | | | | | | addresses. For arch's with 64-bit longs, this is a nop, but for i386 this allows sysinstall to properly handle disks and filesystems > 1 TB. Changes from the original patch include: - Use d_addr_t rather than inventing a blkcnt type based on int64_t. - Use strtoimax() rather than strtoull() to parse d_addr_t's from config files. - Use intmax_t casts and %jd rather than %llu to printf d_addr_t values. Tested on: i386 Tested by: kuriyama Submitted by: julian MFC after: 1 month
* o Move Int_Open_Disk() from disk.c to open_disk.c for use by allmarcel2003-11-021-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | platforms except ia64 and use Int_Open_Disk() in open_ia64_disk.c on ia64. We need to know more than GEOM can provide us so we're forced to read from the disk. Move uuid_type() to open_ia64_disk.c and remove all references on non-ia64. o Pass the GEOM conftxt to Int_Open_Disk() so that only Open_Disk() needs to know about GEOM and libdisk can more easily be used with media not handled by GEOM. o Create an ia64 specific definiton of struct disk on ia64, because we don't need/have most of the fields other platforms need and other fields not applicable on platforms other than ia64. o Do not compile change.c on ia64. It's too PC specific. o In Fixup_Names() in create_chunk.c, try all partition numbers that are valid for the GPT disk. We have the total number of partitions that can be allocated in the disk structure on ia64. Also, use the GPT partition naming if we're creating one under a chunk of type "whole". It's a GPT partition in that case. o In Create_Chunk(), compile-out the PC specific code on ia64 that checks BIOS geometry restrictions. o In Debug_Disk() in disk.c, dump the ia64 specific fields. o Save the partition index in the chunk on ia64 so that we can preserve it when we write the data back to disk. This avoids that partitions get moved around or swapped after installing FreeBSD, which may render a disk unusable.
* Disable #define DEBUG in libdisk by default: since libdisk is primarilyrwatson2003-09-271-1/+1
| | | | | | | there to support sysinstall, and enabling DEBUG creates spurious console output that can't be read anyway... This slightly cleans up the visual impression of the system install by not spamming the console during the labeling of the disks.
* Teach libdisk that AMD64 works just like i386peter2003-04-301-2/+3
|
* Only define platform once -- in a C file.obrien2003-04-301-20/+3
|
* - Remove unused old disk pointers from Write_FreeBSD() and Fill_Disklabel()jhb2003-02-041-2/+2
| | | | | functions. - Clean up a few signed/unsigned warnings.
* - Make New_Disk() non-static so it can be used in Create_Chunk_DWIM().jhb2003-01-101-1/+1
| | | | | | | | | | | | | | - In Create_Chunk_DWIM(), if there is a freebsd chunk that has no children chunks, then trying to add a child part chunk will fail even though there is free space. Handle this special case by adding an unused chunk the full size of the freebsd chunk as a child of the freebsd chunk before adding the new part chunk. This situation can happen when changing the type of an existing slice to be a FreeBSD slice type or when installing onto a blank disk on Alpha (which has no slices.) Reviewed by: phk MFC after: 2 days
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Fixed style(9)nyan2002-11-151-48/+29
|
* Remove parameter names from function prototypes (at least one collideddavidc2002-11-111-36/+37
| | | | | | with stdlib.h). discussed with: phk
* Add an efi chunk type. We need to be able to create an EFI partitionmarcel2002-11-101-0/+1
| | | | | on ia64, because that's where we need to put the loader and the kernel.
* Since make release is toast anyway, add wood to the pyre:phk2002-10-291-2/+48
| | | | | | | | | | | | | | This significantly rewamps libdisks discovery of existing disk layout. Please send me reports if this does not work as expected on i386 or sparc64 platforms. I need to sort out alpha, pc98 and ia64 (in that order) before testing on those platforms make a lot of sense. Belived to work for: i386 sparc64 Unknown state: pc98 alpha ia64
* Add back ia64 support that was removed in the last few revisions.peter2002-10-271-0/+4
| | | | I've cloned write_ia64_disk.c from write_i386_disk.c.
* More lobotomy:phk2002-10-231-3/+0
| | | | | | | remove CHUNK_BSD_COMPAT, it was a bad idea, and now its gone. remove DOSPTYP_ONTRACK, missed in OnTrack removal commit. unifdef -DHAVE_GEOM make tst01 compile again.
* Untangle #ifdefs in the write-end of things by giving each arch itsphk2002-10-231-2/+3
| | | | | | | own file and own copy of WriteDisk() to do things in. This should have happened years ago, instead of adding #ifdefs all over the place.
* Remove the last traces of bogus MAKEDEV functionality.phk2002-10-221-7/+0
|
* Avoid a lot of #ifdef PC98 code by giving a couple of the Chunk functionsphk2002-10-221-12/+1
| | | | an extra argument for all archs.
* Swing the weed-whacker around libdisk:phk2002-10-221-27/+11
| | | | | | | | | Constify some things. Staticize some things. Remove some unused things. Prototype some things. Don't install a gazillion man-pages links. Drop support for ON-TRACK disk-manager.
* Modernize my email address.phk2002-03-251-1/+1
|
* Modify Delete_Chunk() into Delete_Chunk2() which can take a flagsdillon2002-01-071-0/+9
| | | | | | | argument. Leave a compatibility shim for Delete_Chunk(). Implement DELCHUNK_RECOVER flag so sysinstall can ask libdisk to recover space when deleting a chunk.
* Add auto-fill-on-delete. When deleting an 'A'uto created partitiondillon2001-12-091-15/+25
| | | | | | | | | | | | | | | | sysinstall will automatically expand the previous partition to take up the freed up space. So you can 'D'elete /home and /usr will get the combined space, or you can 'D'elete /tmp and /var will get the combined space. This gives the user, developer, or lay person a huge amount of flexibility in constructing partitions from an 'A'uto base. It takes only 3 or 4 keystrokes to achieve virtually any combination of having or not having a /tmp and/or /home after doing an 'A'uto create. Change 'A'uto creation of /var/tmp to 'A'uto creation /tmp, which should be less controversial. MFC after: 6 days
* + add u_long sector_size to struct disk (documented in libdisk.3)jkh2001-05-131-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | + make Open_Disk sense the sector size by trying 512, 1024 and 2048 in this order. This makes the kernel note that dscheck(cd1): bio_bcount 512 is not on a sector boundary (ssize 2048) dscheck(cd1): bio_bcount 1024 is not on a sector boundary (ssize 2048) if 2048 is the sector size. If this worries anyone: the message is from /usr/src/sys/kern/subr_diskslice.c and shutups are to be placed there. + Have read_block and write_block use an additional parameter, the sector size. + replace all barfout calls with return NULL, 0, __LINE__, etc. Note that this does NOT emit diagnostics. More often than not, you don't want library functions to scribble on stderr -- it may not even be available. The right thing is to propagate the error condition to upper management. The app should take care of errors. + use d1->sector_size instead of 512 in various places. I've left many places untouched, especially those writing MBRs. I simply added another arg hardcoded as 512. This is because I would not know what I'm doing... I felt this approach would be reasonably backward compatible and not introduce any new bugs in critical software. Famous last words. Messing with MBRs might soon put me in the same screwup meister category as, uh, never mind. :-) + bump the max no of disks from 20 to 32 (due to PR 24503). PR: 8434 / 8436 / 24503 Submitted by: Jens Schweikhardt <schweikh@schweikhardt.net>
* Correct a comment.obrien2001-04-011-1/+1
|
* Libraries should _never_ call exit() themselves (or its alternate spellingobrien2001-03-181-0/+8
| | | | | | | | | | | `err()'). libdisk does! and additionally libdisk gets confused on Alpha disks with foreign disklabels, throws up its hands and exits. This is the cause of the "going no where without my init" install bug on the Alpha. So now on the Alpha, rather than call err(), we print the error string and continue processing. Submitted by: jkh
* Turn dkcksum() into an __inline function.phk2000-09-161-1/+0
| | | | Change its type to u_int_16_t.
* - Added support for installing boot0 and boot0.5 for PC-98.nyan2000-08-121-0/+13
| | | | - Cosmetic changes.
* - Allow support for MBR boot loaders that are longer than one sector. Asjhb2000-07-121-6/+2
| | | | | | with fdisk, ensure that they are a multiple of the sector size in length. - Axe all the 1024 cylinder checks as they are no longer relevant with the fixed bootstrap.
* Changes for PC-98.kato2000-03-291-0/+12
|
* Remove BAD144 supportphk1999-11-271-2/+0
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Eliminate all dependence on boot1 and boot2. This is passed in byjkh1998-12-311-2/+1
| | | | | | Set_Boot_Blocks() anyway and should thus have never been a part of libdisk, it should have been provided by the client of libdisk since passing the information in is already part of the API.
* Teach libdisk about alpha boot blocks.dfr1998-10-061-1/+3
|
* Fixed #includes in the synopsis and in an example. <sys/socket.h>bde1998-01-201-2/+2
| | | | | | isn't a prerequisite, since it isn't required for the prototypes and isn't always needed to call the functions (the address family might be a variable).
* Fixed this header to compile with gcc -pedantic -Werror (removed commabde1997-03-191-2/+2
| | | | at end of enum).
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Adds slice_type_name() which extends chunk_n[] for subtype's too.obrien1997-01-231-0/+5
| | | | Curorary review by: phk
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Improve the Dangerously Dedidcated mode a bit. Not much, but a bit better.phk1996-11-271-15/+7
|
* Fix mis-declared static arrays that made sysinstall SEGV injkh1996-04-291-2/+2
| | | | | | Set_Boot_Blocks(). Boy, this one had me tearing my hair out! I hate how the loader distinguishes between `extern char *foo' and `extern char foo[]' sometimes! :-)
* Make libdisk C++ aware:joerg1996-03-241-108/+113
| | | | | | | - add __BEGIN_DECLS and __END_DECLS, - add a bunch of ``const'' qualifiers all over the place, - rename the `private' struct member into `private_data' to avoid the clash with the C++ keyword.
* Update the -current sources from the 2.1 branch.peter1995-12-071-4/+13
| | | | Approved (in spirit) by: jkh
* Merge RELENG_2_0_5 into HEADrgrimes1995-06-111-1/+13
|
* Remove trailing whitespace.rgrimes1995-05-301-18/+18
|
OpenPOWER on IntegriCloud