From 78937098a6526384a545a7c1b7468fb781e8e5d1 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Mon, 13 Nov 2023 18:42:36 +0800 Subject: [PATCH] =?UTF-8?q?fedora:=20=E4=BF=AE=E5=A4=8D=20f37/f38=20?= =?UTF-8?q?=E4=BA=91=E9=95=9C=E5=83=8F=E7=94=A8=E9=9D=99=E6=80=81=20ipv6?= =?UTF-8?q?=20=E4=BC=9A=E6=8E=89=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/trans.sh b/trans.sh index 41006da..410ee77 100644 --- a/trans.sh +++ b/trans.sh @@ -915,11 +915,14 @@ download_cloud_init_config() { # 如果分区表中已经有swapfile就跳过,例如arch if ! grep -w swap $os_dir/etc/fstab; then # btrfs + # 目前只有 arch 和 fedora 镜像使用 btrfs + # 等 fedora 38 cloud-init 升级到 v23.3 后删除 if mount | grep 'on /os type btrfs'; then insert_into_file $ci_file after '^runcmd:' <> /etc/fstab + - systemctl daemon-reload EOF else # ext4 xfs @@ -1051,6 +1054,16 @@ modify_linux() { disable_selinux_kdump $os_dir fi + # 修复 fedora 38 或以下用静态 ipv6 会掉线 + # el 全系也用 NetworkManager,但他们的配置文件是 sysconfig,因此不受影响 + # https://github.com/canonical/cloud-init/commit/5d440856cb6d2b4c908015fe4eb7227615c17c8b + if grep -E 'fedora:(37|38)' $os_dir/etc/os-release; then + network_manager_py=$os_dir/usr/lib/python3.11/site-packages/cloudinit/net/network_manager.py && + if ! grep '"static6": "manual",' $network_manager_py; then + echo '"static6": "manual",' | insert_into_file $network_manager_py after '"static": "manual",' + fi + fi + # debian 10/11 默认不支持 rdnss,要安装 rdnssd 或者 nm if [ -f $os_dir/etc/debian_version ] && grep -E '^(10|11)' $os_dir/etc/debian_version; then mv $os_dir/etc/resolv.conf $os_dir/etc/resolv.conf.orig