From e7b08f59224abd9e340b7572e6edb013699964f8 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 19 Oct 2024 17:27:18 +0800 Subject: [PATCH] =?UTF-8?q?opensuse:=20=E5=AE=89=E8=A3=85=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E5=86=85=E6=A0=B8=E4=BB=A5=E6=B7=BB=E5=8A=A0=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E7=9A=84=20nvme=20=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/trans.sh b/trans.sh index 3b608e3..059de5a 100644 --- a/trans.sh +++ b/trans.sh @@ -2523,11 +2523,40 @@ EOF fi # opensuse tumbleweed - # TODO: cloud-init 更新后删除 + # 更新到 cloud-init 24.1 后删除 if grep opensuse-tumbleweed $os_dir/etc/os-release; then touch $os_dir/etc/NetworkManager/NetworkManager.conf fi + # opensuse + # kernel-default-base 缺少 nvme 驱动 + # https://documentation.suse.com/smart/virtualization-cloud/html/minimal-vm/index.html + if grep -q opensuse $os_dir/etc/os-release; then + create_swap_if_ram_less_than 1024 $os_dir/swapfile + mount_pseudo_fs $os_dir + cp_resolv_conf $os_dir + + # 不能同时装 + chroot $os_dir zypper remove -y kernel-default-base + # 只有 leap 有 kernel-azure + if grep -q opensuse-leap $os_dir/etc/os-release && [ "$(get_cloud_vendor)" = azure ]; then + kernel='kernel-azure' + else + kernel='kernel-default' + fi + # 必须设置一个密码,否则报错 + # Failed to get root password hash + # Failed to import /etc/uefi/certs/76B6A6A0.crt + # warning: %post(kernel-default-5.14.21-150500.55.83.1.x86_64) scriptlet failed, exit status 255 + echo "root:$(mkpasswd '')" | chroot $os_dir chpasswd -e + chroot $os_dir zypper install -y $kernel + chroot $os_dir passwd -d root + + restore_resolv_conf $os_dir + swapoff $os_dir/swapfile + rm -f $os_dir/swapfile + fi + # arch if [ -f $os_dir/etc/arch-release ]; then # 修复 onlink 网关