Commit Graph

196 Commits

Author SHA1 Message Date
nyan
2616a319ce Add '#include <err.h>' for warn(). 2002-10-31 05:38:48 +00:00
jake
3523a0f8a2 Actually save the bootblock in the disk structure. Write the bootblock
to the right place on the disk instead of srewn all over it.
2002-10-31 04:25:17 +00:00
phk
c925cf4a99 Untested alpha disk writer. 2002-10-30 20:54:22 +00:00
phk
01d1bdfdb0 Write out 15 sectors of boot code. 2002-10-30 20:52:07 +00:00
phk
d52f4602e2 Getting closer to getting things right:
Always ignore the RAW_PART for BSD.
Having no quirks is not a mistake for an architecture.

Tested by:	DES
2002-10-29 17:12:02 +00:00
phk
885738b312 Don't call warn(3). 2002-10-29 14:45:43 +00:00
phk
9ac588fcdc Since make release is toast anyway, add wood to the pyre:
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
2002-10-29 12:13:36 +00:00
phk
6e81beacf8 Fix various minor issues.
Don't explode on 'write' because we access a pointer we just freed.
2002-10-29 07:39:18 +00:00
phk
4d780c389d the 'd' partition hasn't been magic for years, so allocate it in natural
order instead of last.
2002-10-29 07:37:11 +00:00
phk
aee7fb11fe Add the write_spar64_disk.c to make life easier for testers.
This file depends on some major surgery in the rest of libdisk which is
not yet committed.
2002-10-29 07:35:36 +00:00
peter
29db798cec Add back ia64 support that was removed in the last few revisions.
I've cloned write_ia64_disk.c from write_i386_disk.c.
2002-10-27 00:21:02 +00:00
gallatin
e5963e51d5 #ifdef out assignToPartition on non x86 arches to unbreak the world
on alpha, sparc64 and ia64
2002-10-24 13:35:52 +00:00
phk
f9fe53ba89 More lobotomy:
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.
2002-10-23 21:05:42 +00:00
phk
8e1649e9df Remove another 10 mindless #ifdefs. 2002-10-23 20:35:42 +00:00
phk
7be332e622 Rely on sysctl kern.disks to be there, and get rid of one of the far too
many lists of disk device driver names in the system.  At this point
we should really get the names from the XML, but hey...
2002-10-23 20:15:10 +00:00
phk
c17cb9154e Remove unnecessary ioctls tickling kernel side to realize that we fiddled
with the disk.  GEOM will automatically retaste when we closet he filedesc.
2002-10-23 20:02:33 +00:00
phk
3c688df114 Untangle #ifdefs in the write-end of things by giving each arch its
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.
2002-10-23 19:52:32 +00:00
phk
a422fc77ae Separate the struct disklabel filling stuff from the rest of Write_FreeBSD(). 2002-10-23 19:32:18 +00:00
nyan
59e14a9b80 - The GEOM system does not work on pc98.
- Fix to build w/o the HAVE_GEOM option.
2002-10-23 13:00:09 +00:00
phk
e3a940d2bf Add the new extra argument also in the alpha case. 2002-10-23 10:47:00 +00:00
phk
260859f738 No longer needed. 2002-10-22 15:22:36 +00:00
phk
35c355e2f2 Remove the last traces of bogus MAKEDEV functionality. 2002-10-22 15:07:50 +00:00
phk
aa430888dc Live with it: I had hoped to find a neat way to deal with all the magic
numbers, but so far havn't come up with anything:  Add an #ifdef PC98.
2002-10-22 11:55:27 +00:00
phk
1bc5baf5c9 Avoid a lot of #ifdef PC98 code by giving a couple of the Chunk functions
an extra argument for all archs.
2002-10-22 10:51:58 +00:00
phk
43441f1d03 Swing the weed-whacker around libdisk:
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.
2002-10-22 09:13:02 +00:00
phk
57dd722cff Lobotomize MakeDev(), we don't need it with devfs. 2002-10-21 22:03:03 +00:00
phk
f6d2923501 Sigh, d_ntracks, not d_nheads. 2002-10-21 20:42:20 +00:00
phk
c166543507 fwheads and fwsectors got swapped underway.
Approved by:	sam
2002-10-21 19:44:07 +00:00
sam
8199d9ca41 Another baby step toward getting sysinstall working:
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
2002-10-20 22:19:37 +00:00
sam
715f7b0ad3 o since you can't use DIOCGDINFO and DIOCGSLICEINFO on drive nodes with geom,
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
2002-10-19 16:39:28 +00:00
sam
7fb694f053 not sure if this correct, but it compiles again 2002-10-18 00:26:34 +00:00
sam
68349b6d1c o ioctl DIOCGDINFO error wasn't checked
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.
2002-10-17 18:34:32 +00:00
sam
8680a53ace correct arg order to strlcpy/strlcat under #ifdef alpha 2002-10-17 18:23:21 +00:00
nyan
879ba46c82 Fix to check disk geometry.
Submitted by:	kawanobe@st.rim.or.jp (Kawanobe Koh)
2002-10-14 13:15:14 +00:00
kris
78372d114d Use buffer-safe string functions for paranoia. 2002-10-12 22:03:22 +00:00
kris
ab2f5d80c1 Zero memory after malloc. This stops sysinstall from dumping core
during disk probing with malloc debugging enabled.

MFC after:	1 week
2002-10-12 22:01:57 +00:00
nyan
4c34626aa8 Fix to support pc98. 2002-10-08 12:13:19 +00:00
phk
789741b5dc White-space change only. Move closer to style(9). 2002-10-04 18:10:39 +00:00
phk
eb28a1f905 #include the right thing for PC98
Sponsored by:	DARPA & NAI Labs.
2002-10-02 08:59:28 +00:00
phk
19150ba4f8 Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 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.
2002-10-01 07:24:55 +00:00
wollman
a50f81e50a Use correct printf format specifier to print unsigned longs. 2002-05-30 21:00:42 +00:00
ru
9f2bc31e30 NOSHARED is meaningless in the bsd.lib.mk context. 2002-05-13 12:00:45 +00:00
phk
02fe70f68e Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.

Sponsored by: DARPA & NAI Labs.
2002-05-12 20:49:41 +00:00
phk
811d04c86c Modernize my email address. 2002-03-25 13:52:45 +00:00
dillon
2a7ecd5129 Modify Delete_Chunk() into Delete_Chunk2() which can take a flags
argument.  Leave a compatibility shim for Delete_Chunk().

Implement DELCHUNK_RECOVER flag so sysinstall can ask libdisk
to recover space when deleting a chunk.
2002-01-07 07:47:25 +00:00
phk
c77a6625c0 Sort the disknames when we get them from the kernel.
Submitted by:	<anarcat@anarcat.dyndns.org>
2001-12-23 21:43:48 +00:00
dillon
c956ace928 Add auto-fill-on-delete. When deleting an 'A'uto created partition
sysinstall will automatically expand the previous partition to take up
the freed up space.  So you can 'D'elete /home and /usr will get the
combined space, or you can 'D'elete /tmp and /var will get the combined space.

This gives the user, developer, or lay person a huge amount of flexibility
in constructing partitions from an 'A'uto base.  It takes only 3 or 4
keystrokes to achieve virtually any combination of having or not having
a /tmp and/or /home after doing an 'A'uto create.

Change 'A'uto creation of /var/tmp to 'A'uto creation /tmp, which should
be less controversial.

MFC after:	6 days
2001-12-09 23:40:02 +00:00
matusita
44ad8faef3 One more fix for sysinstall/libdisk to create a device file
if and only if a target directory is devfs.  Previous patch
doesn't correct, it's unconditionally avoid to create a device
file if kernel knows devfs.

PR:		31109
2001-11-11 12:16:50 +00:00
peter
e63461ebd8 Add EFI GPT (238, 0xEE) and EFI System Parition (239, 0xEF) 2001-10-15 07:25:29 +00:00
jkh
3ecc099602 Check to see if the devfs MIB exists and return 1 if it exists rather
than making device node(s).
Submitted by:	Hiroo ONO <hiroo@oikumene.gcd.org>
2001-10-10 07:46:04 +00:00