aboutsummaryrefslogtreecommitdiff
path: root/lib/libdisk/create_chunk.c
Commit message (Collapse)AuthorAgeFilesLines
* With the old sade removed, libdisk is no longer used by anything in HEADNathan Whitehorn2012-12-301-296/+0
| | | | | | | | and uses a number of problematic pre-gpart interfaces. Since it has been entirely obsoleted by interfaces in geom, remove it. Notes: svn path=/head/; revision=244865
* Remove an unnecessary defination of New_Chunk, which has beenXin LI2005-01-051-2/+0
| | | | | | | defined in libdisk.h. Notes: svn path=/head/; revision=139720
* PowerPC support.Peter Grehan2004-04-211-1/+24
| | | | | | | | submitted by: Suleiman Souhlal <refugee@segfaulted.com> approved by: phk, jhb Notes: svn path=/head/; revision=128541
* Change libdisk and sysinstall to use d_addr_t rather than u_long for diskJohn Baldwin2004-03-161-5/+5
| | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=127081
* The partition naming on ia64 (e.g. da0p1) cannot be selected basedMarcel Moolenaar2003-11-121-0/+4
| | | | | | | | | | | | | | on whether the parent chunk is of type whole. This also applies to MBR slices for non-GPT disks. Since most of the GPT handling is conditionally compiled, do the same with the partition naming. This fixes a braino that caused slices to be named as GPT partitions and generally messing up an install. Pointy hat: marcel Notes: svn path=/head/; revision=122570
* o Move Int_Open_Disk() from disk.c to open_disk.c for use by allMarcel Moolenaar2003-11-021-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=121888
* Teach libdisk that AMD64 works just like i386Peter Wemm2003-04-301-2/+2
| | | | Notes: svn path=/head/; revision=114329
* Libdisk does not need to include <sys/diskslice.h> any more.Poul-Henning Kamp2003-04-041-1/+0
| | | | | | | | | | | | Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h> Move i386/pc98 specific bits from <sys/reboot.h> to <i386/include/bootinfo.h> as well. Adjust includes in sys/boot accordingly. Notes: svn path=/head/; revision=113083
* Remove mostly unused disk arguments from Fixup_*_Names() functions.John Baldwin2003-02-041-9/+9
| | | | Notes: svn path=/head/; revision=110338
* - Make New_Disk() non-static so it can be used in Create_Chunk_DWIM().John Baldwin2003-01-101-1/+19
| | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=109080
* Fixed style(9)Yoshihiro Takahashi2002-11-151-35/+51
| | | | Notes: svn path=/head/; revision=106949
* MBR slices are named the same on ia64 as they are on i386.Marcel Moolenaar2002-11-111-4/+4
| | | | Notes: svn path=/head/; revision=106752
* the 'd' partition hasn't been magic for years, so allocate it in naturalPoul-Henning Kamp2002-10-291-1/+1
| | | | | | | order instead of last. Notes: svn path=/head/; revision=106114
* More lobotomy:Poul-Henning Kamp2002-10-231-7/+2
| | | | | | | | | | 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. Notes: svn path=/head/; revision=105821
* Remove the last traces of bogus MAKEDEV functionality.Poul-Henning Kamp2002-10-221-17/+0
| | | | Notes: svn path=/head/; revision=105707
* Avoid a lot of #ifdef PC98 code by giving a couple of the Chunk functionsPoul-Henning Kamp2002-10-221-12/+0
| | | | | | | an extra argument for all archs. Notes: svn path=/head/; revision=105685
* Swing the weed-whacker around libdisk:Poul-Henning Kamp2002-10-221-205/+5
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=105681
* Lobotomize MakeDev(), we don't need it with devfs.Poul-Henning Kamp2002-10-211-0/+2
| | | | Notes: svn path=/head/; revision=105662
* Fix to support pc98.Yoshihiro Takahashi2002-10-081-0/+4
| | | | Notes: svn path=/head/; revision=104674
* White-space change only. Move closer to style(9).Poul-Henning Kamp2002-10-041-323/+322
| | | | Notes: svn path=/head/; revision=104469
* 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
* Use correct printf format specifier to print unsigned longs.Garrett Wollman2002-05-301-1/+1
| | | | Notes: svn path=/head/; revision=97628
* Modernize my email address.Poul-Henning Kamp2002-03-251-1/+1
| | | | Notes: svn path=/head/; revision=93149
* One more fix for sysinstall/libdisk to create a device fileMakoto Matsushita2001-11-111-6/+10
| | | | | | | | | | | if and only if a target directory is devfs. Previous patch doesn't correct, it's unconditionally avoid to create a device file if kernel knows devfs. PR: 31109 Notes: svn path=/head/; revision=86260
* Check to see if the devfs MIB exists and return 1 if it exists ratherJordan K. Hubbard2001-10-101-0/+9
| | | | | | | | than making device node(s). Submitted by: Hiroo ONO <hiroo@oikumene.gcd.org> Notes: svn path=/head/; revision=84748
* Add __FBSDID()s to libdiskMatthew Dillon2001-09-301-3/+3
| | | | Notes: svn path=/head/; revision=84200
* Mark some functions as __printflike() and/or taking const char * argumentsKris Kennaway2001-08-201-0/+2
| | | | | | | | | instead of char *. MFC after: 2 weeks Notes: svn path=/head/; revision=81975
* + add u_long sector_size to struct disk (documented in libdisk.3)Jordan K. Hubbard2001-05-131-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + 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> Notes: svn path=/head/; revision=76551
* Add spaces around operators.David E. O'Brien2001-04-011-35/+35
| | | | | | | | It's OK, the Project and afford them now -- they aren't as expensive as they used to be. Notes: svn path=/head/; revision=75069
* Try to untangle some of the #ifdef spaghetti.David E. O'Brien2001-04-011-3/+3
| | | | | | | | | Also, looking to the future, don't assume all the world is an i386 and all its disk layout brain damage will be repeated by other platforms. So all the diking out if we are an Alpha, becomes adding in if we are an i386. Notes: svn path=/head/; revision=75067
* Quiet warnings on the Alpha.David E. O'Brien2001-04-011-2/+7
| | | | Notes: svn path=/head/; revision=75065
* Libraries should _never_ call exit() themselves (or its alternate spellingDavid E. O'Brien2001-03-181-5/+4
| | | | | | | | | | | | | | `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 Notes: svn path=/head/; revision=74426
* MFS: add ATA raid support for sysinstallJordan K. Hubbard2000-11-061-0/+2
| | | | Notes: svn path=/head/; revision=68409
* Teach libdisk about 'aac'Mike Smith2000-09-131-0/+2
| | | | Notes: svn path=/head/; revision=65801
* _PATH_DEV'ify libdiskJohn Baldwin2000-06-281-1/+2
| | | | Notes: svn path=/head/; revision=62223
* Re-support "wd" if PC98 is defined. Because PC-98 still uses the wd driver.Yoshihiro Takahashi2000-06-051-1/+5
| | | | Notes: svn path=/head/; revision=61279
* De-support 'wd'; with it making a dual appearance with 'ad', thingsMike Smith2000-05-301-3/+1
| | | | | | | | depending on libdisk to detect a list of actually-there disk devices were providing duplicate entries (eg. sysinstall). Notes: svn path=/head/; revision=61093
* fix stray 'i' from editor.Alfred Perlstein2000-05-251-1/+1
| | | | Notes: svn path=/head/; revision=60918
* Teach libdisk about 'twe' disks.Mike Smith2000-05-251-0/+2
| | | | Notes: svn path=/head/; revision=60908
* Changes for PC-98.KATO Takenori2000-03-291-0/+22
| | | | Notes: svn path=/head/; revision=58794
* Fix pointer addition bug (3 -> 4).Jonathan Lemon2000-03-091-1/+1
| | | | | | | Submitted by: david.w.james@bt.com Notes: svn path=/head/; revision=57856
* Correct device naming for IDA disk nodes (idad)Jonathan Lemon2000-03-081-1/+1
| | | | Notes: svn path=/head/; revision=57831
* Hide more debugging behind isDebug(); what's currentlyJordan K. Hubbard2000-02-181-2/+4
| | | | | | | spewing out will only alarm people. Notes: svn path=/head/; revision=57306
* Just on the off-chance that somebody might use libdisk in a totallyPoul-Henning Kamp1999-12-221-5/+11
| | | | | | | | | | | lobotomized environment, say booted from a floppy with no /etc full of password and group files, give sensible fallbacks for roots uid and operators gid. This might fix sysinstall. Notes: svn path=/head/; revision=55008
* Catch up to the fact that block devices are toast.Jordan K. Hubbard1999-12-151-12/+38
| | | | | | | | | | | Teach about the afd driver. Teach new char dev for ad driver. Make ownerships correct. Submitted by: jhb Notes: svn path=/head/; revision=54627
* Remove 'sd' support. SCSI disks are known as 'da' these days.Mike Smith1999-11-271-2/+0
| | | | Notes: svn path=/head/; revision=53784
* Remove BAD144 supportPoul-Henning Kamp1999-11-271-7/+0
| | | | Notes: svn path=/head/; revision=53749
* Teach libdisk about the AMI and Mylex RAID drivers. You should be ableMike Smith1999-11-021-0/+4
| | | | | | | to install directly to arrays managed by these controllers now. Notes: svn path=/head/; revision=52786
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Merge from -stable; support for the 'ida' driver, move fla to major 102Mike Smith1999-07-051-2/+4
| | | | Notes: svn path=/head/; revision=48585