aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bsdinstall/scripts/netconfig_ipv4
Commit message (Collapse)AuthorAgeFilesLines
* bsdinstall: Add new Auto option to netconfig interface selection dialogJessica Clarke2024-02-091-2/+24
| | | | | | | | | | | | | | | | | | This changes the OK / Cancel buttons into Auto / Manual / Cancel, with Auto being the default. Manual behaves like OK used to, i.e. presents a series of dialogs asking exactly how to configure the interface, and Cancel is unchanged, exiting with exit code 1. Auto will attempt to configure IPv4+DHCP and IPv6+SLAAC with no interaction, failing only if neither can be configured, thereby supporting all of IPv4-only, IPv6-only and dual-stack environments. If at least one DNS server is provided, it will also skip asking for DNS settings, otherwise it will act like Manual mode for the purposes of DNS settings and prompt. For a standard dual-stack environment this cuts down the number of netconfig dialogs from 6 (interface, IPv4, DHCP, IPv6, SLAAC, DNS) to just the first one. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D43731
* bsdinstall: Fix broken netconfig persistence for installed systemJessica Clarke2024-02-031-1/+1
| | | | | | | | | | The replacement of echo >> with sysrc -f used sysrc key value, which means "read variables key and value" and thus did nothing useful (and in fact emitted errors to the log about neither existing). Instead use the correct sysrc key=value form so the installed system comes back up with working networking. Fixes: 60b37735f305 ("bsdinstall netconfig: avoid duplicate entries in rc.conf")
* bsdinstall netconfig: avoid duplicate entries in rc.confPierre Pronchery2023-10-131-1/+1
| | | | | | | | | | | | This uses sysrc to write and update configuration variables in the temporary configuration file for network access, ._rc.conf.net. This replaces the previous mechanism, which was simply appending new values as they were updated. PR: 212396 Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42194
* bsdinstall: avoid conflicts with fd 3Lars Kellogg-Stedman2023-09-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Throughout the bsdinstall script fd 3 is used by f_dprintf (set through $TERMINAL_STDOUT_PASSTHRU). In several places in the bsdinstalls scripts, we use fd 3 to juggle stdout when calling out to other tools, which can cause the installer to fail with a "Bad file descriptor" error when f_dprintf attempts to use it. This commit replaces all constructs like this: exec 3>&1 SOME_VARIABLE=$(some command 2>&1 1>&3) exec 3>&- With: exec 5>&1 SOME_VARIABLE=$(some command 2>&1 1>&5) exec 5>&- PR: 273148 Reviewed by: corvink Fixes: 1f7746d81f53447ac15cc99395bb714d4dd0a4da ("bsdinstall: stop messing with file descriptors") MFC after: 1 week
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* bsdinstall: allow whitelabeling the scriptsBrad Davis2022-05-241-5/+5
| | | | | | Approved by: allanjude, asiciliano Differential Revision: https://reviews.freebsd.org/D35197 Sponsored by: Rubicon Communications, LLC ("Netgate")
* bsdinstall netconfig_ipv4: Replace dialog with bsddialogAlfonso S. Siciliano2022-05-211-10/+13
| | | | | | | Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D35267
* bsdinstall netconfig_ipv4: Fix resolv.conf rebuildAlfonso S. Siciliano2022-04-301-0/+3
| | | | | | | | | | | After an installation restart (for error or choice) dhclient does not rebuild resolv.conf so `dialog --mixedform' of "Resolver Configuration" in bsdinstall/scripts/netconfig draws empty forms. It causes a bad UX, to see PR262262. Fixed resetting the interface before to run dhclient. PR: 262262 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D35094
* bsdinstall: only kill the dhclient for the interface we are restartingAllan Jude2020-07-111-1/+1
| | | | | | | | | | | PR: 205821 Reported by: mjg MFC after: 2 weeks Sponsored by: Klara Inc. Event: July 2020 Bugathon Notes: svn path=/head/; revision=363103
* bsdinstall: kill dhclient before starting a new instanceAllan Jude2020-07-111-1/+1
| | | | | | | | | | | | PR: 205821 Submitted by: William Orr <will@worrbase.com> MFC after: 2 weeks Sponsored by: Klara Inc. Event: July 2020 Bugathon Differential Revision: https://reviews.freebsd.org/D14572 Notes: svn path=/head/; revision=363097
* bsdinstall: up the interface before calling dhclientEmmanuel Vadot2019-04-251-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=346683
* bsdinstall: record DHCP config after obtaining leaseEd Maste2017-08-101-2/+1
| | | | | | | | | | | | | | Previously we added an ifconfig_$INTERFACE line to rc.conf for each unsuccessful DCHP attempt. PR: 219515 Reviewed by: allanjude MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11967 Notes: svn path=/head/; revision=322374
* bsdinstall: remove EOL whitespaceEd Maste2017-07-181-1/+1
| | | | Notes: svn path=/head/; revision=321178
* bsdinstall: unbreak static address assignment for wired networks.Andriy Voskoboinyk2016-05-261-1/+5
| | | | | | | | | | This fixes regression introduced in r298946 (fixes static address assignment for wireless networks). Reported & submitted by: allanjude Notes: svn path=/head/; revision=300735
* bsdinstall: fix static address assignment for protected wireless networks.Andriy Voskoboinyk2016-05-021-1/+1
| | | | | | | | | | Filter out IFCONFIG_PREFIX variable (which may contain WPA keyword) from ifconfig parameters. PR: 169199 Notes: svn path=/head/; revision=298946
* Produce meaningful exit codeDevin Teske2015-09-111-3/+7
| | | | | | | | MFC after: 3 days X-MFC-to: stable/10 Notes: svn path=/head/; revision=287690
* A series of changes tested together as a whole:Devin Teske2013-11-081-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + Add a `-D FILE" command-line option for overriding the path to the bsdinstall log file (BSDINSTALL_LOG env var). + Document new `-D FILE' in the man page for bsdinstall. + If FILE in `-D FILE' begins with a +, debug output goes to stdout (interleaved between dialog(1) invocations/output) as well as to FILE (minus the leading + of course). + If BSDINSTALL_LOG cannot be written, then debugging is disabled (except in the case of a leading + in the pathname, wherein debug will still be printed to stdout). + Update source code formatting style. + Fix a dangling participle ("Begun ..." -> "Began ...") + Rewrite the docsinstall script (was necessary to abate direct dependency on BSDINSTALL_LOG (instead, use fault-tolerant bsdconfig framework which displays appropriate errors for package management). NB: docsinstall is still using pkg(8) after this change. + Add additional debug output for dhclient/rtsol/wpa_cliscan + Display script errors in a textbox rather than just on stdout + Update many coments. + Add new f_show_err() API call (like f_show_msg but changes the dialog title to "Error")(see bsdconfig's `common.subr'). + Add new f_eval_catch() API call for executing a command via eval but not before logging the command to debug. Several example cases documented in API header for function in bsdconfig's `common.subr'. + Fix dialog auto-sizing when launched as an rvalue to a pipe for indirected scripts (previously would default to 24x80 sizing in this case, now it can autosize to full size even when in a pipe chain). + Fix bug in f_snprintf if $format argument began with "-"; printf would misinterpret as a flag. (this is in bsdcofig's `strings.subr'). + Add accompanying f_sprintf() and f_vsprintf() to go along with already existing f_snprintf() and f_vsnprintf() (see bsdconfig's `strings.subr'). + Remove some unnecessary default ZFS datasets from the automatic "zfsboot" script. Such as: /usr/ports/distfiles /usr/ports/packages /usr/obj /var/db /var/empty /var/mail and /var/run (these can all be created as-needed once the system is installed). + Remove setuid=off for /usr/home (as discussed from last round of CFT). + Fix some i18n string violations in "zfsboot". + Bolster debugging output in "zfsboot". + Fix some string quoting issues in "zfsboot". + Fix some variable scope issues in "zfsboot". + Change "Create" to "Install" in "zfsboot" main menu. + Increase error checking in "zfsboot" (type-check arguments and such). + Add call to "graid destroy" killing automatic metadata (part of the series of pedantic destructions we do when bootstrapping a new/naked disk). + Make judicious use of new f_eval_catch() in "zfsboot". + Fixup some variable names for consistency (zfsboot). + Fix an underride syntax parameter expansion folly (zfsboot). + Confirm layout if not explicitly chosen when blindly proceeding (no longer have to touch anything on the ZFS menu if it scares you, just choose the omnibus "Install" option at the top and you'll be prompted to select vdev type and disks in the layout confirmation dialog). + Change numbered menu items to alphabetic for more efficient navigation. + Consolidate vdev selection and disk selection into a single stateful menu which performs validation and allows backing out to each previous menu as you go deeper. + Redesign the ``Last Chance'' dialog (still using the same colors, but make it conform to a tolerable width and make disks appear in a block- quote style indented region). + Fix a bug wherein we used the a lowercase variable name by accident (actual variable name declared as all-uppercase) at the time of initializing fstab(5) (not believed to cause any issues though). + Update the geli setup infobox for each provider being initialized (not just at the onset -- since each ``geli init'' causes kernel messages to push our infobox off-screen). Reviewed by: Allan Jude <freebsd@allanjude.com> Discussed on: -current MFC after: 3 days Notes: svn path=/head/; revision=257842
* Fix a whitespace nitKevin Lo2012-01-311-1/+1
| | | | | | | Reviewed by: bz Notes: svn path=/head/; revision=230804
* Fix WPA setup broken by changes to shell argument passing inside theNathan Whitehorn2011-09-161-0/+1
| | | | | | | | | | installer network configuration. PR: bin/159558 Approved by: re (kib) Notes: svn path=/head/; revision=225612
* Fix two problems:Bjoern A. Zeeb2011-09-071-2/+4
| | | | | | | | | | | | | | | 1) if no default gateway is given the route command will fail and the script will abort with an error leading to an endless loop unless configuration is cancelled or changed. [1] 2) In the IPv6 case add -inet6 to not alter the legacy IP default route. Reported by: Oleg Ginzburg (olevole olevole.ru) [1] Tested by: Oleg Ginzburg (olevole olevole.ru) [1] Approved by: re (kib) Notes: svn path=/head/; revision=225429
* To inet or not two inet. Unbreak static IPv4 configuration. If you triedBjoern A. Zeeb2011-07-281-1/+1
| | | | | | | | | | | you were stuck in an endless loop. Reported by: kensmith Approved by: re (kib) for BETA1 Pointy hat to: bz - wonder why I had not tested legacy IP thoroughly.. Notes: svn path=/head/; revision=224470
* Write the multi step netconfig to a temporary file and only move thatBjoern A. Zeeb2011-06-021-3/+3
| | | | | | | | | | | | | to the final name if netconfig was completely finished. This fixes reentrance problems even better than r222611. Suggested by: nwhitehorn Reviewed by: nwhitehorn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Notes: svn path=/head/; revision=222619
* Split netconfig into three parts:Bjoern A. Zeeb2011-05-291-0/+85
- netconfig - what auto will call which in turn will check for IPv4 and IPv6 to be available and ask the user to configure it by calling - netconfig_ipv4 doing DHCP and static IPv4 addresses, and - netconfig_ipv6 doing rtsol and static IPv6 addresses, and then checking, querying and updating resolv.conf upon return. Both DHCP and rtsol (in the future) might update resolv.conf already so we seed ourselves from that file if available. Reviewed by: nwhitehorn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Notes: svn path=/head/; revision=222468