diff --git a/README.en.md b/README.en.md index fea1853..bb4ffbd 100644 --- a/README.en.md +++ b/README.en.md @@ -63,7 +63,7 @@ The system requirements for the target system are as follows: | Arch | Rolling | 512 MB | 5 GB | | Gentoo | Rolling | 512 MB | 5 GB | | AOSC OS | Rolling | 512 MB | 5 GB | -| fnOS | 1 | 512 MB | 8 GB | +| fnOS   FygoOS | 1 | 512 MB | 8 GB | | Windows (DD) | Any | 512 MB | Depends on image | | Windows (ISO) | Vista, 7, 8.x (Server 2008 - 2012 R2) | 512 MB | 25 GB | | 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 diff --git a/README.md b/README.md index 1c63250..bd38a7c 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ | Arch | 滚动 | 512 MB | 5 GB | | Gentoo | 滚动 | 512 MB | 5 GB | | 安同 OS | 滚动 | 512 MB | 5 GB | -| 飞牛 fnOS | 1 | 512 MB | 8 GB | +| 飞牛 fnOS   FygoOS | 1 | 512 MB | 8 GB | | Windows (DD) | 任何 | 512 MB | 取决于镜像 | | Windows (ISO) | Vista, 7, 8.x (Server 2008 - 2012 R2) | 512 MB | 25 GB | | 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 diff --git a/reinstall.sh b/reinstall.sh index 2c02f54..bbcaeb3 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -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") diff --git a/trans.sh b/trans.sh index b5c8163..94a0fb1 100644 --- a/trans.sh +++ b/trans.sh @@ -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=)