mirror of
https://github.com/bin456789/reinstall.git
synced 2025-07-07 03:29:51 +00:00
Compare commits
3 Commits
0f147ed656
...
90ebc1b123
Author | SHA1 | Date | |
---|---|---|---|
![]() |
90ebc1b123 | ||
![]() |
9732c8557d | ||
![]() |
a686959012 |
@ -15,8 +15,8 @@ One-Click Script to Reinstall System [中文](README.md)
|
||||
|
||||
## Highlights
|
||||
|
||||
- One-click Linux installation: Supports 18 common distributions.
|
||||
- One-click Windows installation: Uses the official ISO for installation instead of custom images. The script automatically retrieves the ISO link and installs `Virtio` and other drivers.
|
||||
- One-click Linux installation: Supports 19 common distributions.
|
||||
- One-click Windows installation: Uses the official ISO for installation instead of custom images. The script can automatically ~~retrieves the ISO link~~ and installs common drivers like `Virtio`.
|
||||
- Supports installation in any direction, i.e., `Linux to Linux`, `Linux to Windows`, `Windows to Windows`, `Windows to Linux`
|
||||
- No need to input IP parameters; automatically recognizes dynamic and static IPs, supports `/32`, `/128`, `gateway outside subnet`, `IPv6 only`, `dual NIC` and other special network configurations
|
||||
- Specially optimized for low-spec servers, requires less memory than the official netboot
|
||||
@ -47,7 +47,8 @@ The system requirements for the target system are as follows:
|
||||
| <img width="16" height="16" src="https://github.com/user-attachments/assets/99a542b6-6482-4086-addf-f192c06fef73" /> NixOS | 24.11 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | Rolling | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | Rolling | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> 飞牛 fnOS | Beta | 512 MB | 12 GB |
|
||||
| <img width="16" height="16" src="https://aosc.io/assets/aosc.svg" /> AOSC | Rolling | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> fnOS | Beta | 512 MB | 12 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (DD) | Any | 512 MB | Depends on image |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | Vista, 7, 8.x (Server 2008 - 2012 R2) | 512 MB | 25 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | 10, 11 (Server 2016 - 2025) | 1 GB | 25 GB |
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
## 亮点
|
||||
|
||||
- 一键安装 Linux,支持 18 种常见发行版
|
||||
- 一键安装 Windows,使用官方 ISO 安装而非自制镜像,脚本会自动获取 ISO 链接、自动安装 Virtio 等驱动
|
||||
- 一键安装 Linux,支持 19 种常见发行版
|
||||
- 一键安装 Windows,使用官方 ISO 安装而非自制镜像,~~脚本会自动获取 ISO 链接~~、自动安装 Virtio 等常见驱动
|
||||
- 支持任意方向重装,即 `Linux to Linux`、`Linux to Windows`、`Windows to Windows`、`Windows to Linux`
|
||||
- 无需填写 IP 参数,自动识别动静态,支持 `/32`、`/128`、`网关不在子网范围内`、`纯 IPv6`、`双网卡` 等特殊网络
|
||||
- 专门适配低配小鸡,比官方 netboot 需要更少的内存
|
||||
@ -47,7 +47,8 @@
|
||||
| <img width="16" height="16" src="https://github.com/user-attachments/assets/99a542b6-6482-4086-addf-f192c06fef73" /> NixOS | 24.11 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://archlinux.org/static/favicon.png" /> Arch | 滚动 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.gentoo.org/assets/img/logo/gentoo-g.png" /> Gentoo | 滚动 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> 飞牛 fnOS | 公测版 | 512 MB | 12 GB |
|
||||
| <img width="16" height="16" src="https://aosc.io/assets/aosc.svg" /> 安同 AOSC | 滚动 | 512 MB | 5 GB |
|
||||
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> 飞牛 fnOS | 公测 | 512 MB | 12 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (DD) | 任何 | 512 MB | 取决于镜像 |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | Vista, 7, 8.x (Server 2008 - 2012 R2) | 512 MB | 25 GB |
|
||||
| <img width="16" height="16" src="https://blogs.windows.com/wp-content/uploads/prod/2022/09/cropped-Windows11IconTransparent512-32x32.png" /> Windows (ISO) | 10, 11 (Server 2016 - 2025) | 1 GB | 25 GB |
|
||||
@ -143,6 +144,7 @@ bash reinstall.sh anolis 7|8|23
|
||||
kali
|
||||
arch
|
||||
gentoo
|
||||
aosc
|
||||
fnos
|
||||
```
|
||||
|
||||
|
@ -22,6 +22,7 @@ ExecStart=/usr/bin/env bash /fix-eth-name.sh
|
||||
ExecStart=/usr/bin/env rm -f /fix-eth-name.sh
|
||||
ExecStart=/usr/bin/env rm -f /etc/systemd/system/fix-eth-name.service
|
||||
ExecStart=/usr/bin/env rm -f /etc/systemd/system/multi-user.target.wants/fix-eth-name.service
|
||||
ExecStart=/usr/bin/env rm -f /usr/lib/systemd/system-preset/01-fix-eth-name.preset
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -6,8 +6,8 @@ set confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
|
||||
set confhome_cn=https://gitlab.com/bin456789/reinstall/-/raw/main
|
||||
rem set confhome_cn=https://www.ghproxy.cc/https://raw.githubusercontent.com/bin456789/reinstall/main
|
||||
|
||||
set pkgs=curl,cpio,p7zip,ipcalc,dos2unix,jq,xz,gzip,zstd,openssl,bind-utils,libiconv,binutils
|
||||
set cmds=curl,cpio,p7zip,ipcalc,dos2unix,jq,xz,gzip,zstd,openssl,nslookup,iconv,ar
|
||||
set pkgs=curl,cpio,p7zip,dos2unix,jq,xz,gzip,zstd,openssl,bind-utils,libiconv,binutils
|
||||
set cmds=curl,cpio,p7zip,dos2unix,jq,xz,gzip,zstd,openssl,nslookup,iconv,ar
|
||||
|
||||
rem 65001 代码页会乱码
|
||||
|
||||
@ -202,7 +202,6 @@ exit /b 1
|
||||
set "cmds_space=%cmds:,= %"
|
||||
for %%c in (%cmds_space%) do (
|
||||
if not exist "%SystemDrive%\cygwin\bin\%%c" if not exist "%SystemDrive%\cygwin\bin\%%c.exe" (
|
||||
echo %%c not found.
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
41
reinstall.sh
41
reinstall.sh
@ -62,6 +62,7 @@ Usage: $reinstall_____ anolis 7|8|23
|
||||
kali
|
||||
arch
|
||||
gentoo
|
||||
aosc
|
||||
fnos
|
||||
dd --img="http://xxx.com/yyy.zzz" (raw image stores in raw/vhd/tar/gz/xz/zst)
|
||||
windows --image-name="windows xxx yyy" --lang=xx-yy
|
||||
@ -125,11 +126,24 @@ curl() {
|
||||
done
|
||||
}
|
||||
|
||||
mask2cidr() {
|
||||
local x=${1##*255.}
|
||||
set -- 0^^^128^192^224^240^248^252^254^ $(((${#1} - ${#x}) * 2)) ${x%%.*}
|
||||
x=${1%%"$3"*}
|
||||
echo $(($2 + (${#x} / 4)))
|
||||
}
|
||||
|
||||
is_in_china() {
|
||||
[ "$force_cn" = 1 ] && return 0
|
||||
|
||||
if [ -z "$_loc" ]; then
|
||||
# www.cloudflare.com/dash.cloudflare.com 国内访问的是美国服务器,而且部分地区被墙
|
||||
# 备用 www.bose.cn
|
||||
# 备用 www.qualcomm.cn
|
||||
# 备用 www.prologis.cn
|
||||
# 备用 www.garmin.com.cn
|
||||
# 备用 www.autodesk.com.cn
|
||||
# 备用 www.keysight.com.cn
|
||||
_loc=$(curl -L http://www.visa.cn/cdn-cgi/trace | grep '^loc=' | cut -d= -f2)
|
||||
if [ -z "$_loc" ]; then
|
||||
error_and_exit "Can not get location."
|
||||
@ -1474,11 +1488,27 @@ Continue with DD?
|
||||
fi
|
||||
done
|
||||
|
||||
iso=$(curl -L https://fnnas.com | grep -o 'https://[^"]*\.iso' | head -1)
|
||||
iso=$(curl -L https://fnnas.com/ | grep -o 'https://[^"]*\.iso' | head -1)
|
||||
test_url "$iso" 'iso'
|
||||
eval "${step}_iso='$iso'"
|
||||
}
|
||||
|
||||
setos_aosc() {
|
||||
if is_in_china; then
|
||||
mirror=https://mirror.nju.edu.cn/anthon/aosc-os
|
||||
else
|
||||
# 服务器在香港
|
||||
mirror=https://releases.aosc.io
|
||||
fi
|
||||
|
||||
dir=os-$basearch_alt/base
|
||||
file=$(curl -L $mirror/$dir/ | grep -oP 'aosc-os_base_.*?\.tar.xz' |
|
||||
sort -uV | tail -1 | grep .)
|
||||
img=$mirror/$dir/$file
|
||||
test_url $img 'tar.xz'
|
||||
eval ${step}_img=$img
|
||||
}
|
||||
|
||||
setos_centos_almalinux_rocky_fedora() {
|
||||
# el 10 需要 x86-64-v3
|
||||
if [ "$basearch" = x86_64 ] &&
|
||||
@ -1719,6 +1749,7 @@ verify_os_name() {
|
||||
'kali' \
|
||||
'arch' \
|
||||
'gentoo' \
|
||||
'aosc' \
|
||||
'fnos' \
|
||||
'windows' \
|
||||
'dd' \
|
||||
@ -1976,7 +2007,7 @@ check_ram() {
|
||||
case "$distro" in
|
||||
netboot.xyz) echo 0 ;;
|
||||
alpine | debian | kali | dd) echo 256 ;;
|
||||
arch | gentoo | nixos | windows) echo 512 ;;
|
||||
arch | gentoo | aosc | nixos | windows) echo 512 ;;
|
||||
redhat | centos | almalinux | rocky | fedora | oracle | ubuntu | anolis | opencloudos | openeuler) echo 1024 ;;
|
||||
opensuse | fnos) echo -1 ;; # 没有安装模式
|
||||
esac
|
||||
@ -2362,7 +2393,9 @@ collect_netconf() {
|
||||
ip=${ips[i]}
|
||||
subnet=${subnets[i]}
|
||||
if [[ "$ip" = *.* ]]; then
|
||||
cidr=$(ipcalc -b "$ip/$subnet" | grep Netmask: | awk '{print $NF}')
|
||||
# ipcalc 依赖 perl,会使 cygwin 增加 ~50M
|
||||
# cidr=$(ipcalc -b "$ip/$subnet" | grep Netmask: | awk '{print $NF}')
|
||||
cidr=$(mask2cidr "$subnet")
|
||||
ipv4_addr="$ip/$cidr"
|
||||
ipv4_gateway="$gateway"
|
||||
ipv4_mac="$mac_addr"
|
||||
@ -3749,7 +3782,7 @@ mkdir_clear "$tmp"
|
||||
# 强制忽略/强制添加 --ci 参数
|
||||
# debian 不强制忽略 ci 留作测试
|
||||
case "$distro" in
|
||||
dd | windows | netboot.xyz | kali | alpine | arch | gentoo | nixos)
|
||||
dd | windows | netboot.xyz | kali | alpine | arch | gentoo | aosc | nixos | fnos)
|
||||
if is_use_cloud_image; then
|
||||
echo "ignored --ci"
|
||||
unset cloud_image
|
||||
|
144
trans.sh
144
trans.sh
@ -758,6 +758,12 @@ del_empty_lines() {
|
||||
sed '/^[[:space:]]*$/d'
|
||||
}
|
||||
|
||||
del_head_empty_lines_inplace() {
|
||||
# 从第一行直到找到 ^[:space:]
|
||||
# 这个区间内删除所有空行
|
||||
sed -i '1,/[^[:space:]]/ { /^[[:space:]]*$/d }' "$@"
|
||||
}
|
||||
|
||||
get_part_num_by_part() {
|
||||
dev_part=$1
|
||||
echo "$dev_part" | grep -o '[0-9]*' | tail -1
|
||||
@ -1651,6 +1657,12 @@ add_fix_eth_name_systemd_service() {
|
||||
download "$confhome/fix-eth-name.sh" "$os_dir/fix-eth-name.sh"
|
||||
download "$confhome/fix-eth-name.service" "$os_dir/etc/systemd/system/fix-eth-name.service"
|
||||
chroot "$os_dir" systemctl enable fix-eth-name
|
||||
|
||||
# aosc 首次开机会执行 preset-all
|
||||
# 因此需要设置 fix-eth-name 的 preset 状态
|
||||
# 不然首次开机 /etc/systemd/system/multi-user.target.wants/fix-eth-name.service 会被删除
|
||||
# 通常 /etc/systemd/system-preset/ 文件夹要新建,因此不放在这里
|
||||
echo 'enable fix-eth-name.service' >"$os_dir/usr/lib/systemd/system-preset/01-fix-eth-name.preset"
|
||||
}
|
||||
|
||||
basic_init() {
|
||||
@ -1706,9 +1718,16 @@ basic_init() {
|
||||
add_fix_eth_name_systemd_service $os_dir
|
||||
}
|
||||
|
||||
install_arch_gentoo() {
|
||||
install_arch_gentoo_aosc() {
|
||||
info "install $distro"
|
||||
|
||||
network_app=$(
|
||||
case "$distro" in
|
||||
arch | gentoo) echo systemd-networkd ;;
|
||||
aosc) echo network-manager ;;
|
||||
esac
|
||||
)
|
||||
|
||||
set_locale() {
|
||||
echo "C.UTF-8 UTF-8" >>$os_dir/etc/locale.gen
|
||||
chroot $os_dir locale-gen
|
||||
@ -1791,13 +1810,13 @@ EOF
|
||||
create_swap_if_ram_less_than 2048 $os_dir/swapfile
|
||||
|
||||
# 解压系统
|
||||
apk add tar xz
|
||||
apk add tar xz pv
|
||||
# shellcheck disable=SC2154
|
||||
download "$img" $os_dir/gentoo.tar.xz
|
||||
echo "Uncompressing Gentoo..."
|
||||
tar xpf $os_dir/gentoo.tar.xz -C $os_dir --xattrs-include='*.*' --numeric-owner
|
||||
pv -f $os_dir/gentoo.tar.xz | tar xpJ --numeric-owner --xattrs-include='*.*' -C $os_dir
|
||||
rm $os_dir/gentoo.tar.xz
|
||||
apk del tar xz
|
||||
apk del tar xz pv
|
||||
|
||||
# dns
|
||||
cp_resolv_conf $os_dir
|
||||
@ -1906,6 +1925,22 @@ EOF
|
||||
chroot $os_dir emerge sys-kernel/gentoo-kernel-bin
|
||||
}
|
||||
|
||||
install_aosc() {
|
||||
# 解压系统
|
||||
apk add wget tar xz
|
||||
wget "$img" -O- | tar xpJ --numeric-owner --xattrs-include='*.*' -C $os_dir
|
||||
apk del wget tar xz
|
||||
|
||||
# 添加 swap
|
||||
create_swap_if_ram_less_than 1024 $os_dir/swapfile
|
||||
|
||||
# 挂载伪文件系统
|
||||
mount_pseudo_fs $os_dir
|
||||
|
||||
# 生成 initramfs
|
||||
chroot $os_dir update-initramfs
|
||||
}
|
||||
|
||||
os_dir=/os
|
||||
|
||||
# 挂载分区
|
||||
@ -1927,8 +1962,54 @@ EOF
|
||||
chroot $os_dir systemd-firstboot --force --timezone=Asia/Shanghai
|
||||
# gentoo 不会自动创建 machine-id
|
||||
clear_machine_id $os_dir
|
||||
chroot $os_dir systemctl enable systemd-networkd
|
||||
chroot $os_dir systemctl enable systemd-resolved
|
||||
|
||||
# 网络配置
|
||||
case "$network_app" in
|
||||
systemd-networkd)
|
||||
chroot $os_dir systemctl enable systemd-networkd
|
||||
chroot $os_dir systemctl enable systemd-resolved
|
||||
|
||||
apk add cloud-init
|
||||
# 第二次运行会报错
|
||||
useradd systemd-network || true
|
||||
create_cloud_init_network_config net.cfg
|
||||
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
|
||||
cp out/etc/systemd/network/10-cloud-init-eth*.network $os_dir/etc/systemd/network/
|
||||
|
||||
# 删除网卡名匹配
|
||||
sed -i '/^Name=/d' $os_dir/etc/systemd/network/10-cloud-init-eth*.network
|
||||
|
||||
# 删除 Generated by cloud-init. Changes will be lost.
|
||||
# 并删除头部的空行
|
||||
sed -i '/^# Generated by cloud-init/d' $os_dir/etc/systemd/network/10-cloud-init-eth*.network
|
||||
del_head_empty_lines_inplace $os_dir/etc/systemd/network/10-cloud-init-eth*.network
|
||||
|
||||
# 清理
|
||||
rm -rf net.cfg out
|
||||
apk del cloud-init
|
||||
|
||||
# 显示网络配置
|
||||
cat -n $os_dir/etc/systemd/network/10-cloud-init-eth*.network
|
||||
;;
|
||||
network-manager)
|
||||
chroot $os_dir systemctl enable NetworkManager
|
||||
|
||||
# 可以直接用 alpine 的 cloud-init 生成 Network Manager 配置
|
||||
create_cloud_init_network_config /net.cfg
|
||||
create_network_manager_config /net.cfg "$os_dir"
|
||||
rm /net.cfg
|
||||
;;
|
||||
esac
|
||||
|
||||
# 修正网卡名
|
||||
add_fix_eth_name_systemd_service $os_dir
|
||||
|
||||
# arch gentoo 网络配置是用 alpine cloud-init 生成的
|
||||
# cloud-init 版本够新,因此无需修复 onlink 网关
|
||||
|
||||
# ssh
|
||||
chroot $os_dir systemctl enable sshd
|
||||
allow_root_password_login $os_dir
|
||||
if is_need_change_ssh_port; then
|
||||
@ -1938,29 +2019,6 @@ EOF
|
||||
# 修改密码
|
||||
change_root_password $os_dir
|
||||
|
||||
# 网络配置
|
||||
apk add cloud-init
|
||||
# 第二次运行会报错
|
||||
useradd systemd-network || true
|
||||
create_cloud_init_network_config net.cfg
|
||||
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
|
||||
cp out/etc/systemd/network/10-cloud-init-eth*.network $os_dir/etc/systemd/network/
|
||||
|
||||
# 清理
|
||||
rm -rf net.cfg out
|
||||
apk del cloud-init
|
||||
|
||||
# 删除网卡名匹配
|
||||
sed -i '/^Name=/d' $os_dir/etc/systemd/network/10-cloud-init-eth*.network
|
||||
|
||||
# 修正网卡名
|
||||
add_fix_eth_name_systemd_service $os_dir
|
||||
|
||||
# arch gentoo 网络配置是用 alpine cloud-init 生成的
|
||||
# cloud-init 版本够新,因此无需修复 onlink 网关
|
||||
|
||||
# ntp 用 systemd 自带的
|
||||
# TODO: vm agent + 随机数生成器
|
||||
|
||||
@ -1985,8 +2043,9 @@ EOF
|
||||
|
||||
# fstab
|
||||
# fstab 可不写 efi 条目, systemd automount 会自动挂载
|
||||
# fstab 头部有使用说明,因此用 >>
|
||||
apk add arch-install-scripts
|
||||
genfstab -U $os_dir | sed '/swap/d' >$os_dir/etc/fstab
|
||||
genfstab -U $os_dir | sed '/swap/d' >>$os_dir/etc/fstab
|
||||
apk del arch-install-scripts
|
||||
|
||||
# 删除 resolv.conf,不然 systemd-resolved 无法创建软链接
|
||||
@ -2307,7 +2366,8 @@ create_part() {
|
||||
mkfs.ext4 -F -L os /dev/$xda*1 #1 os
|
||||
mkfs.ext4 -F -L installer /dev/$xda*2 #2 installer
|
||||
fi
|
||||
elif [ "$distro" = alpine ] || [ "$distro" = arch ] || [ "$distro" = gentoo ] || [ "$distro" = nixos ]; then
|
||||
elif [ "$distro" = alpine ] || [ "$distro" = arch ] || [ "$distro" = gentoo ] ||
|
||||
[ "$distro" = nixos ] || [ "$distro" = aosc ]; then
|
||||
# alpine 本身关闭了 64bit ext4
|
||||
# https://gitlab.alpinelinux.org/alpine/alpine-conf/-/blob/3.18.1/setup-disk.in?ref_type=tags#L908
|
||||
# 而且 alpine 的 extlinux 不兼容 64bit ext4
|
||||
@ -2418,7 +2478,7 @@ create_part() {
|
||||
umount_pseudo_fs() {
|
||||
os_dir=$(realpath "$1")
|
||||
|
||||
dirs="/proc /sys /dev /run /sys/firmware/efi/efivars"
|
||||
dirs="/proc /sys /dev /run"
|
||||
regex=$(echo "$dirs" | sed 's, ,|,g')
|
||||
if mounts=$(mount | grep -Ew "on $os_dir($regex)" | awk '{print $3}' | tac); then
|
||||
for mount in $mounts; do
|
||||
@ -2921,7 +2981,17 @@ create_network_manager_config() {
|
||||
sed -i -e '/^may-fail=/d' -e 's/^method=dhcp/method=auto/' \
|
||||
/out/etc/NetworkManager/system-connections/cloud-init-eth*.nmconnection
|
||||
|
||||
cp /out/etc/NetworkManager/system-connections/cloud-init-eth*.nmconnection $os_dir/etc/NetworkManager/system-connections/
|
||||
# 删除 # Generated by cloud-init. Changes will be lost.
|
||||
# 删除 org.freedesktop.NetworkManager.origin=cloud-init
|
||||
# 并删除头部的空行
|
||||
sed -i \
|
||||
-e '/^# Generated by cloud-init/d' \
|
||||
-e '/^org\.freedesktop\.NetworkManager\.origin=cloud-init/d' \
|
||||
/out/etc/NetworkManager/system-connections/cloud-init-eth*.nmconnection
|
||||
del_head_empty_lines_inplace /out/etc/NetworkManager/system-connections/cloud-init-eth*.nmconnection
|
||||
|
||||
cp /out/etc/NetworkManager/system-connections/cloud-init-eth*.nmconnection \
|
||||
$os_dir/etc/NetworkManager/system-connections/
|
||||
|
||||
# 清理
|
||||
rm -rf /out
|
||||
@ -3806,7 +3876,7 @@ install_fnos() {
|
||||
# 复制系统
|
||||
info "Extract fnos"
|
||||
apk add tar gzip pv
|
||||
pv -f /iso/trimfs.tgz | tar zx -C /os --numeric-owner
|
||||
pv -f /iso/trimfs.tgz | tar zxp --numeric-owner --xattrs-include='*.*' -C /os
|
||||
apk del tar gzip pv
|
||||
|
||||
# 挂载 /os/boot/efi
|
||||
@ -5526,7 +5596,7 @@ install_windows() {
|
||||
|
||||
mkdir -p $drv/gce/$name
|
||||
link=$(grep -o "/pool/.*-google-compute-engine-driver-$name.*\.goo" /tmp/gce.json)
|
||||
wget $gce_repo$link -O- | tar -xzf- -C $drv/gce/$name
|
||||
wget $gce_repo$link -O- | tar xz -C $drv/gce/$name
|
||||
|
||||
# 没有 win6.0 文件夹
|
||||
# 但 inf 没限制
|
||||
@ -6087,9 +6157,9 @@ trans() {
|
||||
alpine)
|
||||
install_alpine
|
||||
;;
|
||||
arch | gentoo)
|
||||
arch | gentoo | aosc)
|
||||
create_part
|
||||
install_arch_gentoo
|
||||
install_arch_gentoo_aosc
|
||||
;;
|
||||
nixos)
|
||||
create_part
|
||||
|
Loading…
x
Reference in New Issue
Block a user