diff --git a/README.en.md b/README.en.md index bb4ffbd..a01e163 100644 --- a/README.en.md +++ b/README.en.md @@ -48,7 +48,7 @@ The system requirements for the target system are as follows: | System | Version | Memory | Disk | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ---------------- | -| Alpine | 3.20, 3.21, 3.22, 3.23 | 256 MB | 1 GB | +| Alpine | 3.21, 3.22, 3.23, 3.24 | 256 MB | 1 GB | | Debian | 9, 10, 11, 12, 13 | 256 MB | 1 ~ 1.5 GB ^ | | Kali | Rolling | 256 MB | 1 ~ 1.5 GB ^ | | 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 opensuse 16.0|tumbleweed 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] kali arch diff --git a/README.md b/README.md index bd38a7c..da68210 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ | 系统 | 版本 | 内存 | 硬盘 | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ------------ | -| Alpine | 3.20, 3.21, 3.22, 3.23 | 256 MB | 1 GB | +| Alpine | 3.21, 3.22, 3.23, 3.24 | 256 MB | 1 GB | | Debian | 9, 10, 11, 12, 13 | 256 MB | 1 ~ 1.5 GB ^ | | Kali | 滚动 | 256 MB | 1 ~ 1.5 GB ^ | | 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 opensuse 16.0|tumbleweed 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] kali arch diff --git a/reinstall.sh b/reinstall.sh index bbcaeb3..8ff212b 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -89,7 +89,7 @@ Usage: $reinstall_____ anolis 7|8|23 debian 9|10|11|12|13 opensuse 16.0|tumbleweed 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] kali arch @@ -1924,7 +1924,7 @@ verify_os_name() { 'nixos 25.11' \ 'debian 9|10|11|12|13' \ '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' \ 'ubuntu 18.04|20.04|22.04|24.04|26.04' \ 'redhat' \ diff --git a/trans.sh b/trans.sh index e270dc3..d621bd8 100644 --- a/trans.sh +++ b/trans.sh @@ -882,7 +882,7 @@ get_windows_version_from_windows_drive() { # CurrentMajorVersionNumber 10 # CurrentMinorVersionNumber 0 - apk add hivex + apk add hivex-perl hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SOFTWARE) get_current_version_key() { @@ -919,7 +919,7 @@ get_windows_version_from_windows_drive() { fi echo "Version: $nt_ver.$build_ver.$rev_ver" >&2 - apk del hivex + apk del hivex-perl } is_elts() { @@ -1636,6 +1636,20 @@ install_alpine() { set_ssh_keys_and_del_password /os 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 download "$confhome/fix-eth-name.sh" /os/fix-eth-name.sh 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') fi if [ -z "$image_state" ]; then - apk add hivex + apk add hivex-perl hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SOFTWARE) image_state=$(hivexget $hive '\Microsoft\Windows\CurrentVersion\Setup\State' ImageState) - apk del hivex + apk del hivex-perl fi if [ -n "$image_state" ]; then @@ -6295,10 +6309,10 @@ get_drivers() { get_windows_type_from_windows_drive() { local os_dir=$1 - apk add hivex + apk add hivex-perl system_hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SYSTEM) product_type=$(hivexget $system_hive '\ControlSet001\Control\ProductOptions' ProductType) - apk del hivex + apk del hivex-perl # ProductType InstallationType 都是用来区分客户端和服务器系统 # 就驱动而言,用的是 ProductType @@ -6321,11 +6335,11 @@ get_windows_type_from_windows_drive() { get_windows_arch_from_windows_drive() { local os_dir=$1 - apk add hivex + apk add hivex-perl hive=$(find_file_ignore_case $os_dir/Windows/System32/config/SYSTEM) # 没有 CurrentControlSet hivexget $hive 'ControlSet001\Control\Session Manager\Environment' PROCESSOR_ARCHITECTURE - apk del hivex + apk del hivex-perl } get_intel_download_url() { @@ -6344,18 +6358,18 @@ get_intel_download_url() { grep -Eio -m1 "https://.+/$file_regex" | grep . } -apk_add_hivex_perl() { - # TODO: alpine 3.24 发布后删除 - # hivex-perl 要从 edge/community 仓库下载 +apk_add_from_edge() { + # 从 edge/community 仓库下载新版软件包 + # 现在用不到 local alpine_mirror alpine_mirror=$(grep '^http.*/main$' /etc/apk/repositories | sed 's,/[^/]*/main$,,' | head -1) apk add --repository "$alpine_mirror/edge/community" \ --force-non-repository \ --virtual edge \ - hivex-perl + "$@" } -apk_del_hivex_perl() { +apk_del_edge() { apk del edge } @@ -7559,7 +7573,7 @@ EOF to_system_hive="$(find_file_ignore_case /wim/Windows/System32/config/SYSTEM)" to_software_hive="$(find_file_ignore_case /wim/Windows/System32/config/SOFTWARE)" - apk_add_hivex_perl + apk add hivex-perl # 获取当前生效的 wvpci.inf 文件 # 得到 wvpci.inf_amd64_86afbe8940682d27 这样的文件名 @@ -7611,7 +7625,7 @@ EOF EOF hivexregedit --merge "$to_system_hive" "$reg" - apk_del_hivex_perl + apk del hivex-perl else error_and_exit "vpci driver not found." fi