summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/chunk.c
Commit message (Collapse)AuthorAgeFilesLines
* With the old sade removed, libdisk is no longer used by anything in HEADnwhitehorn2012-12-301-595/+0
| | | | | and uses a number of problematic pre-gpart interfaces. Since it has been entirely obsoleted by interfaces in geom, remove it.
* Don't barf when we encounter an UUID for GPT partitions. Instead, addmarcel2004-10-311-0/+1
| | | | | | | | | the GPT partition on i386 and adm64 as type=gpt, subtype=0 and with the sname set to the UUID. This prevents sysinstall from bombing out. This also makes sure the GPT partition shows up in sysinstall so as to avoid accidental "clobberage". PR: bin/72896
* PowerPC support.grehan2004-04-211-1/+27
| | | | | submitted by: Suleiman Souhlal <refugee@segfaulted.com> approved by: phk, jhb
* Change libdisk and sysinstall to use d_addr_t rather than u_long for diskjhb2004-03-161-12/+14
| | | | | | | | | | | | | | | | 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 In Print_Chunk(), don't print the address of the chunk on ia64. Itmarcel2003-11-021-4/+11
| | | | | | | | doesn't have any meaning and only results in lines longer than 80 characters. o In Delete_Chunk2(), also look for chunks of type "part" under chunks of type "whole" on ia64. They're not only under chunks of type "freebsd" there.
* Teach libdisk that AMD64 works just like i386peter2003-04-301-1/+3
|
* - 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
* Break up a bunch of crazy if statements to use a case statement insteadjhb2002-12-021-14/+16
| | | | | | | | | | | to be cleaner. Also, when deleting a chunk, try to find the mother chunk as a whole chunk by default if this isn't a BSD partition or a unused or whole chunk. Before we just did this for FreeBSD and FAT slices, which means that other chunk types such as EFI and mbr (mbr is used for slices that don't have their own chunk type). Submitted by: nyan (mostly) Approved by: re
* Fixed style(9)nyan2002-11-151-60/+71
|
* Handle EFI partitions the same as regular FAT partitions. The onlymarcel2002-11-131-0/+1
| | | | | | difference between the two from a low-level point of view is that the partition type is different. This change adds EFI related cases to existing switch statements with existing FAT related cases.
* Fixed pc98 support.nyan2002-11-071-3/+2
| | | | (merged i386 changes from chunk.c 1.41 and disk.c 1.100)
* Add support for ia64. This is almost identical to i386, except thatmarcel2002-11-021-0/+20
| | | | | with GPT chunks of type "part" do not necessarily live under chunks of type "freebsd". We don't necessarily have a disklabel.
* Don't claim all MBR's have subtype 165 on i386.phk2002-11-021-1/+0
| | | | Spotted by: Frode Nordahl <frode@nordahl.net>
* Restore to pc98 support.nyan2002-10-311-2/+14
|
* Getting closer to getting things right:phk2002-10-291-3/+2
| | | | | | | Always ignore the RAW_PART for BSD. Having no quirks is not a mistake for an architecture. Tested by: DES
* Since make release is toast anyway, add wood to the pyre:phk2002-10-291-32/+60
| | | | | | | | | | | | | | 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
* More lobotomy:phk2002-10-231-1/+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.
* Remove another 10 mindless #ifdefs.phk2002-10-231-59/+45
|
* Remove unnecessary ioctls tickling kernel side to realize that we fiddledphk2002-10-231-1/+1
| | | | with the disk. GEOM will automatically retaste when we closet he filedesc.
* Untangle #ifdefs in the write-end of things by giving each arch itsphk2002-10-231-2/+2
| | | | | | | 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.
* Avoid a lot of #ifdef PC98 code by giving a couple of the Chunk functionsphk2002-10-221-17/+0
| | | | an extra argument for all archs.
* Swing the weed-whacker around libdisk:phk2002-10-221-5/+15
| | | | | | | | | 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-1/+11
| | | | | | | 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-2/+13
| | | | | | | | | | | | | | | | 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 __FBSDID()s to libdiskdillon2001-09-301-3/+3
|
* + add u_long sector_size to struct disk (documented in libdisk.3)jkh2001-05-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | + 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>
* Add spaces around operators.obrien2001-04-011-49/+51
| | | | | It's OK, the Project and afford them now -- they aren't as expensive as they used to be.
* Add back <err.h> for warn().obrien2001-04-011-0/+1
| | | | | (of course it's pretty stupid to call it, as printf doesn't work w/in sysinstall, and sysinstall is the only consumer of libdisk)
* Libraries should _never_ call exit() themselves (or its alternate spellingobrien2001-03-181-8/+7
| | | | | | | | | | | `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
* - Allow support for MBR boot loaders that are longer than one sector. Asjhb2000-07-121-19/+0
| | | | | | 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/+71
|
* Remove BAD144 supportphk1999-11-271-1/+0
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix erroneous format string.jdp1997-11-181-2/+2
|
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* 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.
* Make libdisk C++ aware:joerg1996-03-241-8/+9
| | | | | | | - 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.
* Merge RELENG_2_0_5 into HEADrgrimes1995-06-111-8/+22
|
* Remove trailing whitespace.rgrimes1995-05-301-14/+14
|
* Remove Ontrack special from All_FreeBSD().phk1995-05-251-1/+6
| | | | Add chunk->disk pointer.
* Get the CHUNK_COMPAT_BSD flag right.phk1995-05-111-1/+4
|
* Recognize slice type #6 as dosphk1995-05-081-3/+3
| | | | handle OnTrack Disk manager correctly.
* Whoops! An extra paren somehow got in there. Fixed.jkh1995-05-071-2/+2
|
* Always zero new chunks - keeps things like the private structures from havingjkh1995-05-071-2/+2
| | | | bogus data in them.
* General sanitation and cleanup. Killed the "reserved" type, it wasn't.phk1995-05-061-53/+59
|
* If in Create_Chunk we (type==freebsd && (flags&CHUNK_ALIGN)), then we willphk1995-05-051-5/+38
| | | | align this chunk properly. Have at it Jordan...
* Add the private void *pointer to the chunks, and the functions to manage it.phk1995-05-031-3/+6
| | | | Make the reassignment of partition names less bogus.
* foo -> unknown.jkh1995-05-011-5/+5
| | | | I have to be able to show this stuff to the user. :-)
* Now we do writes too.phk1995-04-301-2/+3
|
OpenPOWER on IntegriCloud