V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 54s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -46,7 +46,7 @@ setup_locales() {
|
||||
### Set the keyboard layout for the system (for consoles).
|
||||
[[ -e "${TARGET}/etc/default/keyboard" ]] || touch "${TARGET}/etc/default/keyboard"
|
||||
sed -i "s/^KEYMAP=.*/KEYMAP=${locale_keyboard_layout}/" "${TARGET}/etc/default/keyboard"
|
||||
do_log "info" "file_only" "Keyboard layout updated: 'KEYMAP=${locale_keyboard_layout}' -> '${TARGET}/etc/default/keyboard'."
|
||||
do_log "info" "file_only" "4110() Keyboard layout updated: 'KEYMAP=${locale_keyboard_layout}' -> '${TARGET}/etc/default/keyboard'."
|
||||
|
||||
### Set the X11 keyboard layout (for graphical environments).
|
||||
do_in_target "${TARGET}" localectl set-x11-keymap "${locale_keyboard_xkb_keymap}"
|
||||
|
||||
@@ -55,7 +55,7 @@ setup_network() {
|
||||
|
||||
declare var_auto_nic="" var_auto_ipv4_ccidr="" var_auto_ipv4_subnet="" var_auto_ipv4="" var_auto_ipv4_gw="" \
|
||||
var_auto_ipv6_ccidr="" var_auto_ipv6="" var_auto_ipv6_gw="" var_link_ipv4="" var_link_ipv6="" var_auto_fqdn="" ns=""
|
||||
declare -a ary_ipv4_ns ary_ipv6_ns
|
||||
declare -a ary_ipv4_ns=() ary_ipv6_ns=()
|
||||
|
||||
ary_ipv4_ns+=("${network_static_ipv4nameserver_0}")
|
||||
[[ -v network_static_ipv4nameserver_1 ]] && ary_ipv4_ns+=("${network_static_ipv4nameserver_1}")
|
||||
@@ -99,23 +99,23 @@ setup_network() {
|
||||
var_auto_fqdn=""
|
||||
fi
|
||||
|
||||
do_log "info" "file_only" "Live environment network check: Auto NIC ='${var_auto_nic}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv4 ='${var_auto_ipv4}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv4 CCIDR ='${var_auto_ipv4_ccidr}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv4 Subnet ='${var_auto_ipv4_subnet}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv4 Gateway ='${var_auto_ipv4_gw}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv6 ='${var_auto_ipv6}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv6 CCIDR ='${var_auto_ipv6_ccidr}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv6 Gateway ='${var_auto_ipv6_gw}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv4 Link ='${var_link_ipv4}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto IPv6 Link ='${var_link_ipv6}'."
|
||||
do_log "info" "file_only" "Live environment network check: Auto FQDN ='${var_auto_fqdn}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto NIC ='${var_auto_nic}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv4 ='${var_auto_ipv4}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv4 CCIDR ='${var_auto_ipv4_ccidr}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv4 Subnet ='${var_auto_ipv4_subnet}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv4 Gateway ='${var_auto_ipv4_gw}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv6 ='${var_auto_ipv6}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv6 CCIDR ='${var_auto_ipv6_ccidr}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv6 Gateway ='${var_auto_ipv6_gw}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv4 Link ='${var_link_ipv4}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto IPv6 Link ='${var_link_ipv6}'."
|
||||
do_log "info" "file_only" "4130() Live environment network check: Auto FQDN ='${var_auto_fqdn}'."
|
||||
|
||||
### Create network configuration file header.
|
||||
if [[ -f "${TARGET}/etc/network/interfaces" ]]; then
|
||||
mkdir -p "${DIR_BAK}/etc/network"
|
||||
mv "${TARGET}/etc/network/interfaces" "${DIR_BAK}/etc/network/interfaces.bak"
|
||||
do_log "info" "file_only" "Existing '${TARGET}/etc/network/interfaces' moved."
|
||||
do_log "info" "file_only" "4130() Existing '${TARGET}/etc/network/interfaces' moved."
|
||||
fi
|
||||
|
||||
cat << EOF >| "${TARGET}/etc/network/interfaces"
|
||||
@@ -142,7 +142,7 @@ iface lo inet loopback
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
chmod 0644 "${TARGET}/etc/network/interfaces"
|
||||
do_log "info" "file_only" "Header '${TARGET}/etc/network/interfaces' created."
|
||||
do_log "info" "file_only" "4130() Header '${TARGET}/etc/network/interfaces' created."
|
||||
|
||||
### Configure network interfaces based on 'preseed.yaml' and create network configuration files for IPv4.
|
||||
if [[ "${network_autoconfig_enable,,}" == "true" && "${network_choose_interface_auto,,}" == "true" ]]; then
|
||||
@@ -174,7 +174,7 @@ iface ${var_auto_nic} inet dhcp
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
chmod 0644 "${TARGET}/etc/network/interfaces/interfaces.d/10-ipv4-dhcp"
|
||||
do_log "info" "file_only" "IPv4 on the primary NIC: '${var_auto_nic}' configured with DHCP."
|
||||
do_log "info" "file_only" "4130() IPv4 on the primary NIC: '${var_auto_nic}' configured with DHCP."
|
||||
|
||||
elif [[ "${network_autoconfig_enable,,}" == "true" && "${network_choose_interface_auto,,}" == "false" ]]; then
|
||||
|
||||
@@ -197,7 +197,7 @@ iface ${network_choose_interface_static} inet dhcp
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
chmod 0644 "${TARGET}/etc/network/interfaces/interfaces.d/10-ipv4-dhcp"
|
||||
do_log "info" "file_only" "IPv4 on the primary NIC: '${network_choose_interface_static}' configured with DHCP."
|
||||
do_log "info" "file_only" "4130() IPv4 on the primary NIC: '${network_choose_interface_static}' configured with DHCP."
|
||||
|
||||
fi
|
||||
|
||||
@@ -226,7 +226,7 @@ iface ${network_choose_interface_static} inet static
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
chmod 0644 "${TARGET}/etc/network/interfaces/interfaces.d/10-ipv4-static"
|
||||
do_log "info" "file_only" "IPv4 on the primary NIC: '${network_choose_interface_static}' configured statically."
|
||||
do_log "info" "file_only" "4130() IPv4 on the primary NIC: '${network_choose_interface_static}' configured statically."
|
||||
|
||||
fi
|
||||
|
||||
@@ -252,7 +252,7 @@ iface ${var_auto_nic} inet6 dhcp
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
chmod 0644 "${TARGET}/etc/network/interfaces/interfaces.d/10-ipv6-dhcp"
|
||||
do_log "info" "file_only" "IPv6 on the primary NIC: '${var_auto_nic}' configured with DHCP."
|
||||
do_log "info" "file_only" "4130() IPv6 on the primary NIC: '${var_auto_nic}' configured with DHCP."
|
||||
|
||||
fi
|
||||
|
||||
@@ -280,14 +280,14 @@ iface ${network_choose_interface_static} inet6 static
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
EOF
|
||||
chmod 0644 "${TARGET}/etc/network/interfaces/interfaces.d/10-ipv6-static"
|
||||
do_log "info" "file_only" "IPv6 on the primary NIC: '${network_choose_interface_static}' configured statically."
|
||||
do_log "info" "file_only" "4130() IPv6 on the primary NIC: '${network_choose_interface_static}' configured statically."
|
||||
|
||||
fi
|
||||
|
||||
if [[ -f "${TARGET}/etc/resolv.conf" ]]; then
|
||||
mkdir -p "${DIR_BAK}/etc"
|
||||
mv "${TARGET}/etc/resolv.conf" "${DIR_BAK}/etc/resolv.conf.bak"
|
||||
do_log "info" "file_only" "Existing '${TARGET}/etc/resolv.conf' moved."
|
||||
do_log "info" "file_only" "4130() Existing '${TARGET}/etc/resolv.conf' moved."
|
||||
fi
|
||||
|
||||
touch "${TARGET}/etc/resolv.conf"
|
||||
@@ -315,7 +315,7 @@ EOF
|
||||
done
|
||||
|
||||
echo "" >> "${TARGET}/etc/resolv.conf"
|
||||
do_log "info" "file_only" "IPv4 nameserver at: '${TARGET}/etc/resolv.conf' configured manually."
|
||||
do_log "info" "file_only" "4130() IPv4 nameserver at: '${TARGET}/etc/resolv.conf' configured manually."
|
||||
|
||||
fi
|
||||
|
||||
@@ -331,7 +331,7 @@ EOF
|
||||
done
|
||||
|
||||
echo "" >> "${TARGET}/etc/resolv.conf"
|
||||
do_log "info" "file_only" "IPv6 nameserver at: '${TARGET}/etc/resolv.conf' configured manually."
|
||||
do_log "info" "file_only" "4130() IPv6 nameserver at: '${TARGET}/etc/resolv.conf' configured manually."
|
||||
|
||||
fi
|
||||
|
||||
@@ -343,7 +343,7 @@ EOF
|
||||
if [[ -f "${TARGET}/etc/dhcp/dhclient.conf" ]]; then
|
||||
mkdir -p "${DIR_BAK}/etc/dhcp"
|
||||
cp "${TARGET}/etc/dhcp/dhclient.conf" "${DIR_BAK}/etc/dhcp/dhclient.conf.bak"
|
||||
do_log "info" "file_only" "Existing '${TARGET}/etc/dhcp/dhclient.conf' saved."
|
||||
do_log "info" "file_only" "4130() Existing '${TARGET}/etc/dhcp/dhclient.conf' saved."
|
||||
fi
|
||||
|
||||
if [[ "${network_autoconfig_enable,,}" == "true" && -n "${network_static_ipv4nameserver_0}" ]]; then
|
||||
@@ -356,7 +356,7 @@ EOF
|
||||
var_supersede="${var_supersede%, }"
|
||||
echo "supersede domain-name-servers ${var_supersede};" >> "${TARGET}/etc/dhcp/dhclient.conf"
|
||||
|
||||
do_log "info" "file_only" "DHCP client configuration for IPv4: '${TARGET}/etc/dhcp/dhclient.conf' configured."
|
||||
do_log "info" "file_only" "4130() DHCP client configuration for IPv4: '${TARGET}/etc/dhcp/dhclient.conf' configured."
|
||||
|
||||
fi
|
||||
|
||||
@@ -366,7 +366,7 @@ EOF
|
||||
var_supersede_ipv6="${var_supersede_ipv6%, }"
|
||||
echo "supersede domain-name-servers ${var_supersede_ipv6};" >> "${TARGET}/etc/dhcp/dhclient.conf"
|
||||
|
||||
do_log "info" "file_only" "DHCP client configuration for IPv6: '${TARGET}/etc/dhcp/dhclient.conf' configured."
|
||||
do_log "info" "file_only" "4130() DHCP client configuration for IPv6: '${TARGET}/etc/dhcp/dhclient.conf' configured."
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user