mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 提前适配 alpine 3.19.1
This commit is contained in:
parent
9425de5078
commit
edf6bd2652
@ -8,8 +8,14 @@ ipv6_addr=$4
|
||||
ipv6_gateway=$5
|
||||
is_in_china=$6
|
||||
|
||||
# 3.16-3.18 $device
|
||||
# 3.19.1+ $iface
|
||||
# shellcheck disable=SC2154
|
||||
ethx="$device"
|
||||
if [ -n "$iface" ]; then
|
||||
ethx="$iface"
|
||||
else
|
||||
ethx="$device"
|
||||
fi
|
||||
|
||||
if $is_in_china; then
|
||||
ipv4_dns1='119.29.29.29'
|
||||
|
15
reinstall.sh
15
reinstall.sh
@ -1267,20 +1267,29 @@ mod_alpine_initrd() {
|
||||
EOF
|
||||
|
||||
# hack 2 设置 ethx
|
||||
# 3.16~3.18 ip_choose_if
|
||||
# 3.19.1+ ethernets
|
||||
if grep -q ip_choose_if init; then
|
||||
ethernets_func=ip_choose_if
|
||||
else
|
||||
ethernets_func=ethernets
|
||||
fi
|
||||
|
||||
ip_choose_if() {
|
||||
ip -o link | grep "@mac_addr" | awk '{print $2}' | cut -d: -f1
|
||||
return
|
||||
}
|
||||
|
||||
collect_netconf
|
||||
get_function_content ip_choose_if | sed "s/@mac_addr/$mac_addr/" | insert_into_file init after 'ip_choose_if\(\)'
|
||||
get_function_content ip_choose_if | sed "s/@mac_addr/$mac_addr/" |
|
||||
insert_into_file init after "$ethernets_func\(\)"
|
||||
|
||||
# hack 3
|
||||
# udhcpc 添加 -n 参数,请求dhcp失败后退出
|
||||
# 使用同样参数运行 udhcpc6
|
||||
# TODO: digitalocean -i eth1?
|
||||
# $MOCK udhcpc -i "$device" -f -q # v3.18
|
||||
# udhcpc -i "$device" -f -q # v3.17
|
||||
# $MOCK udhcpc -i "$device" -f -q # v3.18
|
||||
# $MOCK udhcpc -i "$iface" -f -q # v3.19.1
|
||||
search='udhcpc -i'
|
||||
orig_cmd="$(grep "$search" init)"
|
||||
mod_cmd4="$orig_cmd -n || true"
|
||||
|
Loading…
x
Reference in New Issue
Block a user