summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/create_chunk.c
Commit message (Collapse)AuthorAgeFilesLines
* With the old sade removed, libdisk is no longer used by anything in HEADnwhitehorn2012-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.
* Remove an unnecessary defination of New_Chunk, which has beendelphij2005-01-051-2/+0
| | | | defined in libdisk.h.
* PowerPC support.grehan2004-04-211-1/+24
| | | | | 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-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
* The partition naming on ia64 (e.g. da0p1) cannot be selected basedmarcel2003-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
* o Move Int_Open_Disk() from disk.c to open_disk.c for use by allmarcel2003-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.
* Teach libdisk that AMD64 works just like i386peter2003-04-301-2/+2
|
* Libdisk does not need to include <sys/diskslice.h> any more.phk2003-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.
* Remove mostly unused disk arguments from Fixup_*_Names() functions.jhb2003-02-041-9/+9
|
* - Make New_Disk() non-static so it can be used in Create_Chunk_DWIM().jhb2003-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
* Fixed style(9)nyan2002-11-151-35/+51
|
* MBR slices are named the same on ia64 as they are on i386.marcel2002-11-111-4/+4
|
* the 'd' partition hasn't been magic for years, so allocate it in naturalphk2002-10-291-1/+1
| | | | order instead of last.
* More lobotomy:phk2002-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.
* Remove the last traces of bogus MAKEDEV functionality.phk2002-10-221-17/+0
|
* Avoid a lot of #ifdef PC98 code by giving a couple of the Chunk functionsphk2002-10-221-12/+0
| | | | an extra argument for all archs.
* Swing the weed-whacker around libdisk:phk2002-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.
* Lobotomize MakeDev(), we don't need it with devfs.phk2002-10-211-0/+2
|
* Fix to support pc98.nyan2002-10-081-0/+4
|
* White-space change only. Move closer to style(9).phk2002-10-041-323/+322
|
* Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:phk2002-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.
* Use correct printf format specifier to print unsigned longs.wollman2002-05-301-1/+1
|
* Modernize my email address.phk2002-03-251-1/+1
|
* One more fix for sysinstall/libdisk to create a device filematusita2001-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
* Check to see if the devfs MIB exists and return 1 if it exists ratherjkh2001-10-101-0/+9
| | | | | than making device node(s). Submitted by: Hiroo ONO <hiroo@oikumene.gcd.org>
* Add __FBSDID()s to libdiskdillon2001-09-301-3/+3
|
* Mark some functions as __printflike() and/or taking const char * argumentskris2001-08-201-0/+2
| | | | | | instead of char *. MFC after: 2 weeks
* + add u_long sector_size to struct disk (documented in libdisk.3)jkh2001-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>
* Add spaces around operators.obrien2001-04-011-35/+35
| | | | | It's OK, the Project and afford them now -- they aren't as expensive as they used to be.
* Try to untangle some of the #ifdef spaghetti.obrien2001-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.
* Quiet warnings on the Alpha.obrien2001-04-011-2/+7
|
* Libraries should _never_ call exit() themselves (or its alternate spellingobrien2001-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
* MFS: add ATA raid support for sysinstalljkh2000-11-061-0/+2
|
* Teach libdisk about 'aac'msmith2000-09-131-0/+2
|
* _PATH_DEV'ify libdiskjhb2000-06-281-1/+2
|
* Re-support "wd" if PC98 is defined. Because PC-98 still uses the wd driver.nyan2000-06-051-1/+5
|
* De-support 'wd'; with it making a dual appearance with 'ad', thingsmsmith2000-05-301-3/+1
| | | | | depending on libdisk to detect a list of actually-there disk devices were providing duplicate entries (eg. sysinstall).
* fix stray 'i' from editor.alfred2000-05-251-1/+1
|
* Teach libdisk about 'twe' disks.msmith2000-05-251-0/+2
|
* Changes for PC-98.kato2000-03-291-0/+22
|
* Fix pointer addition bug (3 -> 4).jlemon2000-03-091-1/+1
| | | | Submitted by: david.w.james@bt.com
* Correct device naming for IDA disk nodes (idad)jlemon2000-03-081-1/+1
|
* Hide more debugging behind isDebug(); what's currentlyjkh2000-02-181-2/+4
| | | | spewing out will only alarm people.
* Just on the off-chance that somebody might use libdisk in a totallyphk1999-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.
* Catch up to the fact that block devices are toast.jkh1999-12-151-12/+38
| | | | | | | | Teach about the afd driver. Teach new char dev for ad driver. Make ownerships correct. Submitted by: jhb
* Remove 'sd' support. SCSI disks are known as 'da' these days.msmith1999-11-271-2/+0
|
* Remove BAD144 supportphk1999-11-271-7/+0
|
* Teach libdisk about the AMI and Mylex RAID drivers. You should be ablemsmith1999-11-021-0/+4
| | | | to install directly to arrays managed by these controllers now.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Merge from -stable; support for the 'ida' driver, move fla to major 102msmith1999-07-051-2/+4
|
OpenPOWER on IntegriCloud