fnos: 添加飞牛国际版

fixes #630
This commit is contained in:
bin456789
2026-06-09 23:08:15 +08:00
parent 70244c7f99
commit ade92af7ea
4 changed files with 41 additions and 17 deletions
+2 -1
View File
@@ -63,7 +63,7 @@ The system requirements for the target system are as follows:
| <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://aosc.io/distros/aosc-os.svg" /> AOSC OS | Rolling | 512 MB | 5 GB |
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> fnOS | 1 | 512 MB | 8 GB |
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> fnOS &nbsp;<img width="16" height="16" src="https://fygonas.com/favicon.ico" /> FygoOS | 1 | 512 MB | 8 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 |
@@ -163,6 +163,7 @@ bash reinstall.sh anolis 7|8|23
opencloudos 8|9|23
centos 9|10
fnos 1
fygoos 1
nixos 25.11
fedora 43|44
debian 9|10|11|12|13
+2 -1
View File
@@ -63,7 +63,7 @@
| <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://aosc.io/distros/aosc-os.svg" /> 安同 OS | 滚动 | 512 MB | 5 GB |
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> 飞牛 fnOS | 1 | 512 MB | 8 GB |
| <img width="16" height="16" src="https://www.fnnas.com/favicon.ico" /> 飞牛 fnOS &nbsp;<img width="16" height="16" src="https://fygonas.com/favicon.ico" /> FygoOS | 1 | 512 MB | 8 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 |
@@ -163,6 +163,7 @@ bash reinstall.sh anolis 7|8|23
opencloudos 8|9|23
centos 9|10
fnos 1
fygoos 1
nixos 25.11
fedora 43|44
debian 9|10|11|12|13
+22 -10
View File
@@ -83,6 +83,7 @@ Usage: $reinstall_____ anolis 7|8|23
almalinux 8|9|10
centos 9|10
fnos 1
fygoos 1
nixos 25.11
fedora 43|44
debian 9|10|11|12|13
@@ -1631,18 +1632,23 @@ Continue with DD?
done
if [ -z "$iso" ]; then
# 对于同一行有多个成功匹配,grep -m1 无效
iso=$(curl -L "https://fnnas.com/download$([ "$basearch" = aarch64 ] && echo -arm)" |
grep -o 'https://[^"]*\.iso' | head -1 | grep .)
if [ "$FLYGOOS" = 1 ]; then
iso=$(curl -L "https://fygonas.com/download" |
grep -o 'https://[^"]*\.iso' | head -1 | grep .)
else
# 对于同一行有多个成功匹配,grep -m1 无效
iso=$(curl -L "https://fnnas.com/download$([ "$basearch" = aarch64 ] && echo -arm)" |
grep -o 'https://[^"]*\.iso' | head -1 | grep .)
# curl 7.82.0+
# curl -L --json '{"url":"'$iso'"}' https://www.fnnas.com/api/download-sign
# curl 7.82.0+
# curl -L --json '{"url":"'$iso'"}' https://www.fnnas.com/api/download-sign
iso=$(curl -L \
-d '{"url":"'$iso'"}' \
-H 'Content-Type: application/json' \
https://www.fnnas.com/api/download-sign |
grep -o 'https://[^"]*')
iso=$(curl -L \
-d '{"url":"'$iso'"}' \
-H 'Content-Type: application/json' \
https://www.fnnas.com/api/download-sign |
grep -o 'https://[^"]*')
fi
fi
test_url "$iso" iso
@@ -1913,6 +1919,7 @@ verify_os_name() {
'rocky 8|9|10' \
'oracle 8|9|10' \
'fnos 1' \
'fygoos 1' \
'fedora 43|44' \
'nixos 25.11' \
'debian 9|10|11|12|13' \
@@ -1934,6 +1941,11 @@ verify_os_name() {
finalos=$(echo "$@" | to_lower | sed -n -E "s,^($ds)[ :-]?(|$vers_)$,\1 \2,p")
if [ -n "$finalos" ]; then
read -r distro releasever <<<"$finalos"
# fygoos to fnos
if [ "$distro" = fygoos ]; then
distro=fnos
FLYGOOS=1
fi
# 默认版本号
if [ -z "$releasever" ] && [ -n "$vers" ]; then
releasever=$(awk -F '|' '{print $NF}' <<<"|$vers")
+15 -5
View File
@@ -4872,7 +4872,7 @@ EOF
}
install_fnos() {
info "Install fnos"
info "Install fnos/fygoos"
os_dir=/os
# 官方安装调用流程
@@ -4925,7 +4925,7 @@ install_fnos() {
fi
# 复制系统
info "Extract fnos"
info "Extract fnos/fygoos"
apk add tar gzip pv
pv -f /os/installer/trimfs.tgz | tar zxp --numeric-owner --xattrs-include='*.*' -C /os
apk del tar gzip pv
@@ -4935,7 +4935,7 @@ install_fnos() {
# 缩小分区
if $NEED_SHRINK_FNOS_OS_PART; then
info "Shrink fnos os partition"
info "Shrink fnos/fygoos os partition"
# 取消挂载
if is_efi; then
@@ -5019,8 +5019,18 @@ install_fnos() {
fi
# grub 配置
# 取自 strings trim-install | grep GRUB_DISTRIBUTOR
sed -i 's/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR="FNOS"/' $os_dir/etc/default/grub
# strings trim-install | grep GRUB_DISTRIBUTOR
# 国内版得到的是 sed -i 's/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR="FNOS"/' /mnt/rootfs/etc/default/grub
# 国际版得到的是 sed -i 's/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR="%s"/' /mnt/rootfs/etc/default/grub
# 因此这里写死
if grep -Fq fygonas.com $os_dir/etc/apt/sources.list.d/trim_repo.list; then
name_for_grub=FygoOS
elif grep -Fq fnnas.com $os_dir/etc/apt/sources.list.d/trim_repo.list; then
name_for_grub=FNOS
else
error_and_exit 'Can not detect FNOS/FygoOS.'
fi
sed -i "s/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR=\"$name_for_grub\"/" $os_dir/etc/default/grub
# grub tty
ttys_cmdline=$(get_ttys console=)