Skip to content

Commit e0873cb

Browse files
kagura114RevySR
authored andcommitted
Add win-linux doc link, by-ua redir, mention uboot var may cause problem
1 parent c55278d commit e0873cb

File tree

7 files changed

+79
-15
lines changed

7 files changed

+79
-15
lines changed

docs/Installation/intro.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ RevyOS目前支持多个设备,以下表格是针对于每个设备的镜像
1010
## 刷写教程支持情况
1111

1212
import { DownloadLink } from "@site/src/components/ImageLinks";
13+
import { RedirectBasedOnUA } from "@site/src/components/RedirectBasedOnUA";
1314

1415
| 支持设备 | 镜像下载(最新版本) | 刷写教程 |
1516
| ----------------- | ----------|--------------------------------------------- |
16-
| Lichee Pi 4A | {<DownloadLink device="Lichee Pi 4A" />} | [镜像刷写](licheepi4a) |
17+
| Lichee Pi 4A | {<DownloadLink device="Lichee Pi 4A" />} | {<RedirectBasedOnUA windowsLink="./licheepi4a-windows" otherLink="./licheepi4a" description="镜像刷写" /> } |
1718
| Milk-V Meles | {<DownloadLink device="Milk-V Meles" />} | [Milk-V 官方镜像刷写教程](https://milkv.io/zh/docs/meles/installation) |
1819
| Milk-V Pioneer | {<DownloadLink device="Milk-V Pioneer" />} | [镜像刷写](milkv-pioneer) |
1920
| Lichee Cluster 4A | {<DownloadLink device="Lichee Cluster 4A" />} | 编写中 |

docs/Installation/licheepi4a-windows.mdx

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import { DownloadLink } from "@site/src/components/ImageLinks";
66

77
# LicheePi4A在Windows上的镜像刷写教程
88

9-
此页面是 LiCheePi 4A 镜像在 Windows 操作系统上的镜像刷写教程,如想在 Linux 系统上进行刷写请点击[LiCheePi4A镜像刷写教程](./licheepi4a.mdx),如想获取其他镜像刷写教程请从下面表格点击链接进行查看。
9+
此页面是 LicheePi4A 镜像刷写教程,适用于 Windows
1010

11-
| 支持设备 | |
11+
如想查看镜像刷写教程请从下面的表格中点击链接进行查看。
12+
13+
| 其他刷写教程 | 链接 |
1214
| ------- | -------------- |
13-
| Milk-V Pioneer | [刷写教程](milkv-pioneer.mdx) |
15+
| LicheePi4A (在 Linux 上刷写)| [Linux 刷写教程](./licheepi4a) |
16+
| Milk-V pioneer | [刷写教程](./milkv-pioneer) |
1417

1518
## 注意!
1619

docs/Installation/licheepi4a.mdx

+16-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import { DownloadLink } from "@site/src/components/ImageLinks";
66

77
# LicheePi4A镜像刷写教程
88

9-
此页面是 LicheePi4A 镜像刷写教程,如想获取其它镜像刷写教程请从下面的表格中点击链接进行查看。
9+
此页面是 LicheePi4A 镜像刷写教程,适用于 Linux
1010

11-
| 支持设备 | |
11+
如想查看镜像刷写教程请从下面的表格中点击链接进行查看。
12+
13+
| 其他刷写教程 | 链接 |
1214
| ------- | -------------- |
15+
| LicheePi4A (在 Windows 上刷写)| [Windows 刷写教程](./licheepi4a-windows) |
1316
| Milk-V pioneer | [刷写教程](./milkv-pioneer) |
1417

1518
## 注意!
@@ -437,12 +440,22 @@ boot,大小为 92886476 Bytes为例,可在 `cmd_parameter: boot, imagesize:
437440

438441
刷写完成后拔掉电脑与板卡连接的USB-Type-C线,接入电源线便可直接启动进入系统。
439442

440-
#### 可能出现的问题
443+
### 可能出现的问题
444+
445+
#### Linux only:卡在< waiting for any device >
441446

442447
如果 `lsusb` 中存在 download 设备,但`fastboot` 命令仍然卡在 `< waiting for any device >` ,可以尝试使用 `sudo` 运行 `fastboot` 命令。
443448

444449
![waiting](/img/image-for-flash/waiting.png)
445450

451+
#### 大版本升级后出现问题
452+
453+
如果 **使用串口进入 uboot** 并启动 fastboot 刷入(见[此处](#写入镜像到emmc接入串口)),可能是 uboot 保留了旧版本的环境变量导致了问题,请在串口的 uboot 控制台中输入
454+
```
455+
env default -a -f; env save; reset
456+
```
457+
如果有此版本有分区表变化,请额外运行:`run gpt_partition`
458+
446459
### 用户登录
447460

448461
下面是默认的系统账户以及密码

i18n/en/docusaurus-plugin-content-docs/current/Installation/intro.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ RevyOS currently supports multiple devices. The table below provides the status
99
## Installation Guide Availability
1010

1111
import { DownloadLink } from "@site/src/components/ImageLinks";
12+
import { RedirectBasedOnUA } from "@site/src/components/RedirectBasedOnUA";
1213

1314
| Supported Device | Image Download (Latest Version) | Installation Guide |
1415
| ------------------ | ---------------------------------------------------- | ---------------------------------------------- |
15-
| Lichee Pi 4A | {<DownloadLink device="Lichee Pi 4A" />} | [Installation Guide](licheepi4a) |
16+
| Lichee Pi 4A | {<DownloadLink device="Lichee Pi 4A" />} | {<RedirectBasedOnUA windowsLink="./licheepi4a-windows" otherLink="./licheepi4a" description="Installation Guide" /> } |
1617
| Milk-V Meles | {<DownloadLink device="Lichee Pi 4A" />} | [Official Milk-V Installation Guide](https://milkv.io/docs/meles/installation) |
1718
| Milk-V Pioneer | {<DownloadLink device="Milk-V Pioneer" />} | [Installation Guide](milkv-pioneer) |
1819
| Lichee Cluster 4A | {<DownloadLink device="Lichee Cluster 4A" />} | In Progress |

i18n/en/docusaurus-plugin-content-docs/current/Installation/licheepi4a-windows.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import { DownloadLink } from "@site/src/components/ImageLinks";
66

77
# Installing RevyOS on the LicheePi 4A (Windows)
88

9-
This page provides a tutorial for flashing the LicheePi 4A image on Windows operating systems. If you want to flash the image on a Linux system, please click [LicheePi4A Image Flashing Tutorial](./licheepi4a.mdx). For other image flashing tutorials, please click the links in the table below.
9+
This page provides a tutorial for flashing the LicheePi 4A image on Windows.
10+
If you want to flash the image on a Linux, or view other image flashing tutorials, please view the links in the table below.
1011

11-
| Supported Devices | |
12+
| Other Flashing Tutorial | Link |
1213
| ----------------- | -------------- |
14+
| LicheePi4A (Installing using Linux)| [Installation guilde for Linux](./licheepi4a) |
1315
| Milk-V Pioneer | [Flashing Tutorial](./milkv-pioneer.mdx) |
1416

1517
## Attention!

i18n/en/docusaurus-plugin-content-docs/current/Installation/licheepi4a.mdx

+22-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ import LocaleImage from "@site/src/components/LocaleImage";
88

99
# Installing RevyOS on the LicheePi 4A
1010

11-
This guide provides instructions for installing RevyOS on the LicheePi4A. For other device flashing guides, click the links in the table below.
11+
This page provides a tutorial for flashing the LicheePi 4A image on Linux.
12+
If you want to flash the image on a Windows, or view other image flashing tutorials, please view the links in the table below.
1213

13-
| Device Name | |
14-
| ------- | -------------- |
15-
| Milk-V pioneer | [Installation Guide](./milkv-pioneer) |
14+
| Other Flashing Tutorial | Link |
15+
| ----------------- | -------------- |
16+
| LicheePi4A (Installing using Windows)| [Installation guilde for Windows](./licheepi4a-windows) |
17+
| Milk-V Pioneer | [Flashing Tutorial](./milkv-pioneer.mdx) |
1618

1719
## Important!
1820

@@ -381,10 +383,25 @@ fastboot flash root root-lpi4a-20240720_171951.ext4
381383
Once flashing is complete, disconnect the USB-Type-C cable from the computer and the board, connect the power cable, and the system will boot up.
382384

383385

384-
#### Potential Issues
386+
### Potential Issues
387+
388+
#### Linux only: stuck at < waiting for any device >
385389

386390
If the `lsusb` output shows a download device but the `fastboot` command remains stuck at `< waiting for any device >`, try running the `fastboot` command with `sudo`.
387391

392+
#### Issues After Major Version Upgrade
393+
394+
If you **use a serial connection to enter U-Boot** and start fastboot flashing (see [here](#writing-the-image-to-emmc-with-serial-connection)), the issue might be caused by U-Boot retaining old environment variables. Please enter the following command in the U-Boot serial console:
395+
396+
```
397+
env default -a -f; env save; reset
398+
```
399+
400+
If this version includes partition table changes, additionally run:
401+
```
402+
run gpt_partition
403+
```
404+
388405
### User Login
389406

390407
- Login account: `debian`

src/components/RedirectBasedOnUA.tsx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
import { useEffect, useState } from "react";
3+
4+
interface RedirectProps {
5+
windowsLink: string;
6+
otherLink: string;
7+
description: string;
8+
}
9+
10+
/**
11+
* 根据用户的 User-Agent 选择合适的链接,并动态渲染 <a> 标签。
12+
* @param {string} windowsLink - Windows 用户的跳转链接
13+
* @param {string} otherLink - 其他系统用户的跳转链接
14+
* @param {string} description - 显示的文字
15+
* @returns a标签。
16+
*/
17+
export const RedirectBasedOnUA: React.FC<RedirectProps> = ({ windowsLink, otherLink, description }) => {
18+
const [targetLink, setTargetLink] = useState<string>("");
19+
20+
useEffect(() => {
21+
const userAgent = navigator.userAgent.toLowerCase();
22+
const isWindows = userAgent.includes("windows");
23+
setTargetLink(isWindows ? windowsLink : otherLink);
24+
}, [windowsLink, otherLink]);
25+
26+
return <a href={targetLink}>{description}</a>;
27+
};

0 commit comments

Comments
 (0)