summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/disk.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge two slice_type_name() functions.nyan2005-04-131-23/+4
|
* Plug memory leak.yongari2004-12-221-1/+4
| | | | MFC after: 1 week
* Add 0xbf (191) as new Solaris partition identifier.phk2004-11-101-0/+1
| | | | Submitted by: Lawrence.Lee@sun.com
* Remove spurious semicolons. Outside of functions they are actually errors butstefanf2004-05-161-1/+1
| | | | | | | | GCC doesn't warn about them without -pedantic. Approved by: das (mentor) PR: 56649 Reviewed by: md5
* PowerPC support.grehan2004-04-211-0/+1
| | | | | submitted by: Suleiman Souhlal <refugee@segfaulted.com> approved by: phk, jhb
* Make libdisk WARNS=4 clean.kuriyama2004-03-301-2/+2
| | | | Glanced by: jhb
* o Move Int_Open_Disk() from disk.c to open_disk.c for use by allmarcel2003-11-021-291/+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.
* Ignore ccd(4)'s. This is not the best solution, but it at least removesobrien2003-08-281-0/+2
| | | | | | the "BARF 360" ccd(4) user's experience. Submitted by: rwatson
* Sanity check the list obtained from the kern.disks sysctl so that Disk_Names()scottl2003-06-071-1/+4
| | | | | doesn't get fooled into returning a bogus list. This should fix sysinstall from segfaulting when no disk devices are present.
* Teach libdisk that AMD64 works just like i386peter2003-04-301-3/+5
|
* Only define platform once -- in a C file.obrien2003-04-301-0/+20
|
* 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.
* Ignore GBDE devices.phk2003-03-171-0/+2
| | | | Spotted by: Lucky Green <shamrock@cypherpunks.to>
* Use the fstype obtained from the GEOM dumpconf output to set the fstypejhb2003-01-101-1/+1
| | | | | | | of BSD part chunks when opening a disk. Reviewed by: phk MFC after: 2 days
* Return an error if the size of the sector is zero. This is for removablenyan2002-12-261-0/+6
| | | | | | | | devices that is not inserted any media. This is MFC candidate. Submitted by: ISAKA Yoji <isaka@cory.jp>
* - Ease sanity check to get cylinders.nyan2002-11-171-6/+12
| | | | - Get the slice name from the result of kern.geom.conftxt.
* Fixed style(9)nyan2002-11-151-31/+71
|
* Handle EFI partitions the same as regular FAT partitions. The onlymarcel2002-11-131-0/+3
| | | | | | 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.
* Remove debugging printfs.phk2002-11-111-7/+0
|
* Add efi to the list of types for which we need to return tha name.marcel2002-11-101-1/+4
| | | | | Also, return chunk type efi in case we find an EFI partition in the GPT. We used to return FAT due to a lack of EFI type.
* - Recognize FAT partition on MBR and PC98 disks.nyan2002-11-081-20/+47
| | | | - Fix to convert to the name of partition.
* Don't set a value to a variable that we don't use.jhb2002-11-081-1/+0
|
* Fixed pc98 support.nyan2002-11-071-3/+3
| | | | (merged i386 changes from chunk.c 1.41 and disk.c 1.100)
* Initialize d->bios_cyl. We know the media size in sectors, the numbermarcel2002-11-031-4/+10
| | | | | | | of heads end the number of sectors per track. If there's an obvious insanity (heads and sectors are both zero or the media size is not an integral multiple of heads times sector) we set the number of cylinders to zero.
* Add support for GPT:marcel2002-11-021-5/+45
| | | | | | | | | | 1. When the parition type is not an integer, try to parse the type as an UUID. If that succeeds, map the UUID to chunk_e. 2. For GPT partitions, pass the type constructed in point 1 above to Add_Chunk. While here, fix the MBREXT case by only checking if the first 3 characters are MBR. This avoids duplication.
* Don't claim all MBR's have subtype 165 on i386.phk2002-11-021-2/+2
| | | | Spotted by: Frode Nordahl <frode@nordahl.net>
* Set the sector size for the disk.phk2002-10-311-0/+2
|
* Restore to pc98 support.nyan2002-10-311-43/+82
|
* Actually save the bootblock in the disk structure. Write the bootblockjake2002-10-311-0/+7
| | | | to the right place on the disk instead of srewn all over it.
* Getting closer to getting things right:phk2002-10-291-1/+1
| | | | | | | 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-701/+181
| | | | | | | | | | | | | | 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/+14
| | | | I've cloned write_ia64_disk.c from write_i386_disk.c.
* #ifdef out assignToPartition on non x86 arches to unbreak the worldgallatin2002-10-241-0/+2
| | | | on alpha, sparc64 and ia64
* More lobotomy:phk2002-10-231-80/+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.
* Rely on sysctl kern.disks to be there, and get rid of one of the far toophk2002-10-231-69/+36
| | | | | many lists of disk device driver names in the system. At this point we should really get the names from the XML, but hey...
* Untangle #ifdefs in the write-end of things by giving each arch itsphk2002-10-231-1/+1
| | | | | | | 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.
* - The GEOM system does not work on pc98.nyan2002-10-231-0/+4
| | | | - Fix to build w/o the HAVE_GEOM option.
* Add the new extra argument also in the alpha case.phk2002-10-231-1/+1
|
* Avoid a lot of #ifdef PC98 code by giving a couple of the Chunk functionsphk2002-10-221-6/+2
| | | | an extra argument for all archs.
* Swing the weed-whacker around libdisk:phk2002-10-221-55/+3
| | | | | | | | | 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.
* Sigh, d_ntracks, not d_nheads.phk2002-10-211-1/+1
|
* fwheads and fwsectors got swapped underway.phk2002-10-211-2/+2
| | | | Approved by: sam
* Another baby step toward getting sysinstall working:sam2002-10-201-77/+128
| | | | | | | | | | | | o fillin media s/h/c fields from new XML phk just added; need this because sysinstall uses them in the fdisk look-alike o add new tags to xml parser o cleanup parser a touch; remove unused tags and move tag parsing stuff to a table to simplify future additions o redo callback to pass 64-bit values since mediasize overflows u_int32_t o loosen parsing sanity checks a touch to deal with new xml we must handle o move sector size probing to non-geom handling since we now get it from xml o remove WHOLE_DISK_SLICE buggery now that we get mediasize from xml
* o since you can't use DIOCGDINFO and DIOCGSLICEINFO on drive nodes with geom,sam2002-10-191-62/+456
| | | | | | | | | | | | | get the xml configuration for the devices and "parse" the information to get what's needed o replace #ifdef DEBUG constructs with DPRINT/DPRINTX to make the code more readable Note the xml "parser" is very very hackish and should be replaced with a real one. This one was done to be very small and special-purpose; don't think about copying it elsewhere. Approved by: phk
* o ioctl DIOCGDINFO error wasn't checkedsam2002-10-171-7/+29
| | | | | | | | | | | | o memory wasn't reclaimed in certain cases o add more msgs under #ifdef DEBUG o rewrite tangle of for loops for clarity NB: Open_Disk should redo how it malloc's memory so the caller can free everything. Documentation says the caller can free the disk list to reclaim everything but this leaks the indirect strings. Fixing this is simple for the sysctl case but adds complexity to the fallback, non-sysctl, case.
* correct arg order to strlcpy/strlcat under #ifdef alphasam2002-10-171-2/+2
|
* Use buffer-safe string functions for paranoia.kris2002-10-121-11/+12
|
* Zero memory after malloc. This stops sysinstall from dumping corekris2002-10-121-0/+1
| | | | | | during disk probing with malloc debugging enabled. MFC after: 1 week
* Fix to support pc98.nyan2002-10-081-0/+4
|
* 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.
OpenPOWER on IntegriCloud