Compare commits

..

4 Commits

Author SHA1 Message Date
259bcf7275 windows: 适配 massgrave 新镜像链接 2026-01-07 23:10:09 +08:00
90becc9850 docs: 更新文档 2026-01-07 21:34:18 +08:00
85e2661161 windows: 使用更准确的 intel nic 驱动链接 2026-01-07 21:34:18 +08:00
74d9524a9b fnos: 优化飞牛安装
- 支持 bios + gpt
- 支持 arm
2026-01-07 21:34:17 +08:00
2 changed files with 30 additions and 26 deletions

View File

@ -1146,7 +1146,9 @@ get_windows_iso_link_inner() {
regex=${regex// /_} regex=${regex// /_}
echo "looking for: $regex" >&2 echo "looking for: $regex" >&2
if iso=$(grep -Ei "^$regex " "$tmp/win.list" | get_shortest_line_by_field 1 | awk '{print $2}' | grep .); then if line=$(grep -Ei "^$regex " "$tmp/win.list" | get_shortest_line_by_field 1 | grep .) &&
iso=$(awk '{print $2}' <<<"$line" | grep .); then
echo "Selected: $line" >&2
return return
fi fi
done done

View File

@ -2431,7 +2431,7 @@ get_disk_logic_sector_size() {
} }
is_4kn() { is_4kn() {
[ "$(blockdev --getss "$1")" = 4096 ] [ "$(blockdev --getss "/dev/$xda")" = 4096 ]
} }
is_xda_gt_2t() { is_xda_gt_2t() {
@ -4367,12 +4367,6 @@ install_fnos() {
# 挂载 proc sys dev # 挂载 proc sys dev
mount_pseudo_fs /os mount_pseudo_fs /os
# 更新 initrd官方安装器也有这一步
# 理论上要设置 1777 权限,但飞牛官方安装器安装后不是
mkdir -p $os_dir/var/tmp
chmod 1777 $os_dir/var/tmp
chroot $os_dir update-initramfs -u
# 更改密码 # 更改密码
if is_need_set_ssh_keys; then if is_need_set_ssh_keys; then
set_ssh_keys_and_del_password $os_dir set_ssh_keys_and_del_password $os_dir
@ -4386,6 +4380,31 @@ install_fnos() {
chroot $os_dir systemctl enable ssh chroot $os_dir systemctl enable ssh
fi fi
# fstab
{
# /
uuid=$(lsblk /dev/$xda*2 -no UUID)
echo "$fstab_line_os" | sed "s/%s/$uuid/"
# swapfile
# 官方安装器即使 swapfile 设为 0 也会有这行
echo "$fstab_line_swapfile"
# /boot/efi
if is_efi; then
uuid=$(lsblk /dev/$xda*1 -no UUID)
echo "$fstab_line_efi" | sed "s/%s/$uuid/"
fi
} >$os_dir/etc/fstab
# 更新 initrd官方安装器也有这一步
# 理论上 /var/tmp 要设置 1777 权限,但飞牛官方安装器安装后不是
# 需要先创建 /etc/fstab ,否则会有以下警告
# W: Couldn't identify type of root file system for fsck hook
mkdir -p $os_dir/var/tmp
chmod 1777 $os_dir/var/tmp
chroot $os_dir update-initramfs -u
# grub # grub
if is_efi; then if is_efi; then
chroot $os_dir grub-install --efi-directory=/boot/efi chroot $os_dir grub-install --efi-directory=/boot/efi
@ -4404,23 +4423,6 @@ install_fnos() {
chroot $os_dir update-grub chroot $os_dir update-grub
# fstab
{
# /
uuid=$(lsblk /dev/$xda*2 -no UUID)
echo "$fstab_line_os" | sed "s/%s/$uuid/"
# swapfile
# 官方安装器即使 swapfile 设为 0 也会有这行
echo "$fstab_line_swapfile"
# /boot/efi
if is_efi; then
uuid=$(lsblk /dev/$xda*1 -no UUID)
echo "$fstab_line_efi" | sed "s/%s/$uuid/"
fi
} >$os_dir/etc/fstab
# 网卡配置 # 网卡配置
create_cloud_init_network_config /net.cfg create_cloud_init_network_config /net.cfg
create_network_manager_config /net.cfg $os_dir create_network_manager_config /net.cfg $os_dir
@ -6835,7 +6837,7 @@ EOF
# 4kn EFI 分区最少要 260M # 4kn EFI 分区最少要 260M
# https://learn.microsoft.com/windows-hardware/manufacture/desktop/hard-drives-and-partitions # https://learn.microsoft.com/windows-hardware/manufacture/desktop/hard-drives-and-partitions
if is_4kn /dev/$xda; then if is_4kn; then
sed -i 's/is4kn=0/is4kn=1/i' $startnet_cmd sed -i 's/is4kn=0/is4kn=1/i' $startnet_cmd
fi fi