Commit Graph

36 Commits

Author SHA1 Message Date
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 6a7f7ee8d0 Use a few strlcpy() instead of strncpy() for network ioctl structs.
We seem to have no formal documentation stating the various

	char if*_name[IFNAMSIZ]; /* if name, e.g. "en0" */

elements in ioctls are nul terminated, but the peanut gallery claims
it is so - and at least half of the code in-tree touching them agrees.
2020-01-27 21:30:17 +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 85d19b8858 Avoid a buffer overrun with too many interfaces. 2019-07-23 12:37:23 +00:00
martin 69403a1476 The network settings confirmation message is a manually formated table,
so do not treat it as free flowing text.
2019-07-08 19:46:57 +00:00
martin f6144d97ee Fix some uninitialized memory access and a potential buffer overrun on
machines with multiple network interfaces.
2019-07-07 12:58:45 +00:00
christos ce713491ff no need to initialize fields that are already 0. 2019-06-22 20:46:07 +00:00
christos 24ecf24e51 Use _fmt_ msg_ methods when formats are needed. 2019-06-20 00:43:55 +00:00
martin e65e3888f5 Fix buffer size 2019-06-18 10:45:27 +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 0ef20e9266 Support sets in .tar.xz format 2018-10-06 18:45:37 +00:00
martin 9ce05eeee9 Split the host name used for ftp transfers from the one used for http
transfers. This is slightly inconsistent, as directories are still
shared - but this allows us to default to cdn/nycdn for http (which don't
support ftp).
2018-09-11 08:05:18 +00:00
joerg b77ea2f710 deconst -> __UNCONST, the former involves UB with NULL arithmetic. 2018-05-18 12:23:22 +00:00
roy 87cdadbd3f ping is not a reliable means of testing if connectivity to download sets
actually works, so remove it.
Hopefully fixes PR kern/51531.
2016-12-13 19:03:49 +00:00
roy bdebc53a9a Fix PR kern/51531 by using ifconfig to wait for addresses to become
valid rather than sleeping a fixed ammount of time.
2016-11-22 12:04:35 +00:00
ozaki-r 8f82f57c45 Remove obsolete interfaces: eon (netiso) and nsip (netns)
Pointed out by Kamil Rytarowski
2015-05-21 01:09:00 +00:00
martin 5270515f54 Make "ask_yesno" and "ask_noyes" take a const char * as argument, moving
the deconst() dance into the utility functions and simplifying all callers.
2015-05-11 13:07:57 +00:00
martin a83f4e2ce4 Make it compile on architectures that do not support INET6 in sysinst 2015-05-11 06:58:13 +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
christos e47dca206e Don't use asctime(localtime(time_t *)) because this is really ctime(time_t *)
and not checking the result of localtime can lead to tears.
Add a safectime() that always returns a good string, and add some debugging
so that we can see if there is indeed something wrong in the new libc time
code.
2014-10-14 16:35:20 +00:00
roy 8e47ac0efa Remove the ping6 ff02::2 test, it looks pretty pointless.
dhcpcd will ensure the IPv6 network is up before forking.
ping the IPv4 default route before the nameserver as the nameserver
could be over the default route anyway.

Fixes the core issue with PR install/49231.
2014-09-22 18:47:41 +00:00
martin ceb7a1b9a3 For the benefit of gcc 4.5, rename a local "nl" variable to "nline",
so it doesn't collide with the global curses nl() function.
2014-09-13 17:22:22 +00:00
roy 1c37fe7141 Fix a bogus gcc warning: dhcp_config may be used uninitialized 2014-09-13 09:46:12 +00:00
roy 9cc5846ff7 Show the IP6 address instead of yes 2014-09-13 09:38:43 +00:00
roy 2787059b04 Strip newline from the gateway correctly. 2014-09-13 09:30:30 +00:00
roy eda033034a Change the display order so it's protocol agnostic at the top,
then IPv4 then IPv6.
2014-09-13 01:11:58 +00:00
roy 13c4979619 Only prompt for one nameserver, let the user decide if it's a
pre-determined google server other another one.
2014-09-13 00:38:36 +00:00
roy 63fc81c2f0 rtsol is no longer used. 2014-09-12 21:12:42 +00:00
roy 61e374731e Don't prompt for hostname or domain if obtained from DHCP. 2014-09-12 21:02:06 +00:00
roy 14d86bcffe dhcpcd will already have configured the system at this point, so
don't bother writing it manually.
2014-09-12 20:48:55 +00:00
roy ec4a0efb33 Use the 20-resolv.conf hook from dhcpcd rather than the minimal one.
Extract configured information from resolv.conf and hostname instead
of scraping the last dhcpcd script run.
This will allow the use of DHCPv6 and IPv6RA DNS details in the future.
2014-09-12 20:42:13 +00:00
roy 4fabb2a304 The dhcpcd utilties in pkgsrc require dhcpcd to be running in master mode.
So set dhcpcd to start like so, but restrict it to the configured interface
still instead of ifconfig_foo=dhcp.
2014-09-12 20:20:25 +00:00
martin 14d42b6c1e Make sure the interface name is 0 terminated, pointed out by coverity scan. 2014-08-19 13:01:48 +00:00
martin eee31b641f Remove duplicate fclose(), pointed out by coverity scan. 2014-08-19 06:47:15 +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