summaryrefslogtreecommitdiff
path: root/lib/libdisk
Commit message (Collapse)AuthorAgeFilesLines
* 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-410/+485
| | | | 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
* Remove parameter names from function prototypes (at least one collidedChad David2002-11-111-36/+37
| | | | | | | | | with stdlib.h). discussed with: phk Notes: svn path=/head/; revision=106783
* Remove debugging printfs.Poul-Henning Kamp2002-11-111-7/+0
| | | | Notes: svn path=/head/; revision=106761
* 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
* Write the boot block to the first 16 sectors of all partitions, instead ofJake Burkholder2002-11-101-12/+13
| | | | | | | | | | | | | always to the first 16 sectors of the disk. The firmware reads the boot code from a partition, defaulting to 'a' if none is specified, which only corresponds to the first 16 sectors of the disk if 'a' is first. Solaris often makes the swap partition first, instead of the root partition, and users expect to be able to do the same with freebsd as well. This also allows one to temporarily boot from another partition if the boot block on the root partition gets scrambled somehow. Notes: svn path=/head/; revision=106745
* Add efi to the list of types for which we need to return tha name.Marcel Moolenaar2002-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. Notes: svn path=/head/; revision=106743
* Add an efi chunk type. We need to be able to create an EFI partitionMarcel Moolenaar2002-11-101-0/+1
| | | | | | | | on ia64, because that's where we need to put the loader and the kernel. Notes: svn path=/head/; revision=106742
* General cleanup:Marcel Moolenaar2002-11-101-96/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | o Remove all code guarded by !defined(__ia64__). This file is specifically written for ia64, o Handle the case when read_block() or write_block() fails. We don't want sysinstall(8) to signal a thumbs-up on error, o Set the starting (cyl,hd,sect) triple to 0xFFFFFF when either bios_hd or bios_sect is zero or the LBA us not representable with the triple. In that case automaticly initialize the ending triple with 0xFFFFFF as well, o Reindent Write_Int32() as it was different than the rest of the file, o Remove some unused variables that appeared to be used but were effectively useless. o Plug a memory leak: The second timne we read the MBR, we write out a modified block, but didn't free the memory after writing. o Replace d1->sector_size with 512 when we read/write the MBR. We ignore the sector size in cases we shouldn't but adhered to it in cases it would be wrong if the sector_size wasn't 512. This file should eventually be rewritten to write out a GPT. For now, a MBR will do... Notes: svn path=/head/; revision=106741
* - Recognize FAT partition on MBR and PC98 disks.Yoshihiro Takahashi2002-11-081-20/+47
| | | | | | | - Fix to convert to the name of partition. Notes: svn path=/head/; revision=106633
* MFi386: revision 1.4.Yoshihiro Takahashi2002-11-081-1/+0
| | | | Notes: svn path=/head/; revision=106623
* Don't set a variable to a bogus value right before setting it to theJohn Baldwin2002-11-082-2/+0
| | | | | | | correct value in the next statement. Notes: svn path=/head/; revision=106622
* Don't set a value to a variable that we don't use.John Baldwin2002-11-081-1/+0
| | | | Notes: svn path=/head/; revision=106621
* - Merge Write_FreeBSD() into Write_Disk().John Baldwin2002-11-081-40/+32
| | | | | | | - Miscellaneous cleanups. Notes: svn path=/head/; revision=106619
* Fixed pc98 support.Yoshihiro Takahashi2002-11-072-6/+5
| | | | | | | (merged i386 changes from chunk.c 1.41 and disk.c 1.100) Notes: svn path=/head/; revision=106549
* Get this closer to working. The Write_Disk() function's for loop neededJohn Baldwin2002-11-071-20/+13
| | | | | | | | | | to use the same start condition as the i386 version. However, since Alpha's only have one fake "slice" from sysinstall's perspective we don't need to use a loop, but can just write out the BSD label in the first fake "slice". Notes: svn path=/head/; revision=106548
* Remove unused MBR gunk leftover from i386.John Baldwin2002-11-031-11/+1
| | | | Notes: svn path=/head/; revision=106384
* Fix to compile for pc98.Yoshihiro Takahashi2002-11-031-0/+8
| | | | Notes: svn path=/head/; revision=106373
* Initialize d->bios_cyl. We know the media size in sectors, the numberMarcel Moolenaar2002-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. Notes: svn path=/head/; revision=106368
* Add support for GPT:Marcel Moolenaar2002-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. Notes: svn path=/head/; revision=106343
* Add support for ia64. This is almost identical to i386, except thatMarcel Moolenaar2002-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. Notes: svn path=/head/; revision=106342
* Don't claim all MBR's have subtype 165 on i386.Poul-Henning Kamp2002-11-022-3/+2
| | | | | | | Spotted by: Frode Nordahl <frode@nordahl.net> Notes: svn path=/head/; revision=106337
* Fill in partition 2 with with "whole disk" parameters.Poul-Henning Kamp2002-11-011-0/+8
| | | | Notes: svn path=/head/; revision=106303
* Style(9) improvements.Poul-Henning Kamp2002-10-311-6/+6
| | | | Notes: svn path=/head/; revision=106241
* Set the sector size for the disk.Poul-Henning Kamp2002-10-311-0/+2
| | | | Notes: svn path=/head/; revision=106240
* Restore to pc98 support.Yoshihiro Takahashi2002-10-313-50/+108
| | | | Notes: svn path=/head/; revision=106238
* Use ${MACHINE} variable instead of using '.if .endif' each machines.Yoshihiro Takahashi2002-10-311-18/+1
| | | | Notes: svn path=/head/; revision=106237
* Add '#include <err.h>' for warn().Yoshihiro Takahashi2002-10-311-0/+1
| | | | Notes: svn path=/head/; revision=106236
* Actually save the bootblock in the disk structure. Write the bootblockJake Burkholder2002-10-312-2/+9
| | | | | | | to the right place on the disk instead of srewn all over it. Notes: svn path=/head/; revision=106232
* Untested alpha disk writer.Poul-Henning Kamp2002-10-301-1/+1
| | | | Notes: svn path=/head/; revision=106223
* Write out 15 sectors of boot code.Poul-Henning Kamp2002-10-301-0/+4
| | | | Notes: svn path=/head/; revision=106222
* Getting closer to getting things right:Poul-Henning Kamp2002-10-292-4/+3
| | | | | | | | | | Always ignore the RAW_PART for BSD. Having no quirks is not a mistake for an architecture. Tested by: DES Notes: svn path=/head/; revision=106155
* Don't call warn(3).Poul-Henning Kamp2002-10-291-5/+1
| | | | Notes: svn path=/head/; revision=106141
* Since make release is toast anyway, add wood to the pyre:Poul-Henning Kamp2002-10-295-744/+314
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=106135
* Fix various minor issues.Poul-Henning Kamp2002-10-291-3/+5
| | | | | | | Don't explode on 'write' because we access a pointer we just freed. Notes: svn path=/head/; revision=106116
* 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
* Add the write_spar64_disk.c to make life easier for testers.Poul-Henning Kamp2002-10-291-0/+94
| | | | | | | | This file depends on some major surgery in the rest of libdisk which is not yet committed. Notes: svn path=/head/; revision=106113
* Add back ia64 support that was removed in the last few revisions.Peter Wemm2002-10-274-1/+31
| | | | | | | I've cloned write_ia64_disk.c from write_i386_disk.c. Notes: svn path=/head/; revision=106008
* #ifdef out assignToPartition on non x86 arches to unbreak the worldAndrew Gallatin2002-10-241-0/+2
| | | | | | | on alpha, sparc64 and ia64 Notes: svn path=/head/; revision=105873
* More lobotomy:Poul-Henning Kamp2002-10-238-111/+6
| | | | | | | | | | 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 another 10 mindless #ifdefs.Poul-Henning Kamp2002-10-231-59/+45
| | | | Notes: svn path=/head/; revision=105820
* Rely on sysctl kern.disks to be there, and get rid of one of the far tooPoul-Henning Kamp2002-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... Notes: svn path=/head/; revision=105818
* Remove unnecessary ioctls tickling kernel side to realize that we fiddledPoul-Henning Kamp2002-10-237-55/+3
| | | | | | | with the disk. GEOM will automatically retaste when we closet he filedesc. Notes: svn path=/head/; revision=105817
* Untangle #ifdefs in the write-end of things by giving each arch itsPoul-Henning Kamp2002-10-2311-322/+968
| | | | | | | | | | 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. Notes: svn path=/head/; revision=105816