mirror of
https://github.com/bin456789/reinstall.git
synced 2026-06-11 22:34:30 +08:00
alpine: 添加 3.24
This commit is contained in:
+2
-2
@@ -48,7 +48,7 @@ The system requirements for the target system are as follows:
|
|||||||
|
|
||||||
| System | Version | Memory | Disk |
|
| System | Version | Memory | Disk |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ---------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ---------------- |
|
||||||
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.20, 3.21, 3.22, 3.23 | 256 MB | 1 GB |
|
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.21, 3.22, 3.23, 3.24 | 256 MB | 1 GB |
|
||||||
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12, 13 | 256 MB | 1 ~ 1.5 GB ^ |
|
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12, 13 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||||
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | Rolling | 256 MB | 1 ~ 1.5 GB ^ |
|
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | Rolling | 256 MB | 1 ~ 1.5 GB ^ |
|
||||||
| <img width="16" height="16" src="https://documentation.ubuntu.com/server/_static/favicon.png" /> Ubuntu | 18.04 LTS - 26.04 LTS | 512 MB \* | 2 GB |
|
| <img width="16" height="16" src="https://documentation.ubuntu.com/server/_static/favicon.png" /> Ubuntu | 18.04 LTS - 26.04 LTS | 512 MB \* | 2 GB |
|
||||||
@@ -169,7 +169,7 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
debian 9|10|11|12|13
|
debian 9|10|11|12|13
|
||||||
opensuse 16.0|tumbleweed
|
opensuse 16.0|tumbleweed
|
||||||
openeuler 20.03|22.03|24.03
|
openeuler 20.03|22.03|24.03
|
||||||
alpine 3.20|3.21|3.22|3.23
|
alpine 3.21|3.22|3.23|3.24
|
||||||
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
||||||
kali
|
kali
|
||||||
arch
|
arch
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
| 系统 | 版本 | 内存 | 硬盘 |
|
| 系统 | 版本 | 内存 | 硬盘 |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ------------ |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ------------ |
|
||||||
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.20, 3.21, 3.22, 3.23 | 256 MB | 1 GB |
|
| <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine | 3.21, 3.22, 3.23, 3.24 | 256 MB | 1 GB |
|
||||||
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12, 13 | 256 MB | 1 ~ 1.5 GB ^ |
|
| <img width="16" height="16" src="https://www.debian.org/favicon.ico" /> Debian | 9, 10, 11, 12, 13 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||||
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | 滚动 | 256 MB | 1 ~ 1.5 GB ^ |
|
| <img width="16" height="16" src="https://github.com/bin456789/reinstall/assets/7548515/f74b3d5b-085f-4df3-bcc9-8a9bd80bb16d" /> Kali | 滚动 | 256 MB | 1 ~ 1.5 GB ^ |
|
||||||
| <img width="16" height="16" src="https://documentation.ubuntu.com/server/_static/favicon.png" /> Ubuntu | 18.04 LTS - 26.04 LTS | 512 MB \* | 2 GB |
|
| <img width="16" height="16" src="https://documentation.ubuntu.com/server/_static/favicon.png" /> Ubuntu | 18.04 LTS - 26.04 LTS | 512 MB \* | 2 GB |
|
||||||
@@ -169,7 +169,7 @@ bash reinstall.sh anolis 7|8|23
|
|||||||
debian 9|10|11|12|13
|
debian 9|10|11|12|13
|
||||||
opensuse 16.0|tumbleweed
|
opensuse 16.0|tumbleweed
|
||||||
openeuler 20.03|22.03|24.03
|
openeuler 20.03|22.03|24.03
|
||||||
alpine 3.20|3.21|3.22|3.23
|
alpine 3.21|3.22|3.23|3.24
|
||||||
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
||||||
kali
|
kali
|
||||||
arch
|
arch
|
||||||
|
|||||||
+2
-2
@@ -89,7 +89,7 @@ Usage: $reinstall_____ anolis 7|8|23
|
|||||||
debian 9|10|11|12|13
|
debian 9|10|11|12|13
|
||||||
opensuse 16.0|tumbleweed
|
opensuse 16.0|tumbleweed
|
||||||
openeuler 20.03|22.03|24.03
|
openeuler 20.03|22.03|24.03
|
||||||
alpine 3.20|3.21|3.22|3.23
|
alpine 3.21|3.22|3.23|3.24
|
||||||
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
ubuntu 18.04|20.04|22.04|24.04|26.04 [--minimal]
|
||||||
kali
|
kali
|
||||||
arch
|
arch
|
||||||
@@ -1924,7 +1924,7 @@ verify_os_name() {
|
|||||||
'nixos 25.11' \
|
'nixos 25.11' \
|
||||||
'debian 9|10|11|12|13' \
|
'debian 9|10|11|12|13' \
|
||||||
'opensuse 16.0|tumbleweed' \
|
'opensuse 16.0|tumbleweed' \
|
||||||
'alpine 3.20|3.21|3.22|3.23' \
|
'alpine 3.21|3.22|3.23|3.24' \
|
||||||
'openeuler 20.03|22.03|24.03' \
|
'openeuler 20.03|22.03|24.03' \
|
||||||
'ubuntu 18.04|20.04|22.04|24.04|26.04' \
|
'ubuntu 18.04|20.04|22.04|24.04|26.04' \
|
||||||
'redhat' \
|
'redhat' \
|
||||||
|
|||||||
@@ -882,7 +882,7 @@ get_windows_version_from_windows_drive() {
|
|||||||
# CurrentMajorVersionNumber 10
|
# CurrentMajorVersionNumber 10
|
||||||
# CurrentMinorVersionNumber 0
|
# CurrentMinorVersionNumber 0
|
||||||
|
|
||||||
apk add hivex
|
apk add hivex-perl
|
||||||
hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SOFTWARE)
|
hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SOFTWARE)
|
||||||
|
|
||||||
get_current_version_key() {
|
get_current_version_key() {
|
||||||
@@ -919,7 +919,7 @@ get_windows_version_from_windows_drive() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Version: $nt_ver.$build_ver.$rev_ver" >&2
|
echo "Version: $nt_ver.$build_ver.$rev_ver" >&2
|
||||||
apk del hivex
|
apk del hivex-perl
|
||||||
}
|
}
|
||||||
|
|
||||||
is_elts() {
|
is_elts() {
|
||||||
@@ -1636,6 +1636,20 @@ install_alpine() {
|
|||||||
set_ssh_keys_and_del_password /os
|
set_ssh_keys_and_del_password /os
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# alpine 3.24+
|
||||||
|
# 要从 /etc/inittab 删除多余的 tty0
|
||||||
|
# 否则开机时 vnc 会有两个登录提示,一个是 tty0,一个是 tty1
|
||||||
|
|
||||||
|
# sed 找到 # enable login on alternative console 的行
|
||||||
|
# 用 N 读取下一行到当前空间
|
||||||
|
# 再匹配 \ntty0:
|
||||||
|
sed -i '
|
||||||
|
/^# enable login on alternative console$/{
|
||||||
|
N
|
||||||
|
/\ntty0:/d
|
||||||
|
}
|
||||||
|
' /os/etc/inittab
|
||||||
|
|
||||||
# 下载 fix-eth-name
|
# 下载 fix-eth-name
|
||||||
download "$confhome/fix-eth-name.sh" /os/fix-eth-name.sh
|
download "$confhome/fix-eth-name.sh" /os/fix-eth-name.sh
|
||||||
download "$confhome/fix-eth-name.initd" /os/etc/init.d/fix-eth-name
|
download "$confhome/fix-eth-name.initd" /os/etc/init.d/fix-eth-name
|
||||||
@@ -3300,10 +3314,10 @@ get_image_state() {
|
|||||||
image_state=$(grep -i '^ImageState=' $state_ini | cut -d= -f2 | tr -d '\r')
|
image_state=$(grep -i '^ImageState=' $state_ini | cut -d= -f2 | tr -d '\r')
|
||||||
fi
|
fi
|
||||||
if [ -z "$image_state" ]; then
|
if [ -z "$image_state" ]; then
|
||||||
apk add hivex
|
apk add hivex-perl
|
||||||
hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SOFTWARE)
|
hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SOFTWARE)
|
||||||
image_state=$(hivexget $hive '\Microsoft\Windows\CurrentVersion\Setup\State' ImageState)
|
image_state=$(hivexget $hive '\Microsoft\Windows\CurrentVersion\Setup\State' ImageState)
|
||||||
apk del hivex
|
apk del hivex-perl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$image_state" ]; then
|
if [ -n "$image_state" ]; then
|
||||||
@@ -6295,10 +6309,10 @@ get_drivers() {
|
|||||||
get_windows_type_from_windows_drive() {
|
get_windows_type_from_windows_drive() {
|
||||||
local os_dir=$1
|
local os_dir=$1
|
||||||
|
|
||||||
apk add hivex
|
apk add hivex-perl
|
||||||
system_hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SYSTEM)
|
system_hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SYSTEM)
|
||||||
product_type=$(hivexget $system_hive '\ControlSet001\Control\ProductOptions' ProductType)
|
product_type=$(hivexget $system_hive '\ControlSet001\Control\ProductOptions' ProductType)
|
||||||
apk del hivex
|
apk del hivex-perl
|
||||||
|
|
||||||
# ProductType InstallationType 都是用来区分客户端和服务器系统
|
# ProductType InstallationType 都是用来区分客户端和服务器系统
|
||||||
# 就驱动而言,用的是 ProductType
|
# 就驱动而言,用的是 ProductType
|
||||||
@@ -6321,11 +6335,11 @@ get_windows_type_from_windows_drive() {
|
|||||||
get_windows_arch_from_windows_drive() {
|
get_windows_arch_from_windows_drive() {
|
||||||
local os_dir=$1
|
local os_dir=$1
|
||||||
|
|
||||||
apk add hivex
|
apk add hivex-perl
|
||||||
hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SYSTEM)
|
hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SYSTEM)
|
||||||
# 没有 CurrentControlSet
|
# 没有 CurrentControlSet
|
||||||
hivexget $hive 'ControlSet001\Control\Session Manager\Environment' PROCESSOR_ARCHITECTURE
|
hivexget $hive 'ControlSet001\Control\Session Manager\Environment' PROCESSOR_ARCHITECTURE
|
||||||
apk del hivex
|
apk del hivex-perl
|
||||||
}
|
}
|
||||||
|
|
||||||
get_intel_download_url() {
|
get_intel_download_url() {
|
||||||
@@ -6344,18 +6358,18 @@ get_intel_download_url() {
|
|||||||
grep -Eio -m1 "https://.+/$file_regex" | grep .
|
grep -Eio -m1 "https://.+/$file_regex" | grep .
|
||||||
}
|
}
|
||||||
|
|
||||||
apk_add_hivex_perl() {
|
apk_add_from_edge() {
|
||||||
# TODO: alpine 3.24 发布后删除
|
# 从 edge/community 仓库下载新版软件包
|
||||||
# hivex-perl 要从 edge/community 仓库下载
|
# 现在用不到
|
||||||
local alpine_mirror
|
local alpine_mirror
|
||||||
alpine_mirror=$(grep '^http.*/main$' /etc/apk/repositories | sed 's,/[^/]*/main$,,' | head -1)
|
alpine_mirror=$(grep '^http.*/main$' /etc/apk/repositories | sed 's,/[^/]*/main$,,' | head -1)
|
||||||
apk add --repository "$alpine_mirror/edge/community" \
|
apk add --repository "$alpine_mirror/edge/community" \
|
||||||
--force-non-repository \
|
--force-non-repository \
|
||||||
--virtual edge \
|
--virtual edge \
|
||||||
hivex-perl
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
apk_del_hivex_perl() {
|
apk_del_edge() {
|
||||||
apk del edge
|
apk del edge
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7559,7 +7573,7 @@ EOF
|
|||||||
to_system_hive="$(find_file_ignore_case /wim/Windows/System32/config/SYSTEM)"
|
to_system_hive="$(find_file_ignore_case /wim/Windows/System32/config/SYSTEM)"
|
||||||
to_software_hive="$(find_file_ignore_case /wim/Windows/System32/config/SOFTWARE)"
|
to_software_hive="$(find_file_ignore_case /wim/Windows/System32/config/SOFTWARE)"
|
||||||
|
|
||||||
apk_add_hivex_perl
|
apk add hivex-perl
|
||||||
|
|
||||||
# 获取当前生效的 wvpci.inf 文件
|
# 获取当前生效的 wvpci.inf 文件
|
||||||
# 得到 wvpci.inf_amd64_86afbe8940682d27 这样的文件名
|
# 得到 wvpci.inf_amd64_86afbe8940682d27 这样的文件名
|
||||||
@@ -7611,7 +7625,7 @@ EOF
|
|||||||
EOF
|
EOF
|
||||||
hivexregedit --merge "$to_system_hive" "$reg"
|
hivexregedit --merge "$to_system_hive" "$reg"
|
||||||
|
|
||||||
apk_del_hivex_perl
|
apk del hivex-perl
|
||||||
else
|
else
|
||||||
error_and_exit "vpci driver not found."
|
error_and_exit "vpci driver not found."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user