From eb071a1b97ed524187a202a6bc442c6b0b027982 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Fri, 19 Jun 2026 10:53:30 +0800 Subject: [PATCH] =?UTF-8?q?alpine:=20=E4=B8=BA=20azure=20nvme=20=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E7=9A=84=20initramfs=20=E6=B7=BB=E5=8A=A0=20pci=5Fhyp?= =?UTF-8?q?erv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/trans.sh b/trans.sh index d7712b7..addf7f3 100644 --- a/trans.sh +++ b/trans.sh @@ -1633,6 +1633,17 @@ install_alpine() { mount_pseudo_fs /os + # azure nvme 实例的 initramfs 需要添加 pci_hyperv 驱动 + if [ -d /sys/module/pci_hyperv ] && + get_drivers "/sys/block/$xda" | grep -qx pci_hyperv; then + echo 'kernel/drivers/pci/controller/pci-hyperv.ko*' >/os/etc/mkinitfs/features.d/pci-hyperv.modules + if ! grep -q 'pci-hyperv' /os/etc/mkinitfs/mkinitfs.conf; then + # 找到 features=" 开头的行,将最后的"改成 pci-hyperv" + sed -i '/features="/s/"$/ pci-hyperv"/' /os/etc/mkinitfs/mkinitfs.conf + fi + chroot /os mkinitfs -k "$(basename /os/lib/modules/*-*)" + fi + # 安装到硬盘后才安装各种应用 # 避免占用 Live OS 内存