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.
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.
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...
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".
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.
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.
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.