Commit Graph

48 Commits

Author SHA1 Message Date
andvar 65b579494c fix typo in method name: part_attr_fornat_str -> part_attr_format_str. 2024-04-11 06:42:18 +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 d771a36cae We may try to extract the "last mounted on" field from EFI partitions
too.
2022-07-10 12:49:05 +00:00
martin 78fe337e2f Enhance support for the pseudo file system type "EFI System Partition". 2022-06-11 15:41:19 +00:00
martin dedf178a07 Remove unused field. 2022-06-11 15:30:48 +00:00
andvar 63264fc80c s/controll/control/ in comments. 2022-05-23 21:46:11 +00:00
andvar a41f6947a1 fix few typos for word "previous(ly)" in comments. 2022-03-23 13:06:06 +00:00
andvar 492c086f0a s/begining/beginning/ in comments and messages. 2022-01-24 09:14:36 +00:00
msaitoh 83cf79d6fc s/partiton/partition/ 2021-12-05 07:06:17 +00:00
martin 43fa2aa1e9 For FS_MSDOS report the MBR type as fs_sub_type. 2021-05-09 10:37:49 +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 ea4944af8e Do not force alignment of the first partition by default (which is
treated special to skip the first track), unless an existing partition
table hints at it.
2020-10-23 19:02:58 +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 6a8fd65bf3 Use an install target hint to mark a new partition active.
When compiled with BOOTSEL support, also name the new partition "NetBSD".
2020-10-10 18:49:27 +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 a23a20c65a Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.
2020-09-29 15:29:17 +00:00
joerg e45e02400d Don't depend on common symbol definitions. 2020-04-22 23:43:12 +00:00
martin 5dd26405c9 PR bin/54944: explicitly reject GPT protective MBRs. 2020-02-06 18:07:22 +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 249ed7a6e5 First try to bring evbarm installation closer to current reality. 2020-01-20 21:26:35 +00:00
martin 4b10af5a64 PR install/54872: fix printf argument order, sectors and heads were
swapped in the bios geometry display.
2020-01-18 18:39:55 +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 9e1b8986ab PR install/54787: when trying to derive proper alignement and first offset
from exisiting partitions, use the first partition offset if it is already
closer to the start of the disk than the prefered alignment - we can not
move existing partitions around.
2020-01-14 19:28:31 +00:00
martin 484980a3f3 When reading the secondary disklabel partitions from an existing disklabel
set the mbr partitions as parent.
2020-01-09 19:51:49 +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 c62f035be3 When requesting no special FS sub type, default to FAT32 with LBA.
Fixes one part of PR 54490.
2019-08-27 17:23:24 +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 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 5aa2dd134b Do not free() an array embedded in another structure 2019-07-25 18:55:40 +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 72fce37fcf Add (U)EFI system partition type 2019-07-12 18:23:06 +00:00
christos 24ecf24e51 Use _fmt_ msg_ methods when formats are needed. 2019-06-20 00:43:55 +00:00
martin d2aaad127e Deal with manualy set disk geometries more carefully to avoid a division
by zero.
2019-06-19 17:32:31 +00:00
martin 83478358c9 When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.
2019-06-15 08:20:33 +00:00
martin 66a5de9927 After deleting all partitions, reset alignment to the values we would
have used on an empty disk.
2019-06-15 07:57:38 +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
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 a67ab68028 Now that size estimates are not way off anymore, only double the size
for the minimal suggested partition.
2018-11-16 19:55:18 +00:00
martin 352a555edc Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.
2018-11-15 10:34:21 +00:00
martin 2575b4dcc3 Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).
2018-06-03 13:16:30 +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 ad279af689 On architectures that have no BIOS (and so do not set a BIOS geometry)
we need to initialize the globals bsec, bcyl and bhead before using
them.
2014-10-21 18:19:17 +00:00
martin 36f4a5867f Remove (accidently) duplicated code - pointed out by coverity scan. 2014-08-19 06:49:21 +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
dholland 50dbef1a09 Move sysinst sources to usr.sbin.
This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.
2014-07-26 19:30:39 +00:00