Commit Graph

286 Commits

Author SHA1 Message Date
Yoshihiro Takahashi
4fe043b760 Add over 32GB disk support on pc98 (userland part).
Submitted by:	Hirokazu WATANABE
2005-03-30 13:03:33 +00:00
Stefan Farfeleder
f51df9ed11 Initialise `sn' before using its value. 2005-03-08 21:46:18 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Xin LI
122dc5646e Remove an unnecessary defination of New_Chunk, which has been
defined in libdisk.h.
2005-01-05 14:07:31 +00:00
Tom Rhodes
8f79184fe2 Various markup and spelling fixes.
PR:		75574
Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp> (original version)
2004-12-29 02:18:24 +00:00
Pyun YongHyeon
2d25239038 Plug memory leak.
MFC after:	1 week
2004-12-22 08:17:18 +00:00
Ruslan Ermilov
ab7a294721 NODOCCOMPRESS -> NO_DOCCOMPRESS
NOINFO -> NO_INFO
NOINFOCOMPRESS -> NO_INFOCOMPRESS
NOLINT -> NO_LINT
NOPIC -> NO_PIC
NOPROFILE -> NO_PROFILE
2004-12-21 09:33:47 +00:00
Poul-Henning Kamp
54c7ea9dbf Add 0xbf (191) as new Solaris partition identifier.
Submitted by:	Lawrence.Lee@sun.com
2004-11-10 07:50:16 +00:00
Marcel Moolenaar
a1107cc375 Don't barf when we encounter an UUID for GPT partitions. Instead, add
the GPT partition on i386 and adm64 as type=gpt, subtype=0 and with the
sname set to the UUID. This prevents sysinstall from bombing out. This
also makes sure the GPT partition shows up in sysinstall so as to avoid
accidental "clobberage".

PR:	bin/72896
2004-10-31 01:28:59 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Pawel Jakub Dawidek
08aa5a1ddb We have now so many GEOM classes that it is better to just skip unknown
classes than exiting.

Reviewed by:	le
OK'ed by:	phk
2004-09-13 16:06:14 +00:00
Lukas Ertl
6ce35ad043 Ignore geom_stripe providers.
MFC in: one week
2004-09-13 11:28:54 +00:00
Marcel Moolenaar
7bf298bcad Don't use type unknown for partitions that we don't care about because
the chunk will never be added to the list in that case. Use type mbr
for GPT nested MBRs and use type part for any partition we don't know
or care about. Since the subtype is 0, this should not cause confusion.
2004-08-05 17:44:07 +00:00
Lukas Ertl
31359ff400 Typo in comment. 2004-08-02 19:57:37 +00:00
Lukas Ertl
3231ba13da Ignore geom_vinum providers. 2004-08-02 19:14:58 +00:00
Ruslan Ermilov
1a0a934547 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
Brian Somers
5661d9de75 Handle read_block() failures by ignoring the disk rather than
dumping core.
2004-06-04 11:49:11 +00:00
Stefan Farfeleder
a752604477 Remove spurious semicolons. Outside of functions they are actually errors but
GCC doesn't warn about them without -pedantic.

Approved by:	das (mentor)
PR:		56649
Reviewed by:	md5
2004-05-16 22:08:17 +00:00
Peter Grehan
acc2f44a41 PowerPC support.
submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
approved by:   phk, jhb
2004-04-21 23:21:13 +00:00
Yoshihiro Takahashi
c16289f1c1 MFi386: WARNS=4 clean. 2004-03-30 12:22:31 +00:00
Jun Kuriyama
8aed1d4e4d Down to WARNS=2 for a while. 2004-03-30 06:16:41 +00:00
Jun Kuriyama
653681fb30 Make libdisk WARNS=4 clean.
Glanced by:	jhb
2004-03-30 01:39:00 +00:00
John Baldwin
707e509a1e Change libdisk and sysinstall to use d_addr_t rather than u_long for disk
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
2004-03-16 17:07:06 +00:00
Johan Karlsson
b51049906c style.Makefile:
Use WARNS?= instead of WARNS=.
2004-02-23 20:07:47 +00:00
Marcel Moolenaar
b60c2339a9 In Write_Disk(), fix the non-error case where we returned to the
caller without closing the disk device and freeing allocated
memory. Not closing the disk device prevents GEOM from retasting
after spoiling.

Pointy hat: marcel
2004-01-30 20:52:54 +00:00
Marcel Moolenaar
94635227fd Fix an uninitialized variable bug that caused write_pmbr() to bogusly
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.
2004-01-28 03:38:25 +00:00
Yoshihiro Takahashi
109479ce29 Fixed pc98 partition type. 2004-01-27 15:25:33 +00:00
Marcel Moolenaar
c316572024 Declare crc32 static. There's a copy in libz that conflicts for the
crunched binary.

Found by: make release
2003-11-17 05:47:42 +00:00
Marcel Moolenaar
d55a273392 The partition naming on ia64 (e.g. da0p1) cannot be selected based
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
2003-11-12 17:44:37 +00:00
Marcel Moolenaar
a9eccd0273 o Save a copy of the GPT entries for which there's a chunk with an
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.
2003-11-04 03:49:01 +00:00
Marcel Moolenaar
b6733aeb68 Don't divide the start and end of the chunk by the sector size when
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.
2003-11-03 06:52:30 +00:00
Marcel Moolenaar
89eaefd6eb Fix two bugs in the calculation of the last LBA of the GPT covered
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.
2003-11-03 06:24:48 +00:00
Marcel Moolenaar
93f57d1562 Rewrite Write_Disk() so that it creates a GPT. Note that the code is
basicly untested, but the guts is all there. I need to free up a disk
before I give it a spin.
2003-11-03 03:18:34 +00:00
Marcel Moolenaar
0d7c0ed330 Turn Write_Disk() into a stub for now. It needs to be rewritten to
write out a GPT and not a MBR.
2003-11-02 08:41:18 +00:00
Marcel Moolenaar
f5ea9b34c6 o Move Int_Open_Disk() from disk.c to open_disk.c for use by all
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.
2003-11-02 08:39:08 +00:00
Marcel Moolenaar
78cb7a7cd0 Do not fill in d_ncylinders, d_ntracks and d_nsectors in the disklabel
on ia64. Not only do we not have a disklabel by default, we also do
not have a notion of cylinders, tracks and sectors.
2003-11-02 08:07:25 +00:00
Marcel Moolenaar
c0c0907820 Compile-out support for allfreebsd, dedicate, sanitize and bios on
ia64. These commands are PC specific and not supported.
2003-11-02 08:01:18 +00:00
Marcel Moolenaar
aff198c706 Turn Track_Aligned(), Prev_Track_Aligned(), Next_Track_Aligned(),
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.
2003-11-02 07:58:19 +00:00
Marcel Moolenaar
03e432ad9c o In Print_Chunk(), don't print the address of the chunk on ia64. It
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.
2003-11-02 07:44:59 +00:00
Robert Watson
f9657fb6bf Disable #define DEBUG in libdisk by default: since libdisk is primarily
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.
2003-09-27 17:44:41 +00:00
David E. O'Brien
e6f1abaa68 Ignore ccd(4)'s. This is not the best solution, but it at least removes
the "BARF 360" ccd(4) user's experience.

Submitted by:	rwatson
2003-08-28 17:39:09 +00:00
Scott Long
4e89f2d88f Sanity check the list obtained from the kern.disks sysctl so that Disk_Names()
doesn't get fooled into returning a bogus list.  This should fix sysinstall
from segfaulting when no disk devices are present.
2003-06-07 20:02:56 +00:00
Peter Wemm
2512cd4e8f Teach libdisk that AMD64 works just like i386 2003-04-30 21:03:16 +00:00
David E. O'Brien
9be6d929b1 Only define platform once -- in a C file. 2003-04-30 17:14:58 +00:00
Poul-Henning Kamp
604c210c15 Fix a compiler warning.
Submitted by:	David Leimbach <leimy2k@mac.com>
2003-04-23 12:15:31 +00:00
Poul-Henning Kamp
32c44cd7bb Fix compilation errors.
I wonder how I managed to cross-compile this yesterday.
2003-04-22 05:34:35 +00:00
Poul-Henning Kamp
9ad2132174 Update libdisk to use the explicing encoding function for sunlabel data
structures.
2003-04-21 20:36:44 +00:00
Poul-Henning Kamp
a12b1b124a Use sized cast matching the sized pointer. 2003-04-04 16:59:39 +00:00
Poul-Henning Kamp
197e5e73ef Libdisk does not need to include <sys/diskslice.h> any more.
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.
2003-04-04 16:35:16 +00:00
Philippe Charnier
592bb5e477 The .Nm library 2003-03-24 16:01:01 +00:00