mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
不重要的优化
This commit is contained in:
parent
8ef7f268cd
commit
ad295473bc
11
get-xda.sh
11
get-xda.sh
@ -3,15 +3,8 @@
|
||||
# alpine 未用到此脚本
|
||||
|
||||
get_all_disks() {
|
||||
# busybox blkid 不接受任何参数
|
||||
disks=$(blkid | cut -d: -f1 | cut -d/ -f3 | sed -E 's/p?[0-9]+$//' | sort -u)
|
||||
# blkid 会显示 sr0,经过上面的命令输出为 sr
|
||||
# 因此要检测是否有效
|
||||
for disk in $disks; do
|
||||
if [ -b "/dev/$disk" ]; then
|
||||
echo "$disk"
|
||||
fi
|
||||
done
|
||||
# shellcheck disable=SC2010
|
||||
ls /sys/block/ | grep -Ev '^(loop|sr|nbd)'
|
||||
}
|
||||
|
||||
get_xda() {
|
||||
|
@ -2313,6 +2313,9 @@ get_disk_controller() {
|
||||
# xen_blkfront
|
||||
# ahci
|
||||
# nvme
|
||||
# mptspi
|
||||
# mptsas
|
||||
# vmw_pvscsi
|
||||
(
|
||||
cd "$(readlink -f /sys/block/$xda)"
|
||||
while ! [ "$(pwd)" = / ]; do
|
||||
|
32
trans.sh
32
trans.sh
@ -277,17 +277,8 @@ find_xda() {
|
||||
}
|
||||
|
||||
get_all_disks() {
|
||||
# busybox blkid 不接受任何参数
|
||||
# lsblk 要另外安装
|
||||
disks=$(blkid | cut -d: -f1 | cut -d/ -f3 | sed -E 's/p?[0-9]+$//' | sort -u)
|
||||
|
||||
# blkid 会显示 sr0,经过上面的命令输出为 sr
|
||||
# 因此要检测是否有效
|
||||
for disk in $disks; do
|
||||
if [ -b "/dev/$disk" ]; then
|
||||
echo "$disk"
|
||||
fi
|
||||
done
|
||||
# shellcheck disable=SC2010
|
||||
ls /sys/block/ | grep -Ev '^(loop|sr|nbd)'
|
||||
}
|
||||
|
||||
setup_tty_and_log() {
|
||||
@ -1805,16 +1796,6 @@ EOF
|
||||
disable_selinux_kdump $os_dir
|
||||
fi
|
||||
|
||||
# 修复 fedora 38 或以下用静态 ipv6 会掉线
|
||||
# el 全系也用 NetworkManager,但他们的配置文件是 sysconfig,因此不受影响
|
||||
# https://github.com/canonical/cloud-init/commit/5d440856cb6d2b4c908015fe4eb7227615c17c8b
|
||||
if false && grep -E 'fedora:38' $os_dir/etc/os-release; then
|
||||
network_manager_py=$os_dir/usr/lib/python3.11/site-packages/cloudinit/net/network_manager.py
|
||||
if ! grep '"static6": "manual",' $network_manager_py; then
|
||||
echo '"static6": "manual",' | insert_into_file $network_manager_py after '"static": "manual",'
|
||||
fi
|
||||
fi
|
||||
|
||||
# debian 网络问题
|
||||
# 注意 ubuntu 也有 /etc/debian_version
|
||||
if [ "$distro" = debian ]; then
|
||||
@ -2750,10 +2731,15 @@ install_windows() {
|
||||
|
||||
# 用内核版本号筛选驱动
|
||||
# 使得可以安装 Hyper-V Server / Azure Stack HCI 等 Windows Server 变种
|
||||
nt_ver="$(peres -v /iso/setup.exe | grep 'Product Version:' | cut -d: -f2 | xargs | cut -d. -f 1,2)"
|
||||
product_ver=$(peres -v /iso/setup.exe | grep 'Product Version:' | cut -d: -f2 | xargs)
|
||||
nt_ver=$(echo "$product_ver" | cut -d. -f 1,2)
|
||||
build_ver=$(echo "$product_ver" | cut -d. -f 3)
|
||||
echo "NT Version: $nt_ver"
|
||||
echo "Build Version: $build_ver"
|
||||
|
||||
# 跳过 win11 硬件限制
|
||||
# 解除 win11 硬件限制
|
||||
# 24h2 26100 IoT 没有限制 TPM,但强制要求 2c2g
|
||||
# https://learn.microsoft.com/windows/iot/iot-enterprise/Hardware/System_Requirements
|
||||
if [[ "$image_name" = "Windows 11"* ]]; then
|
||||
wiminfo "$install_wim" "$image_name" --image-property WINDOWS/INSTALLATIONTYPE=Server
|
||||
fi
|
||||
|
@ -25,7 +25,9 @@
|
||||
</InstallTo>
|
||||
</OSImage>
|
||||
</ImageInstall>
|
||||
<!-- 有的机器不起作用 -->
|
||||
<!-- 用注册表无法绕过 cpu 核数限制 -->
|
||||
<!-- https://github.com/pbatard/rufus/issues/1990 -->
|
||||
<!-- https://learn.microsoft.com/windows/iot/iot-enterprise/Hardware/System_Requirements -->
|
||||
<!-- <RunSynchronous>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>1</Order>
|
||||
|
Loading…
x
Reference in New Issue
Block a user