Page MenuHomeFreeBSD

bsdinstall netconfig: Replace dialog with bsddialog
ClosedPublic

Authored by asiciliano on Mar 27 2022, 2:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 8:28 PM
Unknown Object (File)
Mon, Nov 11, 3:57 PM
Unknown Object (File)
Mon, Nov 4, 7:35 PM
Unknown Object (File)
Thu, Oct 24, 5:19 PM
Unknown Object (File)
Oct 18 2024, 7:23 PM
Unknown Object (File)
Oct 5 2024, 4:01 AM
Unknown Object (File)
Oct 2 2024, 12:23 AM
Unknown Object (File)
Oct 1 2024, 5:17 PM
Subscribers

Details

Summary

Replace LGPL dialog(1) with bsddialog(1).

Test Plan

sh ./netconfig

┌─┤Network Configuration├─┐
│ Please select a network │  
│ interface to configure: │  
│                         │  
│ ┌─────────────────────┐ │  
│ │  iwlwifi0 iwlwifi   │ │  
│ └─────────────────────┘ │  
├─────────────────────────┤  
│   [  OK  ]   [Cancel]   │  
└─────────────────────────┘

For the form below:

#!/bin/sh

IPV6_AVAIL=1
IPV4_AVAIL=1
BSDDIALOG_CANCEL=1

RESOLV=""
if [ ${IPV6_AVAIL} -eq 1 -a ${IPV4_AVAIL} -eq 1 ];  then
	RESOLV="
	    'Search' 1 1 \"${SEARCH}\" 1 16 50 50 0
	    'Nameserver' 2 1 \"Nameserver\" 2 1 11 11 2
	    'IPv6 DNS #1' 2 1 \"${IP6_1}\" 2 16 50 50 0
	    'IPv6 DNS #2' 3 1 \"${IP6_2}\" 3 16 50 50 0
	    'IPv4 DNS #1' 4 1 \"${IP4_1}\" 4 16 16 16 0
	    'IPv4 DNS #2' 5 1 \"${IP4_2}\" 5 16 16 16 0"
elif [ ${IPV6_AVAIL} -eq 1 ]; then
	RESOLV="
	    'Search' 1 1 \"${SEARCH}\" 1 16 50 50 0
	    'Nameserver' 2 1 \"Nameserver\" 2 1 11 11 2
	    'IPv6 DNS #1' 2 1 \"${IP6_1}\" 2 16 50 50 0
	    'IPv6 DNS #2' 3 1 \"${IP6_2}\" 3 16 50 50 0"
elif [ ${IPV4_AVAIL} -eq 1 ]; then
	RESOLV="
	    'Search' 1 1 \"${SEARCH}\" 1 16 50 50 0
	    'Nameserver' 2 1 \"Nameserver\" 2 1 11 11 2
	    'IPv4 DNS #1' 2 1 \"${IP4_1}\" 2 16 16 16 0
	    'IPv4 DNS #2' 3 1 \"${IP4_2}\" 3 16 16 16 0"
else
	exit 0
fi

exec 3>&1
echo "${RESOLV}"
RESOLV=$(echo "${RESOLV}" | xargs -o bsddialog --backtitle 'FreeBSD Installer' \
	--title 'Network Configuration' \
	--mixedform 'Resolver Configuration' 0 0 0 \
2>&1 1>&3)
if [ $? -eq $BSDDIALOG_CANCEL ]; then exec $0; fi
exec 3>&-
┌──────────────────────┤Network Configuration├──────────────────────┐
│ Resolver Configuration                                            │  
│┌─────────────────────────────────────────────────────────────────┐│  
││Search                                                           ││  
││IPv6 DNS #1                                                      ││  
││IPv6 DNS #2                                                      ││  
││IPv4 DNS #1                                                      ││  
││IPv4 DNS #2                                                      ││  
││                                                                 ││  
│└─────────────────────────────────────────────────────────────────┘│  
├───────────────────────────────────────────────────────────────────┤  
│                        [  OK  ]   [Cancel]                        │  
└───────────────────────────────────────────────────────────────────┘

IPV6_AVAIL=1
IPV4_AVAIL=0

┌──────────────────────┤Network Configuration├──────────────────────┐
│ Resolver Configuration                                            │  
│┌─────────────────────────────────────────────────────────────────┐│  
││Search                                                           ││  
││IPv6 DNS #1                                                      ││  
││IPv6 DNS #2                                                      ││  
││                                                                 ││  
│└─────────────────────────────────────────────────────────────────┘│  
├───────────────────────────────────────────────────────────────────┤  
│                        [  OK  ]   [Cancel]                        │  
└───────────────────────────────────────────────────────────────────┘

IPV6_AVAIL=0
IPV4_AVAIL=1

┌──────────────────────┤Network Configuration├──────────────────────┐
│ Resolver Configuration                                            │  
│┌─────────────────────────────────────────────────────────────────┐│  
││Search                                                           ││  
││IPv4 DNS #1                                                      ││  
││IPv4 DNS #2                                                      ││  
││                                                                 ││  
│└─────────────────────────────────────────────────────────────────┘│  
├───────────────────────────────────────────────────────────────────┤  
│                        [  OK  ]   [Cancel]                        │  
└───────────────────────────────────────────────────────────────────┘

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped