Commit Graph

76 Commits

Author SHA1 Message Date
andvar 8324be4c9b fix some more typos in comments/log messages, improve wording as well. 2021-08-21 11:55:24 +00:00
martin 38248942cf PR 56354: all actions to set up swap space are not guaranteed to gain
us enough virtual memory anyway, so drop return codes from set_swap*.
The state for cleanup (which swap dev to unuse) has been made global
some time ago anyway.

Previously use of the return values was inconsistent. Error reporting
will only confuse users and sometimes the situation is hard to fix or
even impossible (like in miniroots copide to swap space for booting).
2021-08-12 09:33:59 +00:00
andvar db383f4739 s/partion/partition/ s/arrray/array/ in comments. 2021-08-08 21:50:10 +00:00
martin 0c74f0eefd When converting partitions from one scheme to another, never fail
without providing (if requested) a proper error message.
2021-07-14 18:56:05 +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 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 f184b4ad4d Remove very strange code that special-cased MSDOS file systems and refused
to newfs the partition (despite explicit request to do so) if it was
mountable.
Accidently carried over from a dim and distant past, before we had
fsck_newfs.
2020-10-12 14:29:41 +00:00
martin 6b2c269297 PR 55379: avoid creating bogus /etc/fstab lines for /dev/cd* if no
cdrom is available.
2020-09-28 18:51:34 +00:00
martin d6ad885809 Typo in comment 2020-09-22 15:16:49 +00:00
martin 98c332e311 PR 55202: disable swapping if we started it due to low ram 2020-05-12 17:26:43 +00:00
martin f16eda658a Use strlcpy in a few places to guarnatee 0-terminated strings 2020-02-19 18:08:03 +00:00
martin 38baaacf51 PR bin/54944: make the "explicit single wedge" selection also work for
upgrades.
2020-02-06 19:08:38 +00:00
martin 7cc1a7bbc8 PR bin/54944: deal with escaped spaces in NAME= syntax in /etc/fstab. 2020-02-06 16:28:10 +00:00
martin 6588e96561 bootxx_name() - fix oversight in previous change (do not assume first
partition is the root partition)
2020-02-06 10:42:06 +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 7fd225f6ad Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.
2020-01-24 07:31:15 +00:00
martin 0e7fb040fb Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.
2020-01-16 16:47:19 +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 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 7ca7eecae1 Make sure all menus have a translatable exit option (or none at all). 2019-11-16 20:26:59 +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 f96c1808ac On device where we do not want a MBR (raid, xbd) skip the MBR partitioning
scheme when trying to read partitions from disk. The generic reader will
fall back to disklabel then.
2019-10-25 12:49:58 +00:00
martin e1c382678c Skip unwanted (zero sized) partitions. 2019-10-21 16:10:54 +00:00
martin df91044bef Remove a hardcoded assumption that for BIOS boot we always will have
the first partition as root - in mixed EFI/BIOS setups this might not
be true (and in general the user is free to define arbitrary orders).
Pointed out by Robert Nestor.
2019-10-21 14:07:42 +00:00
martin d7f55bad98 PR install/54480: when upgrading a system and re-mounting the target /
with proper options, and the installed system does not use NAME= syntax
in fstab(5), use the device name we used to get here, instead of the
name from fstab, it might be different to what the real system calls the
device (compact flash root showing up as wd0 native, but sd? on the
card reader used for updating it right now).

This is an abuse of the upgrade functionality and in general pretty dangerous
when multiple devices are used in the upgraded fstab (e.g. separate /usr),
and it used to work more by accident with the old code.

However, it is a quite usefull way to upgrade tiny systems with compact flash
root, and it used to work - so support it properly (as far as we can).
2019-08-20 06:38:17 +00:00
martin 0dfd6624ca Do not even consider to fsck partitions where we do not know the file
system type. Add v7fs support.
2019-08-08 13:45:19 +00:00
martin 62c0076db0 Do not try to fsck partitions we are never going to mount.
Found by Andreas Gustafsson's baremetal test bed.
2019-08-08 11:41:16 +00:00
martin b8a71b5965 When creating the /etc/fstab for new installs, the sense of the "noauto"
flag was inverted (editor mishap?)
2019-08-07 10:12:32 +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 a8e7688bfa Properly handle partitions that we were requested to mount but not newfs. 2019-08-03 12:09:22 +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 e32f4c09dc When re-discovering a disk where we have free the partitions, read
the current partitions again (they might have changed).
2019-07-25 13:11:15 +00:00
martin 7edc37a722 Whenever offering "current system" as target, also offer the last disk
we found (not one less - oops).
2019-07-24 14:35:02 +00:00
msaitoh d4a37f7caf Fix typo in comment (s/alreay/already/). 2019-07-24 02:38:29 +00:00
msaitoh 532016140e Fix typo in comment (s/partion/partition/). 2019-07-24 02:37:17 +00:00
martin b1fa9754c7 For upgrade / re-install allow the currently running system as a target
in the "disk" selection.
2019-07-23 18:13:40 +00:00
martin c2ed2005cc When searching for a partition that may be the root partition for upgrading,
allow "/", "/targetroot" and "/altroot" as potential last mount points.
2019-07-23 15:23:14 +00:00
martin 87c16c7ab4 Follow our internal install instructions correctly: newfs when a partition
is marked for it, don't second guess from mount point or similar.
2019-07-14 11:25:10 +00:00
martin 4f30cbf326 We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.
2019-07-13 17:13:36 +00:00
christos ce713491ff no need to initialize fields that are already 0. 2019-06-22 20:46:07 +00:00
christos 72ea5dba1a refactor disk ioctl stuff to make it smaller. 2019-06-21 21:54:39 +00:00
christos c9f05d422a devdev is an array, remove NULL check (rin) 2019-06-20 15:49:20 +00:00
christos 24ecf24e51 Use _fmt_ msg_ methods when formats are needed. 2019-06-20 00:43:55 +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 d396d9d899 Disable debug output 2019-06-13 19:13:05 +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
mrg 37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
martin 72cf5c53dc Cosmetics: consistently use MEG and GIG defines for size calculations 2018-11-27 17:13:41 +00:00
martin c4cf3d8d86 Slightly enhance previous: create two utility functions checking for
partitionability and boot code requirements, use a generic match helper
function for both and fully check the device name.
2018-11-14 02:30:00 +00:00