Commit Graph

32 Commits

Author SHA1 Message Date
martin 5aa145f6e7 PR 58061: fix bug in the GPT backend: when inserting a partition
(i.e. not adding it at the end) a bogus ID was returned for the new
partition.
2024-03-24 17:29:58 +00:00
andvar d378954346 fix misplaced or missing "e" in words with "ment" ending (argument, implement,
increment, decrement, alignment), in comments, documentation, log messages.
2024-02-08 20:51:24 +00:00
martin c4c8db1541 PR 57100: fix install flag handling for newly added GPT partitions,
fix multiple install flags when updating existing partitions.
2022-12-15 14:54:27 +00:00
martin 78fe337e2f Enhance support for the pseudo file system type "EFI System Partition". 2022-06-11 15:41:19 +00:00
martin fade124bc6 Do not defer wedge deletions when we have nothing mounted.
Define and use a constant for maximum disk name length.
2022-01-30 11:58:29 +00:00
martin 8bb96d39e3 Try to get rid of all wedges we created (after unmounting). 2022-01-29 15:32:49 +00:00
martin f15fffe7ba Use strlcpy() to copy the wedge device name (the code still assumes
the string is short enough and 0 terminated, but now gcc is happy).
2021-07-17 19:27:22 +00:00
martin 9238070ceb PR 56310: if we fail to create a wedge this either means there is
a bug here (and we requested something nonsensial), or there are pre-
existing "foreign" wedges which disturb our work.
So remove all wedges on this disk that we do not know about and retry
to add our new wedge.
2021-07-17 18:07:22 +00:00
martin 2f5e5e5d38 PR 56310: avoid assert() failures (or crashes) when the runtime addition
of a wedge fails (for whatever reasons).
2021-07-17 11:32:50 +00:00
rillig 6dccb7a0e9 sysinst: remove trailing whitespace from *.c *.h
In contrast to the messages files, this whitespace is not significant.
2021-01-31 22:45:46 +00:00
martin 852192b2dd Fix copy & pasto noticed by Jason Mitchell: change the type of a GPT
partition via "gpt type" - not "gpt label".
2020-10-14 04:17:43 +00:00
martin cb429b904f PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.
2020-10-13 17:26:28 +00:00
martin 957b5cd6f4 PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).
2020-10-12 16:14:32 +00:00
martin d9c7022040 PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.
2020-10-03 18:54:18 +00:00
martin 103d2d1e66 Ooops, fix previous (PT_* enum values here are not DKW_PTYPE_* values) 2020-03-30 12:19:28 +00:00
martin 3d593cdb32 Support partition type ZFS 2020-03-30 10:42:49 +00:00
martin 86906049de Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.
2020-01-27 21:21:21 +00:00
martin ead2350f26 Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.
2020-01-15 19:36:30 +00:00
martin abce8cb394 Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.
2020-01-09 13:22:30 +00:00
martin 194b0d85bc When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.
2019-12-13 22:12:41 +00:00
martin f77b58b179 Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).
2019-11-12 16:33:14 +00:00
martin 6f0d7230f9 Fix a bug when installing to pre-exising GPT partitions.
Handle GPT labels with spaces.
2019-08-26 12:14:06 +00:00
martin b04f4d6257 On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.
2019-08-14 13:02:23 +00:00
martin a7267d5357 Support upgrade of systems using NAME= syntax in /etc/fstab.
Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.
2019-08-07 10:08:04 +00:00
martin 9b4c571a0a When reading an existing gpt, match the wedges already existing ons
on the parent device, so we can use them directly if we should proceed
with an unmodified partition table.
2019-08-03 14:00:42 +00:00
martin 43d7f7864c Deal with missing labels when parsing gpt(8) output. 2019-08-02 10:44:22 +00:00
martin 4c36c108f4 If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.
2019-07-28 16:30:36 +00:00
martin 5b07b744fb Deal with partition types we don't know anything about. 2019-07-28 13:17:46 +00:00
martin 62056b8490 Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.
2019-07-26 08:18:47 +00:00
martin 7e7989f74b Fix a few calloc() calls with wrong arg order (harmless, but for consistency) 2019-07-25 13:16:35 +00:00
martin 1c49228872 Ignore corrupt GPTs 2019-06-23 11:47:08 +00:00
martin 4103857b9a Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

 - partitions are stored in a (partly abstract) struct disk_partitions
   and most parts of it are only accessed via accessor functions provided
   by a "partitioning scheme".

 - implement partitioning schemes for MBR, disklabel and GPT (with likely
   RDB [amiga] and Apple Partition Map [mac*] to follow soon)

 - partitioning schemes may be cascaded, e.g. on x86 when using MBR as
   "outer partitions", we have disklabel as "inner partitions".

 - all user interface goes via accessor functions in the partitioning scheme,
   some of which return pointers to special user interface descriptors
   (e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.
2019-06-12 06:20:17 +00:00