Commit Graph

307 Commits

Author SHA1 Message Date
marcel
38f942a4e1 Add support for gpart:
o  Correct for gpart's 1-based index, versus 0-based index used by
   legacy slicers.
o  Parse and understand the xs and xt parameters.
2008-04-24 00:11:15 +00:00
marcel
ed972f84a3 Correct an off-by-1 for GPART. The literal partition type (i.e.
the actual UUID) is prefixed by '!' to distinguish them from
well-known aliases.

MFC after: 3 days
2008-04-23 03:00:26 +00:00
antoine
719cf15a1b - Make Disk_Names() behave as documented in libdisk(3): return an array
of disk names, where you must free each pointer, as well as the array
by hand. [1]
- Destaticize "disks" in Disk_Names, it has no reasons to be static.

PR:		kern/96077 [1]
PR:		kern/114110 [1]
MFC after:	1 month
Approved by:	rwatson (mentor)
2008-02-15 21:19:15 +00:00
mtm
8dfd7032f8 Hmmm, must get reading glasses or else change the font on my terminal. That
comma looks like a period.

Noticed by: brueffer
2007-11-24 11:58:54 +00:00
mtm
29af5707b7 Enclose entire header in #ifndef _LIBDISK_H_ 2007-11-20 22:48:32 +00:00
mtm
42050b5500 Capitalization 2007-11-18 18:44:35 +00:00
marcel
51f2b5019d Translate partitions of type "PART" to chunks of the same type
as they would have been translated from partitions of type "GPT".
This fixes sysinstall, now that geom_part has taken over from
geom_gpt.

Approved by: re (kensmith)
2007-09-21 16:24:01 +00:00
marcel
876d6af999 On PowerPC, geom_part has taken over the partitioning from geom_apple.
Translate partitions of type "PART" to chunks of type "apple" on
PowerPC. This fixes sysinstall.

Approved by: re (kensmith)
2007-09-21 16:19:50 +00:00
rink
bdcc40a9d2 Improve error handling in libdisk while parsing the kern.geom.conftxt sysctl.
Previously, any parse error will result in the calling program exiting with an
unpleasant message. This change will cause libdisk to issue a warning and
ignore lines it cannot parse instead of bluntly terminating the unfortunate
enough program.

This change will allow you to use sysinstall if you have a NTFS parition with
a space in the name (such as 'Win Xp'). In such a case, a line like the
following will appear in the kern.geom.conftxt output:

2 LABEL ntfs/Win Xp 209818635264 512 i 0 o 0

As the fields are space-separated, libdisk would go beserk and exit the program.
This would happen if using FreeBSD 7.0 snapshot images (as GEOM_LABEL is in
the installation kernel as well), thus making it impossible to install FreeBSD
without renaming your NTFS paritions.

Reported by:	Dwight Berendse <dwight at berendse dot org>
Nod from:	phk
Reviewed by:	imp
Approved by:	re (bmah), imp (mentor)
MFC after:	1 month
2007-08-05 16:55:40 +00:00
kmacy
ea415a0be8 unbreak build for sparc64 etc.
TARGET won't be defined on non subarches

Approved by: rwatson (mentor)
Reviewed by: jmg
2006-10-09 05:12:54 +00:00
kmacy
a37c943bc5 buildworld fixes for sun4v
not sure why pmap.c is included as it is unchanged

Approved by: rwatson (mentor)
Reviewed by: jmg
2006-10-09 04:58:45 +00:00
ru
aa1113efea Remove alpha-specific stuff. 2006-08-23 12:12:56 +00:00
marcel
50f9d9396b Fix a bug in the size of the PMBR partition. Since the partition starts
at LBA 1, the size is not the mediasize in sectors, but one less.
2006-08-09 20:19:15 +00:00
maxim
480c31c3fc o Add IDs for Plan9, QNX4.X, Mac OS-X, Linux exteneded partitions.
PR:		bin/96326
Submitted by:	Alex Kozlov
MFC after:	2 weeks
2006-04-25 20:42:15 +00:00
harti
02a28f2514 Instead of printing several pieces with .Sy just enclose the 'Note' block
into a .Bf/.Ef pair.

Submitted by:	ru
2006-01-30 08:26:59 +00:00
harti
9bf5db07ee The .Nm macro prints Open_Disk() instead of libdisk, so use an explicite
argument to get 'libdisk'. Also bump the date of the man page.
2006-01-27 16:38:05 +00:00
harti
8c7768240b Revert 1.45 now that snmp_hostres uses libgeom. 2006-01-27 16:32:13 +00:00
cognet
b52efc57be Add a dummy arm Write_Disk() function, and compile libdisk on arm. 2006-01-25 11:24:37 +00:00
ru
40e5b400fd Build shared library on behalf of bsnmpd. 2006-01-12 07:26:57 +00:00
ru
ae11cb5ef9 Fix prototypes. 2005-11-24 10:30:44 +00:00
nyan
db5f8a5b7b Merge two slice_type_name() functions. 2005-04-13 13:42:38 +00:00
nyan
eb3dd13248 Add over 32GB disk support on pc98 (userland part).
Submitted by:	Hirokazu WATANABE
2005-03-30 13:03:33 +00:00
stefanf
2619687e84 Initialise `sn' before using its value. 2005-03-08 21:46:18 +00:00
ru
1541af42f1 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
delphij
e714550b34 Remove an unnecessary defination of New_Chunk, which has been
defined in libdisk.h.
2005-01-05 14:07:31 +00:00
trhodes
769923c308 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
yongari
4b0d04a9a6 Plug memory leak.
MFC after:	1 week
2004-12-22 08:17:18 +00:00
ru
74176cc161 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
phk
2c5aa5f739 Add 0xbf (191) as new Solaris partition identifier.
Submitted by:	Lawrence.Lee@sun.com
2004-11-10 07:50:16 +00:00
marcel
e0e7753e22 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
ru
5db2b9d5b3 For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
pjd
578f126aa1 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
le
1774dbf956 Ignore geom_stripe providers.
MFC in: one week
2004-09-13 11:28:54 +00:00
marcel
e1a649e47c 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
le
537c655c95 Typo in comment. 2004-08-02 19:57:37 +00:00
le
ab2f52db36 Ignore geom_vinum providers. 2004-08-02 19:14:58 +00:00
ru
01548ace15 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
brian
1a106ea8b6 Handle read_block() failures by ignoring the disk rather than
dumping core.
2004-06-04 11:49:11 +00:00
stefanf
1b3274a8a0 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
grehan
a76af532c5 PowerPC support.
submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
approved by:   phk, jhb
2004-04-21 23:21:13 +00:00
nyan
fcbd1c72ce MFi386: WARNS=4 clean. 2004-03-30 12:22:31 +00:00
kuriyama
9b713c0d7f Down to WARNS=2 for a while. 2004-03-30 06:16:41 +00:00
kuriyama
235cde4aca Make libdisk WARNS=4 clean.
Glanced by:	jhb
2004-03-30 01:39:00 +00:00
jhb
b7e56e9eea 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
a1828721c8 style.Makefile:
Use WARNS?= instead of WARNS=.
2004-02-23 20:07:47 +00:00
marcel
9de97de175 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
58948e7261 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
nyan
49ed88543d Fixed pc98 partition type. 2004-01-27 15:25:33 +00:00
marcel
69f4b4a520 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
58594e4f86 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