This image version has passed internal testing, accesses ipv4\ipv6; accesses the network through direct connection or switch, router; supports real-time information, network diagnosis, and other network monitoring functions; and supports Passwall module. You can also install various plug-ins and configures Samba server, to meet your different development requirements.
The following instructions provide the user with the method to compile and install OpenWrt on VisionFive 2.
Installation
1. Download the code:
git clone https://git.openwrt.org/openwrt/staging/wigyori.git
Note: It is recommended to compile in Ubuntu system release 20 or above.
2. Execute the following command to enter wigyori directory:
cd wigyori/
3. Execute the following command to checkout the image:
git checkout riscv-jh71x0-202308b
Configuration
1. Execute the following command to enter the menu configuration GUI:
make menuconfig
In the menu configuration GUI, follow the steps to select the corresponding option:
a. In OpenWrt Configuration, select Target System and Target Profile:
→ Target System (StarFive JH71x0 (7100/7110))
→ Target Profile (StarFive VisionFive 2 v1.2a) or Target Profile (StarFive VisionFive 2 v1.3b)
Note: VisionFive 2 currently has 2 versions, v1.2a and v1.3b.
b. In OpenWrt Configuration, select Root filesystem archives under Target Image:
2. Luci configuration:
a. Execute the following command to install luci:
./scripts/feeds update packages luci
./scripts/feeds install -a -p luci
b. Execute the following command to enter the menu configuration GUI to configure luci:
make menuconfig
c. Select uhttpd in the configuration menu bar in the following order:
→ Network → Web Servers/Proxies → <*> uhttpd
d. Select luci in the configuration menu bar in the following order:
→ LuCI → 1. Collections → <*> luci
→ LuCI → 3. Applications → <> luci-app-ddns
<> luci-app-firewall
<> luci-app-ntpc
<> luci-app-samba4
<*> luci-app-uhttpd
→ LuCI → 4. Themes → Select all
3. Wireless Configuration
Due to the lack of WiFi modules on VisionFive 2, you need to purchase a WiFi Dongle. OpenWrt supports dozens of WiFi drivers, and the RTL8821AE PCI interface driver, which is easier to purchase, is chosen here. On VisionFive 2, there is an M.2 M-key interface, which needs to be connected to the NVME M.2 M-key to a/e key interface board to connect to the RTL8821AE module.
In the menu configuration GUI, follow the steps to configure wireless connection:
a. → Kernel modules → Wireless Driver → <> kmod-cfg80211
<> kmod-mac80211
<*> kmod-rtl8821ae
b. → Network → WirelessAPD → <> wpad-basic-mbedtls
<> hostapd-common
<> wpa-cli
<> hostapd-utils
4. Execute the following command to download the dependency packages:
./scripts/feeds update -a
./scripts/feeds install -a
make download V=s
Note: The download process may take a long time, please be patient. If a “download fail” error occurs during the process, it indicates that the software package has not been fully downloaded. Please execute the above command again until no “download fail” occurs.
5. Execute the following command to compile:
make -j8
Note: The compilation may take 2 hours.
6. Execute the following command to generate an SD card image:
bin/targets/jh71x0/generic
openwrt-jh71x0-generic-visionfive2-v1.3b-ext4-sdcard.img.gz
7. Unzip the SD card image:
gunzip openwrt-jh71x0-generic-visionfive2-v1.3b-ext4-sdcard.img.gz
8. Flash the image into the SD card:
dd if=openwrt-jh71x0-generic-visionfive2-v1.3b-ext4-sdcard.img of=/dev/sdX bs=1M
oflag=direct
Note:
-
For Windows, you can use balenaEtcher to flash the image.
-
Since the image does not include SPL and U-Boot, Nor Flash needs to have SPL and U-Boot flashed and should boot with QSPI Nor Flash.
-
Use the sudo fdisk –l command to find your device so that you can replace X value. For exmple, if your device is /dev/sdb, X should be b.
9. Open OpenWrt.
10. Add passwall function.
Follow the steps below to add the passwall function. The passwall function is not included in the default function and requires code modification and package download support.
a. Execute the following command under wigori directory:
echo "src-git passwall_packages
https://github.com/xiaorouji/openwrt-passwall-packages.git;main" >> "feeds.conf.default"
echo "src-git passwall https://github.com/xiaorouji/openwrt-passwall.git;main" >>
"feeds.conf.default"
b. Modify include/target.mk:
diff --git a/include/target.mk b/include/target.mk
index b5e3e7ff6f..f65e127ecf 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -53,7 +53,7 @@ DEFAULT_PACKAGES.nas:=\
mdadm
# For router targets
DEFAULT_PACKAGES.router:=\
- dnsmasq \
+ dnsmasq-full \
c. Download and install the package of passwall:
./scripts/feeds update -a
./scripts/feeds install -a
./scripts/feeds install -a -f -p PWpackages
./scripts/feeds install luci-app-passwall
d. Configure passwall and unconfigure dnsmasq:
make menuconfig
Configure passwall:
→ OpenWrt Configuration → LuCI → 3. Applications → <*> luci-app-passwall
Unconfigure dnsmasq:
→ OpenWrt Configuration → Base system → < >dnsmasq
→ OpenWrt Configuration → Base system → -*- dnsmasq-full
e. Execute the following command to update and download software package:
make download V=s
f. Compilation:
The same as step 5。