mirror of
https://github.com/bin456789/reinstall.git
synced 2025-10-05 22:44:53 +00:00
core: 不重要的更改
- 更优雅地 overwrite windows 命令 - 更改 openSUSE 源 - 删除 wicked 网卡配置的 cloud-init 注释
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
[](https://github.com/XAMPPRocky/tokei)
|
||||
[](https://t.me/reinstall_os)
|
||||
[](https://github.com/sponsors/bin456789)
|
||||
<!-- [](https://github.com/aschey/vercel-tokei) -->
|
||||
|
||||
One-Click Script to Reinstall System [中文](README.md)
|
||||
|
||||
|
@@ -7,7 +7,6 @@
|
||||
[](https://github.com/XAMPPRocky/tokei)
|
||||
[](https://t.me/reinstall_os)
|
||||
[](https://github.com/sponsors/bin456789)
|
||||
<!-- [](https://github.com/aschey/vercel-tokei) -->
|
||||
|
||||
一键重装脚本 [English](README.en.md)
|
||||
|
||||
|
21
reinstall.sh
21
reinstall.sh
@@ -488,15 +488,14 @@ run_with_del_cr() {
|
||||
}
|
||||
|
||||
run_with_del_cr_template() {
|
||||
# 调用链:wmic() -> run_with_del_cr(wmic) -> _wmic() -> command wmic
|
||||
if command -v _$exe >/dev/null; then
|
||||
if get_function _$exe >/dev/null; then
|
||||
run_with_del_cr _$exe "$@"
|
||||
else
|
||||
run_with_del_cr command $exe "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
_wmic() {
|
||||
wmic() {
|
||||
if is_have_cmd wmic; then
|
||||
# 如果参数没有 GET,添加 GET,防止以下报错
|
||||
# wmic memorychip /format:list
|
||||
@@ -1343,8 +1342,12 @@ Continue?
|
||||
}
|
||||
|
||||
setos_opensuse() {
|
||||
# aria2 有 mata4 问题
|
||||
# https://download.opensuse.org/
|
||||
# curl 会跳转到最近的镜像源,但可能会被镜像源 block
|
||||
# aria2 会跳转使用 metalink
|
||||
|
||||
# https://downloadcontent.opensuse.org # 德国
|
||||
# https://downloadcontentcdn.opensuse.org # fastly cdn
|
||||
|
||||
# 很多国内源缺少 aarch64 tumbleweed appliances
|
||||
# https://download.opensuse.org/ports/aarch64/tumbleweed/appliances/
|
||||
@@ -1354,7 +1357,7 @@ Continue?
|
||||
if is_in_china; then
|
||||
mirror=https://mirror.nju.edu.cn/opensuse
|
||||
else
|
||||
mirror=https://ftp.gwdg.de/pub/opensuse
|
||||
mirror=https://downloadcontentcdn.opensuse.org
|
||||
fi
|
||||
|
||||
if [ "$releasever" = tumbleweed ]; then
|
||||
@@ -2667,7 +2670,7 @@ install_grub_linux_efi() {
|
||||
if is_in_china; then
|
||||
mirror=https://mirror.nju.edu.cn/opensuse
|
||||
else
|
||||
mirror=https://ftp.gwdg.de/pub/opensuse
|
||||
mirror=https://downloadcontentcdn.opensuse.org
|
||||
fi
|
||||
|
||||
[ "$basearch" = x86_64 ] && ports='' || ports=/ports/$basearch
|
||||
@@ -3611,6 +3614,12 @@ if is_in_windows; then
|
||||
|
||||
# 为 windows 程序输出删除 cr
|
||||
for exe in $WINDOWS_EXES; do
|
||||
# 如果我们覆写了 wmic(),则先将 wmic() 重命名为 _wmic()
|
||||
if get_function $exe >/dev/null 2>&1; then
|
||||
eval "_$(get_function $exe)"
|
||||
fi
|
||||
# 使用以下方法重新生成 wmic()
|
||||
# 调用链:wmic() -> run_with_del_cr(wmic) -> _wmic() -> command wmic
|
||||
eval "$exe(){ $(get_function_content run_with_del_cr_template | sed "s/\$exe/$exe/g") }"
|
||||
done
|
||||
fi
|
||||
|
13
trans.sh
13
trans.sh
@@ -3347,6 +3347,11 @@ EOF
|
||||
chroot $os_dir cloud-init devel net-convert \
|
||||
-p /net.cfg -k yaml -d out -D opensuse -O sysconfig
|
||||
|
||||
# 删除
|
||||
# Created by cloud-init on instance boot automatically, do not edit.
|
||||
#
|
||||
sed -i '/^#/d' "$os_dir/out/etc/sysconfig/network/ifcfg-eth"*
|
||||
|
||||
for ethx in $(get_eths); do
|
||||
# 1. 修复甲骨文云重启后 ipv6 丢失
|
||||
# https://github.com/openSUSE/wicked/issues/1058
|
||||
@@ -5642,6 +5647,14 @@ EOF
|
||||
# 2012 9.3.0
|
||||
# 2008 (r2) 7.2.0.1555
|
||||
|
||||
# 9.3.1
|
||||
# https://downloads.xenserver.com/vm-tools-windows/9.3.1/managementagentx64.msi
|
||||
# http://downloadns.citrix.com.edgesuite.net/17461/managementagentx64.msi
|
||||
|
||||
# 7.2.0.1555
|
||||
# http://downloadns.citrix.com.edgesuite.net/14656/managementagentx64.msi
|
||||
# http://downloadns.citrix.com.edgesuite.net/14655/managementagentx86.msi
|
||||
|
||||
# xen
|
||||
# 没签名,暂时用aws的驱动代替
|
||||
# https://lore.kernel.org/xen-devel/E1qKMmq-00035B-SS@xenbits.xenproject.org/
|
||||
|
Reference in New Issue
Block a user