mirror of
https://github.com/bin456789/reinstall.git
synced 2025-06-08 05:19:57 +00:00
core: 不重要的更新
This commit is contained in:
parent
71ad989672
commit
4346f4b460
12
README.en.md
12
README.en.md
@ -39,7 +39,7 @@ The system requirements for the target system are as follows:
|
||||
| <img width="16" height="16" src="https://www.redhat.com/favicon.ico" /> RHEL <img width="16" height="16" src="https://almalinux.org/fav/favicon.ico" /> AlmaLinux <img width="16" height="16" src="https://rockylinux.org/favicon.png" /> Rocky <img width="16" height="16" src="https://www.oracle.com/asset/web/favicons/favicon-32.png" /> Oracle | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://opencloudos.org/qq.ico" /> OpenCloudOS | 8, 9, Stream 23 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.centos.org/assets/icons/favicon.svg" /> CentOS Stream | 9, 10 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 40, 41 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 41, 42 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03 LTS - 24.03 LTS, 25.03 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | Leap 15.6, Tumbleweed (Rolling) | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://github.com/user-attachments/assets/99a542b6-6482-4086-addf-f192c06fef73" /> NixOS | 24.11 | 512 MB | 5 GB |
|
||||
@ -132,7 +132,7 @@ bash reinstall.sh anolis 7|8|23
|
||||
oracle 8|9
|
||||
almalinux 8|9
|
||||
centos 9|10
|
||||
fedora 40|41
|
||||
fedora 41|42
|
||||
nixos 24.11
|
||||
debian 9|10|11|12
|
||||
opensuse 15.6|tumbleweed
|
||||
@ -163,9 +163,9 @@ bash reinstall.sh anolis 7|8|23
|
||||
- `--hold 2` Prevent reboot after installation completes, allowing SSH login to modify system content; the system is mounted at `/os` (this feature is not supported on Debian/Kali).
|
||||
|
||||
> [!TIP]
|
||||
> When installing Debian/Kali, x86 architectures can monitor the installation progress through VNC in the background, while ARM architectures can use the serial console.
|
||||
> When installing Debian/Kali, x86 architectures can monitor the installation progress through VNC from server provider, while ARM architectures can use the serial console.
|
||||
>
|
||||
> When installing other systems, can monitor the progress through various methods (SSH, HTTP 80 port, VNC in the background, serial console).
|
||||
> When installing other systems, can monitor the progress through various methods (SSH, HTTP 80 port, VNC from server provider, serial console).
|
||||
> <br />Even if errors occur during the installation process, you can still install to Alpine via SSH by running `/trans.sh alpine`
|
||||
|
||||
<details>
|
||||
@ -219,7 +219,7 @@ bash reinstall.sh dd --img "https://example.com/xxx.xz"
|
||||
- `--hold 2` Prevent reboot after the DD process finishes, allowing SSH login to modify system content. The Windows system will be mounted at `/os`, but Linux systems will **NOT** be automatically mounted.
|
||||
|
||||
> [!TIP]
|
||||
> Can monitor the progress through various methods (SSH, HTTP 80 port, VNC in the background, serial console).
|
||||
> Can monitor the progress through various methods (SSH, HTTP 80 port, VNC from server provider, serial console).
|
||||
> <br />Even if errors occur during the installation process, you can still install to Alpine via SSH by running `/trans.sh alpine`
|
||||
|
||||
### Feature 3: Reboot to <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine Live OS (RAM OS)
|
||||
@ -400,7 +400,7 @@ bash reinstall.sh windows \
|
||||
- AWS ([ENA Network Adapter][aws-ena], [NVME Storage Controller][aws-nvme])
|
||||
- GCP ([gVNIC Network Adapter][gcp-gvnic], [GGA Display Adapter][gcp-gga])
|
||||
- Azure ([MANA Network Adapter][azure-mana])
|
||||
- Intel ([VMD Storage Controller][intel-vmd], Network Adapter: [7][intel-nic-7-sha1], [8][intel-nic-8], [8.1][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-7-sha1], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
|
||||
- Intel ([VMD Storage Controller][intel-vmd], Network Adapter: [7][intel-nic-7-sha256], [8][intel-nic-8], [8.1][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-7-sha1], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
|
||||
|
||||
[virtio-virtio]: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
|
||||
[virtio-aliyun]: https://www.alibabacloud.com/help/ecs/user-guide/install-the-virtio-driver-1
|
||||
|
12
README.md
12
README.md
@ -39,7 +39,7 @@
|
||||
| <img width="16" height="16" src="https://www.redhat.com/favicon.ico" /> RHEL <img width="16" height="16" src="https://almalinux.org/fav/favicon.ico" /> AlmaLinux <img width="16" height="16" src="https://rockylinux.org/favicon.png" /> Rocky <img width="16" height="16" src="https://www.oracle.com/asset/web/favicons/favicon-32.png" /> Oracle | 8, 9 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://opencloudos.org/qq.ico" /> OpenCloudOS | 8, 9, Stream 23 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.centos.org/assets/icons/favicon.svg" /> CentOS Stream | 9, 10 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 40, 41 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://fedoraproject.org/favicon.ico" /> Fedora | 41, 42 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.openeuler.org/favicon.ico" /> openEuler | 20.03 LTS - 24.03 LTS, 25.03 | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://static.opensuse.org/favicon.ico" /> openSUSE | Leap 15.6, Tumbleweed (滚动) | 512 MB \* | 5 GB |
|
||||
| <img width="16" height="16" src="https://github.com/user-attachments/assets/99a542b6-6482-4086-addf-f192c06fef73" /> NixOS | 24.11 | 512 MB | 5 GB |
|
||||
@ -132,7 +132,7 @@ bash reinstall.sh anolis 7|8|23
|
||||
oracle 8|9
|
||||
almalinux 8|9
|
||||
centos 9|10
|
||||
fedora 40|41
|
||||
fedora 41|42
|
||||
nixos 24.11
|
||||
debian 9|10|11|12
|
||||
opensuse 15.6|tumbleweed
|
||||
@ -163,9 +163,9 @@ bash reinstall.sh anolis 7|8|23
|
||||
- `--hold 2` 安装结束后不重启,此时可以 SSH 登录修改系统内容,系统挂载在 `/os` (此功能不支持 Debian/Kali)
|
||||
|
||||
> [!TIP]
|
||||
> 安装 Debian/Kali 时,x86 可通过后台 VNC 查看安装进度,ARM 可通过串行控制台查看安装进度。
|
||||
> 安装 Debian/Kali 时,x86 可通过商家后台 VNC 查看安装进度,ARM 可通过串行控制台查看安装进度。
|
||||
>
|
||||
> 安装其它系统时,可通过多种方式(SSH、HTTP 80 端口、后台 VNC、串行控制台)查看安装进度。
|
||||
> 安装其它系统时,可通过多种方式(SSH、HTTP 80 端口、商家后台 VNC、串行控制台)查看安装进度。
|
||||
> <br />即使安装过程出错,也能通过 SSH 运行 `/trans.sh alpine` 安装到 Alpine。
|
||||
|
||||
<details>
|
||||
@ -219,7 +219,7 @@ bash reinstall.sh dd --img "https://example.com/xxx.xz"
|
||||
- `--hold 2` DD 结束后不重启,此时可以 SSH 登录修改系统内容,Windows 系统会挂载在 `/os`,Linux 系统**不会**自动挂载
|
||||
|
||||
> [!TIP]
|
||||
> 可通过多种方式(SSH、HTTP 80 端口、后台 VNC、串行控制台)查看安装进度。
|
||||
> 可通过多种方式(SSH、HTTP 80 端口、商家后台 VNC、串行控制台)查看安装进度。
|
||||
> <br />即使安装过程出错,也能通过 SSH 运行 `/trans.sh alpine` 安装到 Alpine。
|
||||
|
||||
### 功能 3: 重启到 <img width="16" height="16" src="https://www.alpinelinux.org/alpine-logo.ico" /> Alpine Live OS(内存系统)
|
||||
@ -400,7 +400,7 @@ bash reinstall.sh windows \
|
||||
- AWS ([ENA 网卡][aws-ena], [NVME 存储控制器][aws-nvme])
|
||||
- GCP ([gVNIC 网卡][gcp-gvnic], [GGA 显卡][gcp-gga])
|
||||
- Azure ([MANA 网卡][azure-mana])
|
||||
- Intel ([VMD 存储控制器][intel-vmd], 网卡: [7][intel-nic-7-sha1], [8][intel-nic-8], [8.1][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-7-sha1], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
|
||||
- Intel ([VMD 存储控制器][intel-vmd], 网卡: [7][intel-nic-7-sha256], [8][intel-nic-8], [8.1][intel-nic-8.1], [10][intel-nic-10], [11][intel-nic-11], [2008 R2][intel-nic-7-sha256], [2012][intel-nic-2012], [2012 R2][intel-nic-2012-r2], [2016][intel-nic-2016], [2019][intel-nic-2019], [2022][intel-nic-2022], [2025][intel-nic-2025])
|
||||
|
||||
[virtio-virtio]: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
|
||||
[virtio-aliyun]: https://www.alibabacloud.com/help/ecs/user-guide/install-the-virtio-driver-1
|
||||
|
27
reinstall.sh
27
reinstall.sh
@ -52,7 +52,7 @@ Usage: $reinstall_____ anolis 7|8|23
|
||||
oracle 8|9
|
||||
almalinux 8|9
|
||||
centos 9|10
|
||||
fedora 40|41
|
||||
fedora 41|42
|
||||
nixos 24.11
|
||||
debian 9|10|11|12
|
||||
opensuse 15.6|tumbleweed
|
||||
@ -200,13 +200,25 @@ get_os_part() {
|
||||
awk '($2=="/") { print $1 }' /proc/mounts
|
||||
}
|
||||
|
||||
umount_all() {
|
||||
# windows defender 打开时,cygwin 运行 mount 很慢,但 cat /proc/mounts 很快
|
||||
if mount_lists=$(mount | grep -w "on $1" | awk '{print $3}' | grep .); then
|
||||
# alpine 没有 -R
|
||||
if umount --help 2>&1 | grep -wq -- '-R'; then
|
||||
umount -R "$1"
|
||||
else
|
||||
echo "$mount_lists" | tac | xargs -n1 umount
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
cp_to_btrfs_root() {
|
||||
mount_dir=$tmp/reinstall-btrfs-root
|
||||
if ! grep -q $mount_dir /proc/mounts; then
|
||||
mkdir -p $mount_dir
|
||||
mount "$(get_os_part)" $mount_dir -t btrfs -o subvol=/
|
||||
fi
|
||||
cp -rf "$@" $tmp/reinstall-btrfs-root
|
||||
cp -rf "$@" "$mount_dir"
|
||||
}
|
||||
|
||||
is_host_has_ipv4_and_ipv6() {
|
||||
@ -1584,8 +1596,8 @@ Continue with DD?
|
||||
rocky) ci_image=$ci_mirror/Rocky-$releasever-GenericCloud-Base.latest.$basearch.qcow2 ;;
|
||||
fedora)
|
||||
# 不加 / 会跳转到 https://dl.fedoraproject.org,纯 ipv6 无法访问
|
||||
# curl -L -6 https://d2lzkl7pfhq30w.cloudfront.net/pub/fedora/linux/releases/41/Cloud/x86_64/images
|
||||
# curl -L -6 https://d2lzkl7pfhq30w.cloudfront.net/pub/fedora/linux/releases/41/Cloud/x86_64/images/
|
||||
# curl -L -6 https://d2lzkl7pfhq30w.cloudfront.net/pub/fedora/linux/releases/42/Cloud/x86_64/images
|
||||
# curl -L -6 https://d2lzkl7pfhq30w.cloudfront.net/pub/fedora/linux/releases/42/Cloud/x86_64/images/
|
||||
filename=$(curl -L $ci_mirror/ | grep -oP "Fedora-Cloud-Base-Generic.*?.qcow2" |
|
||||
sort -uV | tail -1 | grep .)
|
||||
ci_image=$ci_mirror/$filename
|
||||
@ -1775,7 +1787,7 @@ verify_os_name() {
|
||||
'rocky 8|9' \
|
||||
'redhat 8|9' \
|
||||
'oracle 8|9' \
|
||||
'fedora 40|41' \
|
||||
'fedora 41|42' \
|
||||
'nixos 24.11' \
|
||||
'debian 9|10|11|12' \
|
||||
'opensuse 15.6|16.0|tumbleweed' \
|
||||
@ -2979,8 +2991,9 @@ mkdir_clear() {
|
||||
return
|
||||
fi
|
||||
|
||||
# alpine 没有 -R
|
||||
# { umount $dir || umount -R $dir || true; } 2>/dev/null
|
||||
# 再次运行时,有可能 mount 了 btrfs root,因此先要 umount_all
|
||||
# 但目前不需要 mount ,因此用不到
|
||||
# umount_all $dir
|
||||
rm -rf $dir
|
||||
mkdir -p $dir
|
||||
}
|
||||
|
6
trans.sh
6
trans.sh
@ -2030,6 +2030,8 @@ EOF
|
||||
cat -n net.cfg
|
||||
# 正常应该是 -D gentoo,但 alpine 的 cloud-init 包缺少 gentoo 配置
|
||||
cloud-init devel net-convert -p net.cfg -k yaml -d out -D alpine -O networkd
|
||||
|
||||
# 注意名字是 10-cloud-init-eth*.network,fix-eth-name.sh 会此文件名查找配置文件
|
||||
cp out/etc/systemd/network/10-cloud-init-eth*.network $os_dir/etc/systemd/network/
|
||||
|
||||
# 删除网卡名匹配
|
||||
@ -2359,7 +2361,7 @@ create_part() {
|
||||
|
||||
# 向下取整 MiB
|
||||
# gpt 最后 33 个扇区是备份分区表,不可用
|
||||
# parted 会忽略最后不足 1MiB 的部分
|
||||
# parted 结束位置填 100% 时也会忽略最后不足 1MiB 的部分,我们模仿它
|
||||
max_can_use_m=$((total_sector_count_except_backup_gpt * sector_size / 1024 / 1024))
|
||||
|
||||
echo "expect_m: $expect_m"
|
||||
@ -6726,6 +6728,8 @@ elif [ "$1" = "alpine" ]; then
|
||||
distro=alpine
|
||||
# 后面的步骤很多都会用到这个,例如分区布局
|
||||
cloud_image=0
|
||||
elif [ -n "$1" ]; then
|
||||
error_and_exit "unknown option $1"
|
||||
fi
|
||||
|
||||
# 无参数运行部分
|
||||
|
Loading…
x
Reference in New Issue
Block a user