mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
gentoo: 修复重启后网卡未被 networkd 接管
This commit is contained in:
parent
8dfdce23e3
commit
f845c19a8f
7
trans.sh
7
trans.sh
@ -1089,6 +1089,13 @@ modify_linux() {
|
||||
# 临时的解决办法是运行 networkctl,如果启用了systemd-networkd服务,会运行服务
|
||||
insert_into_file $os_dir/lib/systemd/system/systemd-logind.service after '\[Service\]' <<EOF
|
||||
ExecStartPost=-networkctl
|
||||
EOF
|
||||
|
||||
# 如果创建了 cloud-init.disabled,重启后网络不受 networkd 管理
|
||||
# 因为网卡名变回了 ens3 而不是 eth0
|
||||
# 因此要删除 networkd 的网卡名匹配
|
||||
insert_into_file $ci_file after '^runcmd:' <<EOF
|
||||
- sed -i '/^Name=/d' /etc/systemd/network/10-cloud-init-eth*.network
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user