不重要的优化

This commit is contained in:
bin456789 2024-04-16 23:34:27 +08:00
parent 7e53c228aa
commit eb01222a3a
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
2 changed files with 53 additions and 32 deletions

View File

@ -374,7 +374,7 @@ en_en() {
# fr-ca 到 fr # fr-ca 到 fr
en() { en() {
# 巴西/葡萄牙回落到葡萄牙语 # 巴西/葡萄牙回落到葡萄牙语
if [ "$lang" = pt-br ] || [ "$lang" = pt-br ]; then if [ "$lang" = pt-br ] || [ "$lang" = pt-pt ]; then
echo "pp" echo "pp"
return return
fi fi

View File

@ -233,11 +233,12 @@ find_xda() {
error_and_exit "cmdline main_disk is empty." error_and_exit "cmdline main_disk is empty."
fi fi
# busybox fdisk 不显示 mbr 分区表 id # busybox fdisk/lsblk/blkid 不显示 mbr 分区表 id
# 可用以下工具: # 可用以下工具:
# fdisk 在 util-linux-misc 里面,占用大 # fdisk 在 util-linux-misc 里面,占用大
# sfdisk 占用小 # sfdisk 占用小
# lsblk # lsblk
# blkid
tool=sfdisk tool=sfdisk
@ -2385,13 +2386,14 @@ install_windows() {
cp -rv /iso/efi/ /os/boot/efi/ cp -rv /iso/efi/ /os/boot/efi/
fi fi
echo 'Copying installer files...'
if false; then if false; then
rsync -rv --exclude=/sources/boot.wim /iso/* /os/installer/ rsync -rv --exclude=/sources/boot.wim /iso/* /os/installer/
else else
cd /iso (
echo 'Copying installer files...' cd /iso
find . -type f -not -name boot.wim -exec cp -r --parents {} /os/installer/ \; find . -type f -not -name boot.wim -exec cp -r --parents {} /os/installer/ \;
cd - )
fi fi
if [ -e /os/installer/sources/install.esd ]; then if [ -e /os/installer/sources/install.esd ]; then
@ -2937,45 +2939,64 @@ fi
# dd qemu 切换成云镜像模式,暂时没用到 # dd qemu 切换成云镜像模式,暂时没用到
if [ "$distro" = "dd" ] && [ "$img_type" = "qemu" ]; then if [ "$distro" = "dd" ] && [ "$img_type" = "qemu" ]; then
# 移到 reinstall.sh ?
distro=any
cloud_image=1 cloud_image=1
fi fi
if [ "$distro" = "alpine" ]; then if is_use_cloud_image; then
install_alpine case "$img_type" in
elif [ "$distro" = "dd" ] && [ "$img_type" != "qemu" ]; then qemu)
dd_gzip_xz
modify_os_on_disk windows
elif is_use_cloud_image; then
if [ "$img_type" = "qemu" ]; then
create_part create_part
download_qcow download_qcow
# 这几个系统云镜像系统盘是8~9g xfs而我们的目标是能在5g硬盘上运行因此改成复制系统文件 case "$distro" in
if [ "$distro" = centos ] || [ "$distro" = alma ] || [ "$distro" = rocky ]; then centos | alma | rocky)
# 这几个系统云镜像系统盘是8~9g xfs而我们的目标是能在5g硬盘上运行因此改成复制系统文件
install_qcow_el install_qcow_el
else ;;
# debian ubuntu fedora opensuse arch gentoo *)
# debian ubuntu fedora opensuse arch gentoo any
dd_qcow dd_qcow
resize_after_install_cloud_image resize_after_install_cloud_image
modify_os_on_disk linux modify_os_on_disk linux
fi ;;
else esac
# gzip xz 格式的云镜像,暂时没用到 ;;
gzip | xz)
# 暂时没用到 gzip xz 格式的云镜像
dd_gzip_xz dd_gzip_xz
resize_after_install_cloud_image resize_after_install_cloud_image
modify_os_on_disk linux modify_os_on_disk linux
fi ;;
elif [ "$distro" = "arch" ] || [ "$distro" = "gentoo" ]; then esac
create_part elif [ "$distro" = "dd" ]; then
install_arch_gentoo case "$img_type" in
gzip | xz)
dd_gzip_xz
modify_os_on_disk windows
;;
qemu) # dd qemu 不可能到这里,因为上面已处理
;;
esac
else else
# 安装模式: windows windows ubuntu 红帽 # 安装模式
create_part case "$distro" in
mount_part_for_install_mode alpine)
if [ "$distro" = "windows" ]; then install_alpine
install_windows ;;
else arch | gentoo)
install_redhat_ubuntu create_part
fi install_arch_gentoo
;;
*)
create_part
mount_part_for_install_mode
case "$distro" in
centos | alma | rocky | fedora | ubuntu) install_redhat_ubuntu ;;
windows) install_windows ;;
esac
;;
esac
fi fi
# alpine 因内存容量问题,单独处理 # alpine 因内存容量问题,单独处理