- 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
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
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.
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
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.
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.
argument. Leave a compatibility shim for Delete_Chunk().
Implement DELCHUNK_RECOVER flag so sysinstall can ask libdisk
to recover space when deleting a chunk.
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
+ make Open_Disk sense the sector size by trying 512, 1024 and 2048
in this order. This makes the kernel note that
dscheck(cd1): bio_bcount 512 is not on a sector boundary (ssize 2048)
dscheck(cd1): bio_bcount 1024 is not on a sector boundary (ssize 2048)
if 2048 is the sector size. If this worries anyone: the message is from
/usr/src/sys/kern/subr_diskslice.c and shutups are to be placed there.
+ Have read_block and write_block use an additional parameter, the
sector size.
+ replace all barfout calls with return NULL, 0, __LINE__, etc.
Note that this does NOT emit diagnostics. More often than not,
you don't want library functions to scribble on stderr -- it may
not even be available. The right thing is to propagate the error
condition to upper management. The app should take care of errors.
+ use d1->sector_size instead of 512 in various places. I've left many
places untouched, especially those writing MBRs. I simply added
another arg hardcoded as 512. This is because I would not know what
I'm doing... I felt this approach would be reasonably backward
compatible and not introduce any new bugs in critical software.
Famous last words. Messing with MBRs might soon put me in the same
screwup meister category as, uh, never mind. :-)
+ bump the max no of disks from 20 to 32 (due to PR 24503).
PR: 8434 / 8436 / 24503
Submitted by: Jens Schweikhardt <schweikh@schweikhardt.net>
`err()'). libdisk does! and additionally libdisk gets confused on Alpha
disks with foreign disklabels, throws up its hands and exits. This is
the cause of the "going no where without my init" install bug on the Alpha.
So now on the Alpha, rather than call err(), we print the error string and
continue processing.
Submitted by: jkh
with fdisk, ensure that they are a multiple of the sector size in length.
- Axe all the 1024 cylinder checks as they are no longer relevant with the
fixed bootstrap.
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
- add __BEGIN_DECLS and __END_DECLS,
- add a bunch of ``const'' qualifiers all over the place,
- rename the `private' struct member into `private_data' to avoid the
clash with the C++ keyword.
Made an All_FreeBSD() function.
Added a cmd-line interface (lowest rank) to the tst01 program.
The tst01 program is harmless (worst it can do is coredump), but it
is instructive to run, you can see what the slice-code things of your
disk...