mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 不重要的优化
This commit is contained in:
parent
60d3d8a0a1
commit
54acd253d9
@ -802,7 +802,7 @@ collect_netconf() {
|
|||||||
config=$1
|
config=$1
|
||||||
key=$2
|
key=$2
|
||||||
var=$3
|
var=$3
|
||||||
IFS=',' read -r -a "${var?}" <<<"$(grep "$key=" <<<"$config" | cut -d= -f2 | sed 's/[{}"]//g')"
|
IFS=',' read -r -a "${var?}" <<<"$(grep "$key=" <<<"$config" | cut -d= -f2 | sed 's/[{}\"]//g')"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 部分机器精简了 powershell
|
# 部分机器精简了 powershell
|
||||||
|
8
trans.sh
8
trans.sh
@ -1203,7 +1203,7 @@ install_qcow_el() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modprobe nbd
|
modprobe nbd nbds_max=1
|
||||||
qemu_nbd -c /dev/nbd0 $qcow_file
|
qemu_nbd -c /dev/nbd0 $qcow_file
|
||||||
|
|
||||||
# TODO: 改成循环mount找出os+fstab查找剩余分区?
|
# TODO: 改成循环mount找出os+fstab查找剩余分区?
|
||||||
@ -1555,7 +1555,7 @@ install_windows() {
|
|||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
download $iso /os/windows.iso
|
download $iso /os/windows.iso
|
||||||
mkdir -p /iso
|
mkdir -p /iso
|
||||||
mount /os/windows.iso /iso
|
mount -o ro /os/windows.iso /iso
|
||||||
|
|
||||||
# 从iso复制文件
|
# 从iso复制文件
|
||||||
# efi: 复制boot开头的文件+efi目录到efi分区,复制iso全部文件(除了boot.wim)到installer分区
|
# efi: 复制boot开头的文件+efi目录到efi分区,复制iso全部文件(除了boot.wim)到installer分区
|
||||||
@ -1720,7 +1720,7 @@ install_windows() {
|
|||||||
|
|
||||||
download https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/$dir/virtio-win.iso $drv/virtio-win.iso
|
download https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/$dir/virtio-win.iso $drv/virtio-win.iso
|
||||||
mkdir -p $drv/virtio
|
mkdir -p $drv/virtio
|
||||||
mount $drv/virtio-win.iso $drv/virtio
|
mount -o ro $drv/virtio-win.iso $drv/virtio
|
||||||
|
|
||||||
apk add dmidecode
|
apk add dmidecode
|
||||||
dmi=$(dmidecode)
|
dmi=$(dmidecode)
|
||||||
@ -1945,6 +1945,7 @@ install_redhat_ubuntu() {
|
|||||||
menuentry "reinstall" {
|
menuentry "reinstall" {
|
||||||
# https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1851311
|
# https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1851311
|
||||||
# rmmod tpm
|
# rmmod tpm
|
||||||
|
insmod all_video
|
||||||
search --no-floppy --label --set=root installer
|
search --no-floppy --label --set=root installer
|
||||||
loopback loop /ubuntu.iso
|
loopback loop /ubuntu.iso
|
||||||
linux (loop)/casper/vmlinuz iso-scan/filename=/ubuntu.iso autoinstall noprompt noeject cloud-config-url=$ks $extra_cmdline extra.kernel=$kernel --- $console_cmdline
|
linux (loop)/casper/vmlinuz iso-scan/filename=/ubuntu.iso autoinstall noprompt noeject cloud-config-url=$ks $extra_cmdline extra.kernel=$kernel --- $console_cmdline
|
||||||
@ -1959,6 +1960,7 @@ EOF
|
|||||||
cat <<EOF >$grub_cfg
|
cat <<EOF >$grub_cfg
|
||||||
set timeout=5
|
set timeout=5
|
||||||
menuentry "reinstall" {
|
menuentry "reinstall" {
|
||||||
|
insmod all_video
|
||||||
search --no-floppy --label --set=root os
|
search --no-floppy --label --set=root os
|
||||||
linux /vmlinuz inst.stage2=hd:LABEL=installer:/install.img inst.ks=$ks $extra_cmdline $console_cmdline
|
linux /vmlinuz inst.stage2=hd:LABEL=installer:/install.img inst.ks=$ks $extra_cmdline $console_cmdline
|
||||||
initrd /initrd.img
|
initrd /initrd.img
|
||||||
|
Loading…
x
Reference in New Issue
Block a user