Commit Graph

51 Commits

Author SHA1 Message Date
martin 4013f0cf31 PR 57927: when comparing old and new partition state during renumbering,
ignore differences in the install target flag - the backend might have
flipped it off already to ensure only a single partition is marked
as install target.
2024-02-14 13:52:11 +00:00
martin a018a4a90d Force alignment of disk buffers to at least 8 byte.
Fixes PR 56434.
2023-11-20 18:03:55 +00:00
martin dd394e6375 Switch to "-" (single minus) as input denotation for "no mount point"
in all translations and adjust the code accordingly.
Pointed out by Thierry Laronde.
2023-10-31 14:03:33 +00:00
martin aa21971f77 When matching real partitions to "wanted" install descriptions, skip
all types of special partitions (like raw disk, or the MBR container
partition for the NetBSD part of the disk).
The start of the partition is no unique identifier if we include these
in the matching (e.g. boot partition and raw partition may both start
at sector 0).
2023-01-06 18:19:27 +00:00
martin 8abbf48823 Minor fix calculating the remaining buffer size for partition flags. 2023-01-06 15:07:22 +00:00
martin f36c93121c PR 57100: check if we can newfs the proper fstype when adding a new
partition and accepting the default FS type.
2022-12-15 20:21:16 +00:00
martin c5acd70fc9 PR 57100: when adding a new partition, update current flags after
the backend has added the partion, so the re-sorting later can
match the new data properly.
2022-12-15 15:29:51 +00:00
martin da75446885 Comment and code style (cosmetic) changes, no functional change 2022-12-10 16:13:19 +00:00
martin c6fbd2016e Add support for FFSv2ea in the partition type menus (internally setting
fs version to 3 for this, where 2 is FFSv2 and 1 is FFSv1)
2022-11-30 15:53:35 +00:00
chs 87ba0e2a31 Restore backward compatibility of UFS2 with previous NetBSD releases by
disabling support in UFS2 for extended attributes (including ACLs).
Add a new variant of UFS2 called "UFS2ea" that does support extended attributes.
Add new	fsck_ffs operations "-c	ea" and	"-c no-ea" to convert file systems
from UFS2 to UFS2ea and	vice-versa (both of which delete all existing extended
attributes in the process).
2022-11-17 06:40:38 +00:00
martin 55bddebd42 Fix free space accounting when partitions change size or are deleted.
Part of PR 56886.
2022-06-21 15:46:10 +00:00
martin 879a69316d renumber_partitions() needs to deal with removed/added partitions. 2022-06-21 15:45:03 +00:00
martin e58e24d52b PR 56893: fix input validation when the user moves a new partition to
a totaly different part of the disk. Fix size handling for freshly
added partitions (which would previously use random stack data due to
bogus error checking).
2022-06-20 16:06:38 +00:00
martin 0998f09feb Centralize the "we can newfs this type of filesystem" predicate
and fix the list.
2022-06-19 12:08:31 +00:00
martin dc4cc574c6 Typo in comment 2022-06-18 13:52:42 +00:00
martin d5590295ea Avoid integer arithmetic overflow when checking a partition table without
any partitions.
Fix some comments.
2022-06-11 18:27:22 +00:00
martin 78fe337e2f Enhance support for the pseudo file system type "EFI System Partition". 2022-06-11 15:41:19 +00:00
martin 9ba59248ef Add support for explicitly selecting "EFI system partition" as a partition
type.
2022-06-09 18:26:06 +00:00
martin df9fc8fe01 Do not allow editing of start/size/fs-type for partitions that
are already carved in stone (e.g. defined in an outer MBR while we are
editing the inner disklabel).
2021-05-09 11:06:20 +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
wiz 0fff63c9f6 comparision -> comparison 2020-12-02 14:20:19 +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 a207068d8b When renumbering partitions (after deletions) be slightly more lax
in matching, to cope with differences between MBR EFI partitions and
disklabel MSDOS partitions.
2020-10-13 11:28:32 +00:00
martin 6ddad1490c Remove more pm->ptstart abuse - calculate values localy where needed
instead.
2020-10-10 19:42:19 +00:00
martin 8f65adda90 When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.
2020-10-09 18:33:00 +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 8e2247ea41 PR 55381: try to deal with moved (but not yet saved) partitions when
calculating free space
2020-09-29 14:29:56 +00:00
martin 194d5a77b0 Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.
2020-09-22 16:18:54 +00:00
martin d988559899 In the concrete partitions editor, after deleting the last partition move
the menu selection to the "add a partition" entry (instead of the sentinel
line which is not an active menu entry).
2020-09-22 12:21:11 +00:00
martin bed1a988f9 When adding a new partition in the concrete partition editor, make sure
to set a pointer to the partition table interface in the new entry.
Otherwise we may end up not writing back the partitions at all, leading
to further fallout later.
Receipe to reproduce the issue from Frederic Fauberteau, thanks!
2020-09-22 11:44:44 +00:00
martin 909a0d73c8 PR 55572: avoid crash when answering the mount point prompt for a previously
empty mount point with an emptry sting.
2020-08-14 08:46:54 +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 7f682dc5e0 Avoid using the global "pm" variable in utility functions - during
extended partitioning they may point to a different device.
2020-01-15 19:37:41 +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 ebdfc2d74c Fix overlapping partitions display 2019-12-15 11:22:46 +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 675f7bf669 PR 54065: add optional "old compat" variant of ext2fs in file system
type selection and use that as default for the cobalt boot file system.
2019-12-11 19:23:37 +00:00
martin 485d530922 Make cloning support optional, so we can save some space on very small
install media.
2019-11-13 18:57:26 +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 6477ac5760 Fix copy&pasto: when we find a FFSv1 filesystem, properly record it
that way - so the correct bootblocks get installed on system upgrades.
2019-08-04 10:29:41 +00:00
martin 6de470330d Do not strip the trailing / on root mounts when evaluation "last mounted
on". Fix some /dev/ and raw vs. block device confusion on system upgrades.
2019-08-01 16:32:06 +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 0b27251139 Allow newfs for ext2fs partitions too. 2019-07-09 16:16:33 +00:00
christos ce713491ff no need to initialize fields that are already 0. 2019-06-22 20:46:07 +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
kre fbb3329fd3 Divide GIG by 512 (DEV_BLKSIZE) so we don't overflow 32 bit u_long
when multiplying by 128 (in 32 bits, 128 * GIG == 0)

Should fix i386 build )and other 32 bit ports).

An alternative would be to use ULL rather than UL for the numbers,
but that would mean needlessly doing 64 bit arith for data that is
resticted to 32 bit results anyway.
2018-11-28 00:44:08 +00:00
martin 72cf5c53dc Cosmetics: consistently use MEG and GIG defines for size calculations 2018-11-27 17:13:41 +00:00
martin 39e506156f Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.
2018-11-20 19:02:07 +00:00
martin e21052b4e5 Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.
2015-05-10 10:14:02 +00:00
martin 4b2364d962 (Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.
2014-08-03 16:09:38 +00:00