From 5edf3423eec9b6cd945b49b39d15f47e59167996 Mon Sep 17 00:00:00 2001 From: spiritLHLS <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:55:13 +0800 Subject: [PATCH] Update rebuild_qcow2.sh --- back/rebuild_qcow2.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/back/rebuild_qcow2.sh b/back/rebuild_qcow2.sh index c9284b0..6bb2f74 100644 --- a/back/rebuild_qcow2.sh +++ b/back/rebuild_qcow2.sh @@ -19,6 +19,13 @@ fi # export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 qcow_file=$1 echo "转换文件$qcow_file中......" +if [[ "$qcow_file" == *"alpine"* ]]; then + virt-sysprep --enable alpine -a "$qcow_file" +elif [[ "$qcow_file" == *"centos"* ]]; then + virt-sysprep --enable centos -a "$qcow_file" +elif [[ "$qcow_file" == *"almalinux"* ]]; then + virt-sysprep --enable almalinux -a "$qcow_file" +fi virt-customize -a $qcow_file --run-command "echo 'Modified from https://github.com/spiritLHLS/Images' >> /etc/motd" virt-customize -a $qcow_file --run-command "echo 'Related repo https://github.com/spiritLHLS/pve' >> /etc/motd" virt-customize -a $qcow_file --run-command "echo '--by https://t.me/spiritlhl' >> /etc/motd"