mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-04 01:38:12 +08:00
Update rebuild_qcow2.sh
This commit is contained in:
parent
6e8151e5d1
commit
dae5c07add
1 changed files with 7 additions and 7 deletions
|
@ -19,13 +19,13 @@ fi
|
||||||
# export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
|
# export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1
|
||||||
qcow_file=$1
|
qcow_file=$1
|
||||||
echo "转换文件$qcow_file中......"
|
echo "转换文件$qcow_file中......"
|
||||||
if [[ "$qcow_file" == *"alpine"* ]]; then
|
# if [[ "$qcow_file" == *"alpine"* ]]; then
|
||||||
virt-sysprep --enable alpine -a "$qcow_file"
|
# virt-sysprep --enable alpine -a "$qcow_file"
|
||||||
elif [[ "$qcow_file" == *"centos"* ]]; then
|
# elif [[ "$qcow_file" == *"centos"* ]]; then
|
||||||
virt-sysprep --enable centos -a "$qcow_file"
|
# virt-sysprep --enable centos -a "$qcow_file"
|
||||||
elif [[ "$qcow_file" == *"almalinux"* ]]; then
|
# elif [[ "$qcow_file" == *"almalinux"* ]]; then
|
||||||
virt-sysprep --enable almalinux -a "$qcow_file"
|
# virt-sysprep --enable almalinux -a "$qcow_file"
|
||||||
fi
|
# fi
|
||||||
if [[ "$qcow_file" == *"debian"* || "$qcow_file" == *"ubuntu"* || "$qcow_file" == *"arch"* ]]; then
|
if [[ "$qcow_file" == *"debian"* || "$qcow_file" == *"ubuntu"* || "$qcow_file" == *"arch"* ]]; then
|
||||||
virt-customize -a $qcow_file --run-command "sed -i 's/ssh_pwauth:[[:space:]]*0/ssh_pwauth: 1/g' /etc/cloud/cloud.cfg"
|
virt-customize -a $qcow_file --run-command "sed -i 's/ssh_pwauth:[[:space:]]*0/ssh_pwauth: 1/g' /etc/cloud/cloud.cfg"
|
||||||
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 'Modified from https://github.com/spiritLHLS/Images' >> /etc/motd"
|
||||||
|
|
Loading…
Reference in a new issue