aboutsummaryrefslogtreecommitdiff
path: root/lib/libdisk
Commit message (Collapse)AuthorAgeFilesLines
...
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-5/+10
| | | | Notes: svn path=/head/; revision=131504
* Handle read_block() failures by ignoring the disk rather thanBrian Somers2004-06-044-10/+34
| | | | | | | dumping core. Notes: svn path=/head/; revision=130067
* Remove spurious semicolons. Outside of functions they are actually errors butStefan Farfeleder2004-05-161-1/+1
| | | | | | | | | | | GCC doesn't warn about them without -pedantic. Approved by: das (mentor) PR: 56649 Reviewed by: md5 Notes: svn path=/head/; revision=129302
* PowerPC support.Peter Grehan2004-04-216-4/+125
| | | | | | | | submitted by: Suleiman Souhlal <refugee@segfaulted.com> approved by: phk, jhb Notes: svn path=/head/; revision=128541
* MFi386: WARNS=4 clean.Yoshihiro Takahashi2004-03-301-7/+7
| | | | Notes: svn path=/head/; revision=127617
* Down to WARNS=2 for a while.Jun Kuriyama2004-03-301-1/+1
| | | | Notes: svn path=/head/; revision=127604
* Make libdisk WARNS=4 clean.Jun Kuriyama2004-03-306-26/+31
| | | | | | | Glanced by: jhb Notes: svn path=/head/; revision=127595
* Change libdisk and sysinstall to use d_addr_t rather than u_long for diskJohn Baldwin2004-03-166-71/+74
| | | | | | | | | | | | | | | | | | | 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
* style.Makefile:Johan Karlsson2004-02-231-1/+1
| | | | | | | Use WARNS?= instead of WARNS=. Notes: svn path=/head/; revision=126176
* In Write_Disk(), fix the non-error case where we returned to theMarcel Moolenaar2004-01-301-4/+0
| | | | | | | | | | | caller without closing the disk device and freeing allocated memory. Not closing the disk device prevents GEOM from retasting after spoiling. Pointy hat: marcel Notes: svn path=/head/; revision=125253
* Fix an uninitialized variable bug that caused write_pmbr() to boguslyMarcel Moolenaar2004-01-281-3/+4
| | | | | | | | | return an error value that made Write_Disk() abort. While on the subject, improve the initialization of the error variable in read_gpt() and update_gpt() even though nothing was broken there. Notes: svn path=/head/; revision=125124
* Fixed pc98 partition type.Yoshihiro Takahashi2004-01-271-1/+1
| | | | Notes: svn path=/head/; revision=125084
* Declare crc32 static. There's a copy in libz that conflicts for theMarcel Moolenaar2003-11-171-1/+1
| | | | | | | | | crunched binary. Found by: make release Notes: svn path=/head/; revision=122839
* 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 Save a copy of the GPT entries for which there's a chunk with anMarcel Moolenaar2003-11-041-10/+55
| | | | | | | | | | | | | | index referencing it. We need to know the original type and name so that we know what to put in the table when we reconstruct it. o Clear the table entries before we rebuild it to avoid that we end up with stale data. o Sequentially populate the table entries from the chunks. For the chunks that have an index (now referencing the saved copy) we use the saved type and name. This way we can handle unknown types better. In all cases we update the start and end LBAs. Notes: svn path=/head/; revision=122025
* Don't divide the start and end of the chunk by the sector size whenMarcel Moolenaar2003-11-031-2/+2
| | | | | | | | | filling in the GPT entry. Both are already in sector numbers (LBA) and exactly what we need for the entry. We now write a structurally correct GPT partitioning. Notes: svn path=/head/; revision=121931
* Fix two bugs in the calculation of the last LBA of the GPT coveredMarcel Moolenaar2003-11-031-2/+2
| | | | | | | | | | | | part of the disk. The first appears to be a typo and instead of dividing the media size with the sector size, we multiplied. The second is an off-by-1 error that's the result of mixing up count and index. The code in question is only applicable for virgin disks and is used to create the "whole" chunk, which covers only the GPT usable portion of the disk. Notes: svn path=/head/; revision=121930
* Rewrite Write_Disk() so that it creates a GPT. Note that the code isMarcel Moolenaar2003-11-031-15/+363
| | | | | | | | basicly untested, but the guts is all there. I need to free up a disk before I give it a spin. Notes: svn path=/head/; revision=121921
* Turn Write_Disk() into a stub for now. It needs to be rewritten toMarcel Moolenaar2003-11-021-149/+2
| | | | | | | write out a GPT and not a MBR. Notes: svn path=/head/; revision=121889
* o Move Int_Open_Disk() from disk.c to open_disk.c for use by allMarcel Moolenaar2003-11-026-304/+603
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Do not fill in d_ncylinders, d_ntracks and d_nsectors in the disklabelMarcel Moolenaar2003-11-021-0/+2
| | | | | | | | on ia64. Not only do we not have a disklabel by default, we also do not have a notion of cylinders, tracks and sectors. Notes: svn path=/head/; revision=121887
* Compile-out support for allfreebsd, dedicate, sanitize and bios onMarcel Moolenaar2003-11-021-0/+2
| | | | | | | ia64. These commands are PC specific and not supported. Notes: svn path=/head/; revision=121886
* Turn Track_Aligned(), Prev_Track_Aligned(), Next_Track_Aligned(),Marcel Moolenaar2003-11-021-7/+22
| | | | | | | | | Cyl_Aligned(), Prev_Cyl_Aligned() and Next_Cyl_Aligned() into tautologies on ia64. GPT removes all notion of tracks, heads and sectors per track, so there are no alignment considerations. Notes: svn path=/head/; revision=121885
* o In Print_Chunk(), don't print the address of the chunk on ia64. ItMarcel Moolenaar2003-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. Notes: svn path=/head/; revision=121883
* Disable #define DEBUG in libdisk by default: since libdisk is primarilyRobert Watson2003-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. Notes: svn path=/head/; revision=120522
* Ignore ccd(4)'s. This is not the best solution, but it at least removesDavid E. O'Brien2003-08-281-0/+2
| | | | | | | | | the "BARF 360" ccd(4) user's experience. Submitted by: rwatson Notes: svn path=/head/; revision=119532
* Sanity check the list obtained from the kern.disks sysctl so that Disk_Names()Scott Long2003-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. Notes: svn path=/head/; revision=115981
* Teach libdisk that AMD64 works just like i386Peter Wemm2003-04-305-8/+14
| | | | Notes: svn path=/head/; revision=114329
* Only define platform once -- in a C file.David E. O'Brien2003-04-302-20/+23
| | | | Notes: svn path=/head/; revision=114300
* Fix a compiler warning.Poul-Henning Kamp2003-04-231-0/+2
| | | | | | | Submitted by: David Leimbach <leimy2k@mac.com> Notes: svn path=/head/; revision=113901
* Fix compilation errors.Poul-Henning Kamp2003-04-221-2/+1
| | | | | | | I wonder how I managed to cross-compile this yesterday. Notes: svn path=/head/; revision=113840
* Update libdisk to use the explicing encoding function for sunlabel dataPoul-Henning Kamp2003-04-212-11/+13
| | | | | | | structures. Notes: svn path=/head/; revision=113823
* Use sized cast matching the sized pointer.Poul-Henning Kamp2003-04-041-1/+1
| | | | Notes: svn path=/head/; revision=113085
* Libdisk does not need to include <sys/diskslice.h> any more.Poul-Henning Kamp2003-04-049-9/+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
* The .Nm libraryPhilippe Charnier2003-03-241-2/+3
| | | | Notes: svn path=/head/; revision=112540
* Ignore GBDE devices.Poul-Henning Kamp2003-03-171-0/+2
| | | | | | | Spotted by: Lucky Green <shamrock@cypherpunks.to> Notes: svn path=/head/; revision=112333
* Fix build error.Yoshihiro Takahashi2003-02-061-1/+0
| | | | Notes: svn path=/head/; revision=110454
* - Remove unused old disk pointers from Write_FreeBSD() and Fill_Disklabel()John Baldwin2003-02-047-21/+18
| | | | | | | | functions. - Clean up a few signed/unsigned warnings. Notes: svn path=/head/; revision=110339
* Remove mostly unused disk arguments from Fixup_*_Names() functions.John Baldwin2003-02-041-9/+9
| | | | Notes: svn path=/head/; revision=110338
* Use the fstype obtained from the GEOM dumpconf output to set the fstypeJohn Baldwin2003-01-101-1/+1
| | | | | | | | | | of BSD part chunks when opening a disk. Reviewed by: phk MFC after: 2 days Notes: svn path=/head/; revision=109082
* - Make New_Disk() non-static so it can be used in Create_Chunk_DWIM().John Baldwin2003-01-103-3/+21
| | | | | | | | | | | | | | | | | - 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
* Rename the dos_partition structure for pc98 to pc98_partition.Yoshihiro Takahashi2003-01-041-2/+2
| | | | Notes: svn path=/head/; revision=108650
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Return an error if the size of the sector is zero. This is for removableYoshihiro Takahashi2002-12-261-0/+6
| | | | | | | | | | | devices that is not inserted any media. This is MFC candidate. Submitted by: ISAKA Yoji <isaka@cory.jp> Notes: svn path=/head/; revision=108292
* Consistently mark std(in|out|err) with .Dv, because that's how theyRuslan Ermilov2002-12-041-1/+2
| | | | | | | | | | are marked up in stdio(3), and because they are defined expressions of type "FILE *". Approved by: re Notes: svn path=/head/; revision=107619
* Break up a bunch of crazy if statements to use a case statement insteadJohn Baldwin2002-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 Notes: svn path=/head/; revision=107531
* - Ease sanity check to get cylinders.Yoshihiro Takahashi2002-11-171-6/+12
| | | | | | | - Get the slice name from the result of kern.geom.conftxt. Notes: svn path=/head/; revision=107011
* Fixed style(9)Yoshihiro Takahashi2002-11-1514-409/+484
| | | | Notes: svn path=/head/; revision=106949
* Handle EFI partitions the same as regular FAT partitions. The onlyMarcel Moolenaar2002-11-132-0/+4
| | | | | | | | | 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. Notes: svn path=/head/; revision=106837
* - Document the chunk_name() function that replaces chunk_n[].Chad David2002-11-111-5/+10
| | | | | | | - Rearrange things a tiny bit. Notes: svn path=/head/; revision=106784