From 1f648fceb316d0b5168a2d7887545e03e96a73f8 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sun, 6 Aug 2023 22:16:27 +0800 Subject: [PATCH] =?UTF-8?q?redhat:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E4=BA=91?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E5=AE=89=E8=A3=85=20fedara=20=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=90=AF=E5=8A=A8=E9=A1=B9=E6=B2=A1=E7=A6=81=E7=94=A8?= =?UTF-8?q?=20selinux=20=E5=92=8C=20crashkernel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/trans.sh b/trans.sh index 3affd33..660c360 100644 --- a/trans.sh +++ b/trans.sh @@ -449,6 +449,15 @@ EOF } modify_dd_os() { + find_and_mount() { + mount_point=$1 + + mount_dev=$(awk "\$2==\"$mount_point\" {print \$1}" $os_dir/etc/fstab) + if [ -n "$mount_dev" ]; then + mount $mount_dev $os_dir$mount_point + fi + } + apk add lsblk mkdir -p /os # 按分区容量大到小,依次寻找系统分区 @@ -470,10 +479,10 @@ modify_dd_os() { download_cloud_init_config $os_dir if [ -f $os_dir/etc/redhat-release ]; then + find_and_mount /boot + find_and_mount /boot/efi disable_selinux_kdump $os_dir fi - - umount /os } install_cloud_image_by_dd() {