V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 52s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 52s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -43,14 +43,16 @@ installation_network() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare var_supersede="" var_supersede_ipv6=""
|
||||
|
||||
do_in_target "${TARGET}" apt-get install -y isc-dhcp-client ifupdown
|
||||
do_in_target "${TARGET}" apt-get install -y dhcpcd-base
|
||||
mkdir -p "${TARGET}/etc/network/interfaces.d"
|
||||
|
||||
### Create a network configuration file header.
|
||||
if [[ -f "${TARGET}/etc/network/interfaces" ]]; then
|
||||
|
||||
mkdir -p "${TARGET}/root/.ciss/cdi/backup/etc/network"
|
||||
mv "${TARGET}/etc/network/interfaces" "${TARGET}/root/.ciss/cdi/backup/etc/network/interfaces.bak"
|
||||
do_log "info" "file_only" "4300() Existing '${TARGET}/etc/network/interfaces' moved."
|
||||
|
||||
fi
|
||||
|
||||
cat << EOF >| "${TARGET}/etc/network/interfaces"
|
||||
@@ -251,42 +253,60 @@ EOF
|
||||
|
||||
fi
|
||||
|
||||
### Ensure Internet Systems Consortium DHCP Client is not overwriting the static nameserver settings.
|
||||
if [[ -f "${TARGET}/etc/dhcp/dhclient.conf" ]]; then
|
||||
mkdir -p "${TARGET}/root/.ciss/cdi/backup/etc/dhcp"
|
||||
cp "${TARGET}/etc/dhcp/dhclient.conf" "${TARGET}/root/.ciss/cdi/backup/etc/dhcp/dhclient.conf.bak"
|
||||
do_log "info" "file_only" "4300() Existing '${TARGET}/etc/dhcp/dhclient.conf' copied."
|
||||
fi
|
||||
|
||||
### Ensure 'dhcpcd-base' DHCP Client is not overwriting the static nameserver settings.
|
||||
if [[ "${network_autoconfig_enable}" == "true" && -n "${network_static_ipv4nameserver_0}" ]]; then
|
||||
|
||||
cat << EOF >> "${TARGET}/etc/dhcp/dhclient.conf"
|
||||
if [[ -f "${TARGET}/etc/dhcpcd.conf" ]]; then
|
||||
|
||||
# Custom dhclient config to override DHCP DNS
|
||||
EOF
|
||||
var_supersede=$(printf "%s, " "${ARY_IPV4_NS[@]}")
|
||||
var_supersede="${var_supersede%, }"
|
||||
echo "supersede domain-name-servers ${var_supersede};" >> "${TARGET}/etc/dhcp/dhclient.conf"
|
||||
|
||||
do_log "info" "file_only" "4300() DHCP client configuration for IPv4: '${TARGET}/etc/dhcp/dhclient.conf' configured."
|
||||
mkdir -p "${TARGET}/root/.ciss/cdi/backup/etc"
|
||||
mv "${TARGET}/etc/dhcpcd.conf" "${TARGET}/root/.ciss/cdi/backup/etc/dhcpcd.conf.bak"
|
||||
do_log "info" "file_only" "4300() Existing '${TARGET}/etc/dhcpcd.con' copied."
|
||||
|
||||
fi
|
||||
|
||||
insert_header "${TARGET}/etc/dhcpcd.conf"
|
||||
insert_comments "${TARGET}/etc/dhcpcd.conf"
|
||||
cat << EOF >> "${TARGET}/etc/dhcpcd.conf"
|
||||
### Global defaults for all interfaces.
|
||||
option host_name
|
||||
option domain_name
|
||||
option domain_search
|
||||
|
||||
### Ask server to update both A and PTR via FQDN (RFC 4702 semantics).
|
||||
fqdn both
|
||||
|
||||
### Enforce static DNS and prevent dhcpcd from writing 'resolv.conf'.
|
||||
nooption domain_name_servers
|
||||
nohook resolv.conf rdnssd
|
||||
|
||||
### Static resolvers (IPv4).
|
||||
### (This does NOT write '/etc/resolv.conf' because of nohook above.)
|
||||
EOF
|
||||
|
||||
var_supersede=$(printf "%s " "${ARY_IPV4_NS[@]}")
|
||||
echo "static domain_name_servers=${var_supersede}" >> "${TARGET}/etc/dhcpcd.conf"
|
||||
|
||||
do_log "info" "file_only" "4300() DHCP client configuration for IPv4: '${TARGET}/etc/dhcpcd.conf' configured."
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [[ "${network_autoconfig_enable}" == "false" && -n "${network_static_ipv6nameserver_0}" ]]; then
|
||||
|
||||
var_supersede_ipv6=$(printf "%s, " "${ARY_IPV6_NS[@]}")
|
||||
var_supersede_ipv6="${var_supersede_ipv6%, }"
|
||||
echo "supersede domain-name-servers ${var_supersede_ipv6};" >> "${TARGET}/etc/dhcp/dhclient.conf"
|
||||
var_supersede_ipv6=$(printf "%s " "${ARY_IPV6_NS[@]}")
|
||||
echo "static domain_name_servers=${var_supersede_ipv6}" >> "${TARGET}/etc/dhcpcd.conf"
|
||||
|
||||
do_log "info" "file_only" "4300() DHCP client configuration for IPv6: '${TARGET}/etc/dhcp/dhclient.conf' configured."
|
||||
do_log "info" "file_only" "4300() DHCP client configuration for IPv6: '${TARGET}/etc/dhcpcd.conf' configured."
|
||||
|
||||
fi
|
||||
|
||||
if [[ "${network_autoconfig_enable}" == "true" && -n "${network_static_ipv4nameserver_0}" ]]; then
|
||||
|
||||
cat << EOF >> "${TARGET}/etc/dhcp/dhclient.conf"
|
||||
cat << EOF >> "${TARGET}/etc/dhcpcd.conf"
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
@@ -36,8 +36,6 @@ dropbear_build() {
|
||||
|
||||
chroot_logger "${TARGET}${var_logfile}"
|
||||
|
||||
apt-get install -y autoconf automake build-essential libtool libtomcrypt-dev libtommath-dev musl-tools
|
||||
|
||||
mkdir -p "${DIR_TMP}/build"
|
||||
cp "${var_tar}" "${DIR_TMP}/build"
|
||||
tar xjf "${DIR_TMP}/build/dropbear-${var_dropbear_version}.tar.bz2" -C "${DIR_TMP}/build" || return "${ERR_PATH_NOT_VALID}"
|
||||
|
||||
@@ -61,8 +61,8 @@ echo "Successfully executed: [copy_exec /usr/bin/sha512sum /usr/bin]."
|
||||
copy_exec /usr/bin/sha384sum /usr/bin
|
||||
echo "Successfully executed: [copy_exec /usr/bin/sha384sum /usr/bin]."
|
||||
|
||||
### Include Signature-Verifier
|
||||
copy_exec /usr/bin/gpgv /usr/bin
|
||||
### Include GPG
|
||||
copy_exec /usr/bin/gpg /usr/bin
|
||||
echo "Successfully executed: [copy_exec /usr/bin/gpgv /usr/bin]."
|
||||
|
||||
### Include Whois
|
||||
|
||||
Reference in New Issue
Block a user