{"id":438,"date":"2023-08-08T21:38:44","date_gmt":"2023-08-08T16:08:44","guid":{"rendered":"https:\/\/hill9.org\/journal\/?p=438"},"modified":"2023-08-13T17:24:30","modified_gmt":"2023-08-13T11:54:30","slug":"risc-v-debian-ubuntu-and-fedora-linux-on-visionfive-2","status":"publish","type":"post","link":"https:\/\/hill9.org\/journal\/2023\/08\/08\/risc-v-debian-ubuntu-and-fedora-linux-on-visionfive-2\/","title":{"rendered":"RISC-V: Debian, Ubuntu and Fedora Linux on VisionFive 2"},"content":{"rendered":"\n<p>In this post, I will share how I brought up and ran three different RISC-V Linux distributions &#8211; Debian, Ubuntu and Fedora, on the<a href=\"https:\/\/hill9.org\/journal\/2023\/08\/01\/risc-v-unboxing-and-setting-up-visionfive-2-developer-board\/\" target=\"_blank\" rel=\"noopener\" title=\"\"> Starfive VisionFive 2 system I built earlier<\/a>. There is already plenty of documentation on running various linux distros on VF2. I will focus on specific tweaks I needed to do and other integration work like serial console which is critical for the purpose of my home lab &#8211; Linux kernel and open source firmware development. Also, if I am saying something that is too obvious in the embedded systems world or incorrect, my apologies. My past experience has been entirely on large servers and this is somewhat new territory for me.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JH7110 boot details<\/h2>\n\n\n\n<p><strong>Boot modes<\/strong><\/p>\n\n\n\n<p>JH7110 supports 4 boot modes &#8211; SPI Flash, SDIO3.0, eMMC and UART. Of these, I have tested SPI flash and SDIO3.0 boot. The first step towards bringing up the board is to set the boot mode to whatever device you want to boot from. The boot mode is selected using a 2-bit boot mode selection switch as described in <a href=\"https:\/\/doc-en.rvspace.org\/VisionFive2\/Quick_Start_Guide\/VisionFive2_SDK_QSG\/boot_mode_settings.html\" target=\"_blank\" rel=\"noopener\" title=\"\">this page<\/a>. At boot, the system executes BOOTROM code at 0x2A00_0000. Depending on the boot mode switch setting, the subsequent SW is loaded from the corresponding devices. At the time of writing this post, I have only tested booting from flash and booting from SDIO.<\/p>\n\n\n\n<p><strong>Booting from SPI flash<\/strong><\/p>\n\n\n\n<p>By default, SW shipped by Starfive uses u-boot ecosystem as SPL and bootloader. The SPI flash comes pre-loaded with a version of of u-boot SPL and bootloader. It can also later be flashed with update versions of its contents.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Offset<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Length<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Object<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Comments<\/strong><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x80000<\/td><td class=\"has-text-align-center\" data-align=\"center\">u-boot SPL<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xF0000<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x10000<\/td><td class=\"has-text-align-center\" data-align=\"center\">u-boot environment variables<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x100000<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x400000<\/td><td class=\"has-text-align-center\" data-align=\"center\">fw_payload.img (combined binary<br>of OpenSBI and U-boot core)<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x600000<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x1000000<\/td><td class=\"has-text-align-center\" data-align=\"center\">Reserved<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">SPI flash memory map<\/figcaption><\/figure>\n\n\n\n<p>The boot mode switch setting would look like the following :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"645\" src=\"https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_124742-1024x645.jpg\" alt=\"\" class=\"wp-image-471\" srcset=\"https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_124742-1024x645.jpg 1024w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_124742-300x189.jpg 300w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_124742-768x483.jpg 768w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_124742-1536x967.jpg 1536w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_124742-850x535.jpg 850w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_124742.jpg 1722w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In the picture above, RGPIO_0 and RGPIO_1 both are set to 0 which forces boot from flash.<\/p>\n\n\n\n<p><strong>Booting from SDIO<\/strong><\/p>\n\n\n\n<p>When booted via SDIO, the SD card is expected to have the bootloader and OS components in the following format :<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Offset<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Length<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Object<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>Comments<\/strong><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x200<\/td><td class=\"has-text-align-center\" data-align=\"center\">GPT PMBR<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x200<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x200<\/td><td class=\"has-text-align-center\" data-align=\"center\">GPT Header<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x400<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x1FFC00<\/td><td class=\"has-text-align-center\" data-align=\"center\">Reserved<\/td><td class=\"has-text-align-center\" data-align=\"center\"><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x200000<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x200000<\/td><td class=\"has-text-align-center\" data-align=\"center\">Reserved<\/td><td class=\"has-text-align-center\" data-align=\"center\">U-boot SPL <br>(partition 1)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x400000<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x400000<\/td><td class=\"has-text-align-center\" data-align=\"center\">Reserved<\/td><td class=\"has-text-align-center\" data-align=\"center\">fw_payload.img<br>(OpenSBI + U-boot core)<br>(partition 2)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x800000<\/td><td class=\"has-text-align-center\" data-align=\"center\">0x12400000<\/td><td class=\"has-text-align-center\" data-align=\"center\">initramfs + UEnv.txt<\/td><td class=\"has-text-align-center\" data-align=\"center\">Fat 16 with initrd, UEnv.txt<br>(partition 3)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0x12C00000<\/td><td class=\"has-text-align-center\" data-align=\"center\">End of disk<\/td><td class=\"has-text-align-center\" data-align=\"center\">System rootfs<\/td><td class=\"has-text-align-center\" data-align=\"center\">rootfs for Linux distro<br>(partition 4)<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">SD card memory map<\/figcaption><\/figure>\n\n\n\n<p>The boot mode setting would look like the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"789\" src=\"https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_130153-1024x789.jpg\" alt=\"\" class=\"wp-image-472\" srcset=\"https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_130153-1024x789.jpg 1024w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_130153-300x231.jpg 300w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_130153-768x592.jpg 768w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_130153-1536x1183.jpg 1536w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_130153-850x655.jpg 850w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/20230804_130153.jpg 2024w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In this case RGPIO_0 = 1 and RGPIO_1 = 0 which forces boot from SD card.<\/p>\n\n\n\n<p>A quick look at an SD card (<em>\/dev\/sdb<\/em> in my laptop) with the Starfive debian RISC-V image shows this :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan spl]$ sudo fdisk \/dev\/sdb\n[sudo] password for dipankar: \n\nWelcome to fdisk (util-linux 2.38.1).\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\nGPT PMBR size mismatch (5529599 != 249737215) will be corrected by write.\nThe backup GPT table is not on the end of the device. This problem will be corrected by write.\n\nCommand (m for help): p\n\nDisk \/dev\/sdb: 119.08 GiB, 127865454592 bytes, 249737216 sectors\nDisk model: Micro SD        \nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: gpt\nDisk identifier: E05DB137-41F7-47A6-B1C1-E9BE91A4BC0E\n\nDevice      Start     End Sectors  Size Type\n\/dev\/sdb1    4096    8191    4096    2M HiFive BBL\n\/dev\/sdb2    8192   16383    8192    4M HiFive FSBL\n\/dev\/sdb3   16384  221183  204800  100M EFI System\n\/dev\/sdb4  221184 5527518 5306335  2.5G Linux filesystem\n\nCommand (m for help):\n[dipankar@conan ~]$ df | grep sdb3\n\/dev\/sdb3         102156     22962     79194  23% \/run\/media\/dipankar\/4D59-21CE\n[dipankar@conan ~]$ cd \/run\/media\/dipankar\/4D59-21CE\/\n[dipankar@conan 4D59-21CE]$ ls\nconfig-5.15.0-starfive  initrd.img-5.15.0-starfive  vmlinuz-5.15.0-starfive\ndtbs                    System.map-5.15.0-starfive\nextlinux                uEnv.txt\n[dipankar@conan 4D59-21CE]$cat uEnv.txt \nfdt_high=0xffffffffffffffff\ninitrd_high=0xffffffffffffffff\nkernel_addr_r=0x44000000\nkernel_comp_addr_r=0x90000000\nkernel_comp_size=0x10000000\nfdt_addr_r=0x48000000\nramdisk_addr_r=0x48100000\n# Move distro to first boot to speed up booting\nboot_targets=distro mmc0 dhcp \n# Fix wrong fdtfile name\nfdtfile=starfive\/jh7110-visionfive-v2.dtb\n# Fix missing bootcmd\nbootcmd=run load_distro_uenv;run bootcmd_distro<\/pre>\n\n\n\n<p>In this example (sd card created from the Starfive official debian binary image), <em>sdb1<\/em> has U-boot SPL and <em>sdb2<\/em> has <em>fw_payload.img<\/em> (OpenSBI + U-boot). <em>sdb3<\/em> is the FAT16 filesystem with <em>initrd<\/em> and kernel. <em>sdb4<\/em> is the rootfs of the Linux distro.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Debian (from Starfive) RISC-V<\/h2>\n\n\n\n<p>Starfive provides pre-built debian images <a href=\"https:\/\/debian.starfivetech.com\/\" target=\"_blank\" rel=\"noopener\" title=\"\">here<\/a> that can be used to boot the VF2 board. In the build directory, you can find images (<em>starfive-jh7110-VF2-<var>&lt;Version&gt;<\/var>.img<\/em>) different types of devices &#8211; SD, EMMC, NVME etc. I use MicroSD card in the TF slot to boot the VF2 board. The flashing instructions are provided <a href=\"https:\/\/doc-en.rvspace.org\/VisionFive2\/Quick_Start_Guide\/VisionFive2_QSG\/flashing_with_mac_linux.html\" target=\"_blank\" rel=\"noopener\" title=\"\">here<\/a>. The flashing program balenoEther is distributed in appimage format and can be executed as is after downloaded to flash the debian image onto an SD card. When flashed, the pre-built image creates a disk with the format described in the <strong>Booting from SDIO<\/strong> section above. The boot mode switch setting should be set to &#8220;SDIO&#8221; mode (RGPIO_0 = 1, RGPIO_1 = 0) in this case. If set this way, u-boot SPL and other bootloader components will all be loaded from the SD card (rather than the SPI flash). This allows one to experiment with a custom SW stack without disturbing the SPI flash. It automatically comes with serial console enabled and you get both u-boot as well as Linux console prompts on serial console.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">U-Boot 2021.10-dirty (Jun 11 2023 - 07:44:44 +0000), Build: jenkins-VisionFive2-SDK-Components-135\n\nCPU:   rv64imacu_zba_zbb\nModel: StarFive VisionFive V2\nDRAM:  8 GiB\nMMC:   sdio0@16010000: 0, sdio1@16020000: 1\nLoading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB\n*** Warning - bad CRC, using default environment\n\nStarFive EEPROM format v2\n\n--------EEPROM INFO--------\nVendor : StarFive Technology Co., Ltd.\nProduct full SN: VF7110B1-2253-D008E000-00005257\ndata version: 0x2\nPCB revision: 0xb2\nBOM revision: A\nEthernet MAC0 address: 6c:cf:39:00:4c:6e\nEthernet MAC1 address: 6c:cf:39:00:4c:6f\n--------EEPROM INFO--------\n\nIn:    serial\nOut:   serial\nErr:   serial\nModel: StarFive VisionFive V2\nError: 1 bit\/pixel mode, but BMP has 24 bit\/pixel\nNet:   eth0: ethernet@16030000, eth1: ethernet@16040000\nbootmode sd device 1\/0\nHit any key to stop autoboot:  0 \nStarFive # boot\nFailed to load 'vf2_uEnv.txt'\nImporting environment from 1\/0 ...\n## Info: input data size = 482 = 0x1E2\n## Error: \"boot2\" not defined\n406 bytes read in 5 ms (79.1 KiB\/s)\n## Warning: defaulting to text format\n50235 bytes read in 9 ms (5.3 MiB\/s)\nlibfdt fdt_path_offset() returned FDT_ERR_NOTFOUND\nlibfdt fdt_path_offset() returned FDT_ERR_NOTFOUND\nlibfdt fdt_path_offset() returned FDT_ERR_NOTFOUND\nlibfdt fdt_path_offset() returned FDT_ERR_NOTFOUND\n50235 bytes written in 30 ms (1.6 MiB\/s)\nRetrieving file: \/extlinux\/extlinux.conf\n792 bytes read in 7 ms (110.4 KiB\/s)\nU-Boot menu\n1:\tDebian GNU\/Linux bookworm\/sid 5.15.0-starfive\n2:\tDebian GNU\/Linux bookworm\/sid 5.15.0-starfive (rescue target)\nEnter choice:  \n\n[Snipped]\n\n[  OK  ] Started LSB: My shell script.\n[  OK  ] Finished Load\/Save Random Seed.\n[  OK  ] Finished Remove Stale Onli\u2026ext4 Metadata Check Snapshots.\n[  OK  ] Started Disk Manager.\n[  OK  ] Started GNOME Display Manager.\n\nDebian GNU\/Linux bookworm\/sid starfive hvc0\n\nstarfive login: \nDebian GNU\/Linux bookworm\/sid starfive ttyS0\n\nstarfive login: \nstarfive login: \nDebian GNU\/Linux bookworm\/sid starfive ttyS0\n\nstarfive login: <\/pre>\n\n\n\n<p>More details on Debian on VF2 are <a href=\"https:\/\/doc-en.rvspace.org\/VisionFive2\/Quick_Start_Guide\/VisionFive2_QSG\/logging_into_the_os.html\" target=\"_blank\" rel=\"noopener\" title=\"\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ubuntu RISC-V<\/h2>\n\n\n\n<p>I followed these <a href=\"https:\/\/wiki.ubuntu.com\/RISC-V\/StarFive%20VisionFive%202\" target=\"_blank\" rel=\"noopener\" title=\"\">instructions to boot and run ubuntu RISC-V on VF2<\/a> first. The ubuntu SD image doesn&#8217;t have SPL and u-boot core firmware, so you have to boot from the SPI flash device by setting the boot mode switches accordingly.<\/p>\n\n\n\n<p>The first step is upgrading the flash to have the latest u-boot SPL and u-boot firmware. The official u-boot build provided in <a href=\"https:\/\/github.com\/starfive-tech\/VisionFive2\/releases\/\" target=\"_blank\" rel=\"noopener\" title=\"\">VisionFive2 Software 3.1.5<\/a> didn&#8217;t work for me, so I am using my own build of u-boot. The &#8220;<a href=\"https:\/\/doc-en.rvspace.org\/VisionFive2\/SWTRM\/VisionFive2_SW_TRM\/compiling_u-boot_and_kernel%20-%20vf2.html\" target=\"_blank\" rel=\"noopener\" title=\"\">Compiling U-boot and Kernel<\/a>&#8221; section of the VF2 guide has the detailed instructions on this. After compiling U-boot and OpenSBI, you also need to create the SPL image and FW payload using the following instructions :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/doc-en.rvspace.org\/VisionFive2\/SWTRM\/VisionFive2_SW_TRM\/create_spl.html\" target=\"_blank\" rel=\"noopener\" title=\"\">Creating SPL image<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/doc-en.rvspace.org\/VisionFive2\/SWTRM\/VisionFive2_SW_TRM\/create_fw_payload_file.html\" target=\"_blank\" rel=\"noopener\" title=\"\">Creating FW payload<\/a><\/li>\n<\/ol>\n\n\n\n<p>After that I followed <a href=\"https:\/\/doc-en.rvspace.org\/VisionFive2\/Quick_Start_Guide\/VisionFive2_SDK_QSG\/spl_new.html#updating_spl_and_u_boot-vf2__section_zpj_cqt_yvb\" target=\"_blank\" rel=\"noopener\" title=\"\">these instructions<\/a> for upgrading the SPL and U-boot in flash. I booted from a working SD card and used the <em>flashcp<\/em> command to flash the relevant files into the flash.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">root@rv-vf2-2:~\/firmware# apt install -y mtd-utils\nReading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\nThe following additional packages will be installed:\n  libiniparser1\nThe following NEW packages will be installed:\n  libiniparser1 mtd-utils\n0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.\nNeed to get 246 kB of archives.\nAfter this operation, 1144 kB of additional disk space will be used.\nGet:1 https:\/\/snapshot.debian.org\/archive\/debian-ports\/20221225T084846Z unstable\n\/main riscv64 libiniparser1 riscv64 4.1-6 [9396 B]\nGet:2 https:\/\/snapshot.debian.org\/archive\/debian-ports\/20221225T084846Z unstable\n\/main riscv64 mtd-utils riscv64 1:2.1.5-1 [236 kB]\nFetched 246 kB in 33s (7411 B\/s)  \nSelecting previously unselected package libiniparser1:riscv64.\n(Reading database ... 76913 files and directories currently installed.)\nPreparing to unpack ...\/libiniparser1_4.1-6_riscv64.deb ...\nUnpacking libiniparser1:riscv64 (4.1-6) ...\nSelecting previously unselected package mtd-utils.\nPreparing to unpack ...\/mtd-utils_1%3a2.1.5-1_riscv64.deb ...\nUnpacking mtd-utils (1:2.1.5-1) ...\nSetting up libiniparser1:riscv64 (4.1-6) ...\nSetting up mtd-utils (1:2.1.5-1) ...\nProcessing triggers for man-db (2.11.1-1) ...\nProcessing triggers for libc-bin (2.36-6) ...\n\nroot@rv-vf2-2:~\/firmware# cat \/proc\/mtd\ndev:    size   erasesize  name\nmtd0: 00040000 00001000 \"spl\"\nmtd1: 00300000 00001000 \"uboot\"\nmtd2: 00100000 00001000 \"data\"\nroot@rv-vf2-2:~\/firmware# flashcp -v u-boot-spl.bin.normal.out \/dev\/mtd0\nErasing blocks: 33\/33 (100%)\nWriting data: 129k\/129k (100%)\nVerifying data: 129k\/129k (100%)\nroot@rv-vf2-2:~\/firmware# flashcp -v visionfive2_fw_payload.img  \/dev\/mtd1\nErasing blocks: 722\/722 (100%)\nWriting data: 2887k\/2887k (100%)\nVerifying data: 2887k\/2887k (100%)\nroot@rv-vf2-2:~\/firmware# apt install -y mtd-utils\nReading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\nThe following additional packages will be installed:\n  libiniparser1\nThe following NEW packages will be installed:\n  libiniparser1 mtd-utils\n0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.\nNeed to get 246 kB of archives.\nAfter this operation, 1144 kB of additional disk space will be used.\nGet:1 https:\/\/snapshot.debian.org\/archive\/debian-ports\/20221225T084846Z unstable\n\/main riscv64 libiniparser1 riscv64 4.1-6 [9396 B]\nGet:2 https:\/\/snapshot.debian.org\/archive\/debian-ports\/20221225T084846Z unstable\n\/main riscv64 mtd-utils riscv64 1:2.1.5-1 [236 kB]\nFetched 246 kB in 33s (7411 B\/s)  \nSelecting previously unselected package libiniparser1:riscv64.\n(Reading database ... 76913 files and directories currently installed.)\nPreparing to unpack ...\/libiniparser1_4.1-6_riscv64.deb ...\nUnpacking libiniparser1:riscv64 (4.1-6) ...\nSelecting previously unselected package mtd-utils.\nPreparing to unpack ...\/mtd-utils_1%3a2.1.5-1_riscv64.deb ...\nUnpacking mtd-utils (1:2.1.5-1) ...\nSetting up libiniparser1:riscv64 (4.1-6) ...\nSetting up mtd-utils (1:2.1.5-1) ...\nProcessing triggers for man-db (2.11.1-1) ...\nProcessing triggers for libc-bin (2.36-6) ...\n\nroot@rv-vf2-2:~\/firmware# cat \/proc\/mtd\ndev:    size   erasesize  name\nmtd0: 00040000 00001000 \"spl\"\nmtd1: 00300000 00001000 \"uboot\"\nmtd2: 00100000 00001000 \"data\"\nroot@rv-vf2-2:~\/firmware# flashcp -v .\/u-boot-spl.bin.normal.out \/dev\/mtd0\nErasing blocks: 33\/33 (100%)\nWriting data: 129k\/129k (100%)\nVerifying data: 129k\/129k (100%)\nroot@rv-vf2-2:~\/firmware# flashcp -v .\/visionfive2_fw_payload.img \/dev\/mtd1\nErasing blocks: 722\/722 (100%)\nWriting data: 2885k\/2885k (100%)\nVerifying data: 2885k\/2885k (100%)<\/pre>\n\n\n\n<p>I tested the upgraded flash with a reboot (still running the Starfive debian image) to make sure that I had a sane board booting ubuntu.<\/p>\n\n\n\n<p>For burning the ubuntu RISC-V image on an SD card, used <a href=\"https:\/\/wiki.ubuntu.com\/RISC-V\/StarFive%20VisionFive%202\" target=\"_blank\" rel=\"noopener\" title=\"\">these instructions<\/a>. After that, I switched the boot mode to SPI flash (RGPIO_0 = 0, RGPIO_1 = 0), inserted the ubuntu SD card and booted.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"949\" height=\"480\" src=\"https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-06-15-41-27.png\" alt=\"\" class=\"wp-image-493\" srcset=\"https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-06-15-41-27.png 949w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-06-15-41-27-300x152.png 300w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-06-15-41-27-768x388.png 768w, https:\/\/hill9.org\/journal\/wp-content\/uploads\/2023\/08\/Screenshot-from-2023-08-06-15-41-27-850x430.png 850w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[   94.079443] cloud-init[1358]: Cloud-init v. 23.1.1-0ubuntu2 finished at Sun, 06 Aug 2023 10:14:00 +0000. Datasource DataSourceNoCloud [seed=\/var\/lib\/cloud\/seed\/nocloud-net][dsmode=net].  Up 94.05 seconds\n[  OK  ] Finished cloud-final.servi\u2026 Execute cloud user\/final scripts.\n[  OK  ] Reached target cloud-init.target - Cloud-init target.\n\nubuntu login: \nUbuntu Lunar Lobster (development branch) ubuntu ttyS0\n\nubuntu login: \n\nubuntu@ubuntu:~$ uname -a\nLinux ubuntu 6.2.0-19-generic #19.1-Ubuntu SMP Fri Mar 31 12:41:53 UTC 2023 riscv64 riscv64 riscv64 GNU\/Linux<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fedora RISC-V<\/h2>\n\n\n\n<p>Starfive has not officially released a fedora build for the VF2 board yet. However, <a href=\"https:\/\/forum.rvspace.org\/t\/fedora-37-on-the-visionfive-2-unofficial-build\/2108\" target=\"_blank\" rel=\"noopener\" title=\"\">RV Space forum mentions an unofficial Fedora 37 build<\/a>. Also Bas Opvolger describes booting fedora on his VF2 board in <a href=\"https:\/\/github.com\/Opvolger\/Opvolger\/blob\/master\/starfiveVisionFive2\/FedoraATIRadeon5450.md\" target=\"_blank\" rel=\"noopener\" title=\"\">this github page<\/a>. I roughly built on those experiences and found a path to boot fedora 37 on VF2. A number of approaches did not work &#8211; e.g. using the boot partition (ext4) from the unofficial Fedora 37 RISC-V image. Even though u-boot can read ext4 partitions and load from there, the default u-boot environment expects a vfat partition as boot partition. Also, the stock kernel that came with the fedora 37 unofficial build did not work. In this section, I describe the various steps I undertook to get Fedora 37 running on the VF2 board.<\/p>\n\n\n\n<p><strong>Boot mode and media<\/strong><\/p>\n\n\n\n<p>In order to keep things as close to an working distro, I am using SDIO mode for booting (RGPIO_0 = 1, RGPIO_1 = 0). This allows everything including u-boot spl and boot partition to be customized easily. To keep things simple, I started with an official Starfive debian SD card image and gradually converted it to boot a fedora root partition.<\/p>\n\n\n\n<p><strong>Prparing the SD card<\/strong><\/p>\n\n\n\n<p>By default the Starfive debian image uses a 105MB partition as the boot partition (partition 3). The debian root filesystem (partition 4) is also only 2.8GB. This will not likely work for Fedora, so I deleted these two partitions and created bigger versions of the same partitions with the same type : EFI System partition as \/boot (1GB) and Linux (ext4) partition as root filesystem (10GB).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan ~]$ sudo fdisk \/dev\/sdb\n[sudo] password for dipankar: \n\nWelcome to fdisk (util-linux 2.38.1).\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\n\nCommand (m for help): p\nDisk \/dev\/sdb: 59.48 GiB, 63864569856 bytes, 124735488 sectors\nDisk model: Micro SD        \nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: gpt\nDisk identifier: E05DB137-41F7-47A6-B1C1-E9BE91A4BC0E\n\nDevice       Start      End  Sectors Size Type\n\/dev\/sdb1     4096     8191     4096   2M HiFive BBL\n\/dev\/sdb2     8192    16383     8192   4M HiFive FSBL\n\/dev\/sdb3    16384  2113535  2097152   1G EFI System\n\/dev\/sdb4  2113536 23085055 20971520  10G Linux filesystem<\/pre>\n\n\n\n<p>To be on the safe side, I built updated u-boot and updated the SD card (with the official Starfive debian image) with the recently built firmware &#8211; U-boot SPL (partition 1) and U-boot bootloader (partition 2).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan spl]$ lsblk \/dev\/sdb\nNAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nsdb      8:16   1 59.5G  0 disk \n\u251c\u2500sdb1   8:17   1    2M  0 part \n\u251c\u2500sdb2   8:18   1    4M  0 part \n\u251c\u2500sdb3   8:19   1    1G  0 part \/run\/media\/dipankar\/__boot\n\u2514\u2500sdb4   8:20   1   10G  0 part \/run\/media\/dipankar\/__\n[dipankar@conan spl]sudo dd if=.\/u-boot-spl.bin.normal.out of=\/dev\/sdb1 conv=fsync\n[sudo] password for dipankar: \n258+1 records in\n258+1 records out\n132304 bytes (132 kB, 129 KiB) copied, 0.0220621 s, 6.0 MB\/s\n[dipankar@conan uboot_its]$ sudo dd if=visionfive2_fw_payload.img of=\/dev\/sdb2 conv=fsync\n5771+1 records in\n5771+1 records out\n2954837 bytes (3.0 MB, 2.8 MiB) copied, 0.297375 s, 9.9 MB\/s<\/pre>\n\n\n\n<p><strong>Boot partition<\/strong><\/p>\n\n\n\n<p>I updated the newly created 1GB boot partition (partition 3) by copying the contents of partition 3 in the Starfive debian image.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan fedora]$ sudo losetup -f -P starfive-jh7110-202306-SD-minimal-desktop.img\n[dipankar@conan dipankar]$ losetup -l\nNAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE                         DIO LOG-SEC\n\/dev\/loop1\n\t\t\t 0      0         0  0 \/home\/dipankar\/src2\/riscv\/lab\/vf2\/starfive\/202306\/starfive-jh7110-202306-SD-minimal-desktop.img\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   0     512\n\/dev\/loop0\n\t\t\t 0      0         0  0 \/home\/dipankar\/src2\/riscv\/lab\/vf2\/fedora\/Fedora-Developer-37-20221130.n.0-mmc.raw.img\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   0     512\n[dipankar@conan dipankar]$ sudo mkfs.fat \/dev\/sdb3\nmkfs.fat 4.2 (2021-01-31)\n[dipankar@conan dipankar]$ mkdir tmp\/vf2_boot tmp\/vf2_root\n[dipankar@conan ~]$ sudo mount \/dev\/sdb3 tmp\/vf2_boot\/\n[dipankar@conan ~]$ lsblk \/dev\/loop1\nNAME      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nloop1       7:1    0  2.6G  0 loop \n\u251c\u2500loop1p1 259:14   0    2M  0 part \n\u251c\u2500loop1p2 259:15   0    4M  0 part \n\u251c\u2500loop1p3 259:16   0  100M  0 part \/run\/media\/dipankar\/4D59-21CE\n\u2514\u2500loop1p4 259:17   0  2.5G  0 part \n[dipankar@conan ~]$ sudo cp -r \/run\/media\/dipankar\/4D59-21CE\/* tmp\/vf2_boot\/<\/pre>\n\n\n\n<p>At this point in time, the boot partition has the old debian boot content &#8211; <em>extlinux.conf, <\/em>kernel and initrd. Later I modify some of these to switch over to fedora.<\/p>\n\n\n\n<p><strong>root partition<\/strong><\/p>\n\n\n\n<p>For the root partition, <a href=\"https:\/\/dl.fedoraproject.org\/pub\/alt\/risc-v\/repo\/virt-builder-images\/images\/Fedora-Developer-37-20221130.n.0-mmc.raw.img.xz\" target=\"_blank\" rel=\"noopener\" title=\"\">I used this image provided by the unofficial fedora 37 build<\/a>. This is for mmc controller. If you are not booting from SD or eMMC, you need to choose an alternative image. I loop mounted the image and copied the root partition (partition 4) to the corresponding partition in the SD card.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan ~]$ lsblk \/dev\/loop0\nNAME      MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS\nloop0       7:0    0  10G  0 loop \n\u251c\u2500loop0p1 259:10   0   1M  0 part \n\u251c\u2500loop0p2 259:11   0   4M  0 part \n\u251c\u2500loop0p3 259:12   0   1G  0 part \n\u2514\u2500loop0p4 259:13   0   9G  0 part \n[dipankar@conan ~]$ sudo dd bs=1M if=\/dev\/loop0p4 of=\/dev\/sdb4 conv=fsync\n[sudo] password for dipankar: \n9210+1 records in\n9210+1 records out\n9658399232 bytes (9.7 GB, 9.0 GiB) copied, 359.509 s, 26.9 MB\/s<\/pre>\n\n\n\n<p>For the root partition to work, I made the following changes to it after mounting it :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Edit <em>\/etc\/fstab<\/em> in the root partition and change the UUIDs of the devices to be mounted to that of the boot and the root partitions.<\/li>\n\n\n\n<li>Edit \/etc\/yum.repos.d\/*.repo to disable all the existing repos and then edit \/etc\/yum.repos.d\/fedora.repo to point to the correct RISC-V fedora repository.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan linux]$ sudo blkid \/dev\/sdb4\n\/dev\/sdb4: LABEL=\"_\/\" UUID=\"d9334329-e2ad-4b72-8f5f-b61406e9d461\" BLOCK_SIZE=\"4096\" TYPE=\"ext4\" PARTUUID=\"bfa55429-3739-fa40-acd1-c6ab0e98263a\"\n[dipankar@conan linux]$ sudo blkid \/dev\/sdb3\n\/dev\/sdb3: UUID=\"342A-35CD\" BLOCK_SIZE=\"512\" TYPE=\"vfat\" PARTUUID=\"c935eac9-7dd1-e54c-8a94-c25147786ffd\"\n[dipankar@conan ~]cat tmp\/vf2_root\/etc\/fstab\nUUID=d9334329-e2ad-4b72-8f5f-b61406e9d461 \/ ext4    defaults,noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s 0 0\nUUID=342A-35CD \/boot vfat    defaults,noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s 0 0\n\n[dipankar@conan linux]$ sudo cat ~\/tmp\/vf2_root\/etc\/yum.repos.d\/fedora.repo\n[fedora]\nname=Fedora $releasever - $basearch\nbaseurl=https:\/\/dl.fedoraproject.org\/pub\/alt\/risc-v\/repo\/fedora\/37\/latest\/riscv64\/\n#metalink=https:\/\/mirrors.fedoraproject.org\/metalink?repo=fedora-$releasever&amp;arch=$basearch\nenabled=1\ncountme=1\nmetadata_expire=6h\nrepo_gpgcheck=0\ntype=rpm\ngpgcheck=1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-fedora-$releasever-$basearch\nskip_if_unavailable=False<\/pre>\n\n\n\n<p><strong>Building the kernel for VF2<\/strong><\/p>\n\n\n\n<p>The kernel shipping with the <a href=\"https:\/\/dl.fedoraproject.org\/pub\/alt\/risc-v\/repo\/virt-builder-images\/images\/Fedora-Developer-37-20221130.n.0-mmc.raw.img.xz\" target=\"_blank\" rel=\"noopener\" title=\"\">unofficial f37 build<\/a> did not work on the VF2 board. So, I built a fresh one from <a href=\"https:\/\/github.com\/starfive-tech\/linux\/tree\/JH7110_VisionFive2_510_devel\" target=\"_blank\" rel=\"noopener\" title=\"\">Starfive linux kernel github repository (JH7110_VisionFive2_devel branch)<\/a> and installed it locally in a directory in compressed format. Later I copy it to the boot filesystem.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan linux]$ make  ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- starfive_jh7110_defconfig\n[dipankar@conan linux]$ make -j 10 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- EXTRAVERSION=-vf2\n[dipankar@conan linux]$ make -j 10 EXTRAVERSION=-vf2 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- INSTALL_PATH=~\/src2\/riscv\/lab\/vf2\/starfive\/kernel zinstall <\/pre>\n\n\n\n<p>I chose the JH7110_VisionFive2_devel branch because that seemed to have recent code drops. The upstream branch seemed a bit dated.<\/p>\n\n\n\n<p><strong>Preparing the boot partition for booting<\/strong><\/p>\n\n\n\n<p>With a freshly built RISC-V kernel for VF2, I readied the boot partition with the following steps :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Copy the kernel over to the boot partition in the SD card.<\/li>\n\n\n\n<li>Modify <em>extlinux\/extlinux.conf<\/em> to define the boot menu for u-boot<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[dipankar@conan linux]$ sudo cp ..\/kernel\/* ~\/tmp\/vf2_boot\/\n[dipankar@conan linux]$ ls ~\/tmp\/vf2_boot\/\nconfig-5.15.0-starfive\ndtbs\nextlinux\ninitrd.img-5.15.0-starfive\nSystem.map-5.15.0-starfive\nSystem.map-5.15.0-vf2\nuEnv.txt\nvmlinuz-5.15.0-starfive\nvmlinuz-5.15.0-vf2\n[dipankar@conan linux]$ sudo cat ~\/tmp\/vf2_boot\/extlinux\/extlinux.conf\n# extlinux.conf generated by appliance-creator\ndefault l0\nmenu title U-Boot menu\nprompt 0\ntimeout 50\n\nlabel l0\n\t\tmenu label Fedora Linux 5.15.0-vf2\n\t\tlinux \/vmlinuz-5.15.0-vf2\n\t\tinitrd \/initrd.img-5.15.0-starfive\n\n\n\t\tfdtdir \/dtbs\n\t\tappend root=\/dev\/mmcblk1p4 rw rhgb quiet LANG=en_US.UTF-8 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0\n\nlabel l0r\n\t\tmenu label Fedora Linux 5.15.0-vf2 (rescue)\n\t\tlinux \/vmlinuz-5.15.0-vf2\n\t\tinitrd \/initrd.img-5.15.0-starfive\n\n\n\t\tfdtdir \/dtbs\n\t\tappend root=\/dev\/mmcblk1p4 rw rhgb quiet LANG=en_US.UTF-8 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 single<\/pre>\n\n\n\n<p>Note that I am still using the initrd shipped with the Starfive official debian distro image as well as the dtb files shipped with it. I edited the kernel command line to enable serial console on ttyS0.<\/p>\n\n\n\n<p>With these changes in place in the SD card, fedora 37 booted on my VF2 via that SD card. There are a number of errors in starting various services though, so there is work to be done to clean them up by either getting the kernel configuration right or code fixes in future. But since I am mostly interested in Linux (kernel) side of things in the home lab, this would do fine.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-vivid-green-cyan-color has-black-background-color has-text-color has-background\">[  OK  ] Reached target basic.target - Basic System.\n\t\t Starting avahi-daemon.serv\u2026e - Avahi mDNS\/DNS-SD Stack...\n\t\t Starting dkms.service \u2026new kernel modules through DKMS...\n[  OK  ] Started dnscrypt-proxy.ser\u2026Encrypted\/authenticated DNS proxy.\n\t\t Starting dracut-shutdown.s\u2026tore \/run\/initramfs on shutdown...\n\t\t Starting firewalld.service\u2026walld - dynamic firewall daemon...\n\t\t Starting flatpak-add-fedor\u2026Add Fedora flatpak repositories...\n\t\t Starting livesys.serviceB: Init script for live image....\n\t\t Starting power-profiles-da\u2026ice - Power Profiles daemon...\n\t\t Starting rtkit-daemon.serv\u2026meKit Scheduling Policy Service...\n\t\t Starting sshd-keygen@ecdsa\u2026SSH ecdsa Server Key Generation...\n\t\t Starting sshd-keygen@ed255\u2026H ed25519 Server Key Generation...\n\t\t Starting sshd-keygen@rsa.s\u2026enSSH rsa Server Key Generation...\n[  OK  ] Reached target nss-user-lo\u2026[0m - User and Group Name Lookups.\n\t\t Starting accounts-daemon.service - Accounts Service...\n\t\t Starting switcheroo-contro\u2026witcheroo Control Proxy service...\n\t\t Starting sysstat.service - Resets System Activity Logs...\n\t\t Starting systemd-logind.se\u2026ice - User Login Management...\n\t\t Starting systemd-machined.\u2026 Container Registration Service...\n\t\t Starting udisks2.service - Disk Manager...\n\t\t Starting upower.service - Daemon for power management...\n[  OK  ] Finished dracut-shutdown.s\u2026estore \/run\/initramfs on shutdown.\n\t\t Starting dbus-broker.servi\u2026 - D-Bus System Message Bus...\n[  OK  ] Finished sysstat.service - Resets System Activity Logs.\n[  OK  ] Finished sshd-keygen@ecdsa\u2026enSSH ecdsa Server Key Generation.\n[  OK  ] Finished sshd-keygen@ed255\u2026SSH ed25519 Server Key Generation.\n[  OK  ] Started dbus-broker.service - D-Bus System Message Bus.\n[  OK  ] Started systemd-machined.s\u2026nd Container Registration Service.\n[  OK  ] Started avahi-daemon.service - Avahi mDNS\/DNS-SD Stack.\n[  OK  ] Started systemd-logind.service - User Login Management.\n[  OK  ] Started rtkit-daemon.servi\u2026timeKit Scheduling Policy Service.\n[  OK  ] Started switcheroo-control\u2026 Switcheroo Control Proxy service.\n\t\t Starting polkit.service - Authorization Manager...\n[  OK  ] Started upower.service - Daemon for power management.\n[  OK  ] Finished dkms.service \u2026l new kernel modules through DKMS.\n[  OK  ] Finished flatpak-add-fedor\u2026- Add Fedora flatpak repositories.\n[  OK  ] Started polkit.service - Authorization Manager.\n[  OK  ] Started accounts-daemon.service - Accounts Service.\n[  OK  ] Started power-profiles-dae\u2026rvice - Power Profiles daemon.\n[  OK  ] Started udisks2.service - Disk Manager.\n[  OK  ] Started livesys.serviceSB: Init script for live image..\n\t\t Starting chronyd.service - NTP client\/server...\n[  OK  ] Started chronyd.service - NTP client\/server.\n[  OK  ] Started firewalld.servicerewalld - dynamic firewall daemon.\n[  OK  ] Reached target network-pre\u2026get - Preparation for Network.\n\t\t Starting NetworkManager.service - Network Manager...\n[  OK  ] Started NetworkManager.service - Network Manager.\n[  OK  ] Reached target network.target - Network.\n\t\t Starting NetworkManager-wa\u2026m - Network Manager Wait Online...\n\t\t Starting gssproxy.service - GSSAPI Proxy Daemon...\n\t\t Starting systemd-hostnamed.service - Hostname Service...\n[  OK  ] Started gssproxy.service - GSSAPI Proxy Daemon.\n[  OK  ] Reached target nfs-client.target - NFS client services.\n[  OK  ] Reached target remote-fs-p\u2026eparation for Remote File Systems.\n[  OK  ] Reached target remote-fs.target - Remote File Systems.\n\t\t Starting systemd-user-sess\u2026vice - Permit User Sessions...\n\t\t Starting virtqemud.service\u20260m - Virtualization qemu daemon...\n[  OK  ] Finished systemd-user-sess\u2026ervice - Permit User Sessions.\n\t\t Starting gdm.service - GNOME Display Manager...\n\t\t Starting plymouth-quit-wai\u2026 until boot process finishes up...\n[  OK  ] Started gdm.service - GNOME Display Manager.\n\nWelcome to the Fedora\/RISC-V disk image\nhttps:\/\/fedoraproject.org\/wiki\/Architectures\/RISC-V\n\nBuild date: Wed Nov 30 12:50:14 UTC 2022\n\nKernel 5.15.0-vf2 on an riscv64 (ttyS0)\n\nThe root password is 'fedora_rocks!'.\nroot password logins are disabled in SSH starting Fedora 31.\nUser 'riscv' with password 'fedora_rocks!' in 'wheel' group is provided.\n\nTo install new packages use 'dnf install ...'\n\nTo upgrade disk image use 'dnf upgrade --best'\n\nIf DNS isn\u2019t working, try editing \u2018\/etc\/yum.repos.d\/fedora-riscv.repo\u2019.\n\nFor updates and latest information read:\nhttps:\/\/fedoraproject.org\/wiki\/Architectures\/RISC-V\n\nFedora\/RISC-V\n--------------------\nKoji:               http:\/\/fedora.riscv.rocks\/koji\/\nSCM:                http:\/\/fedora.riscv.rocks:3000\/\nDistribution rep.:  http:\/\/fedora.riscv.rocks\/repos-dist\/\nKoji internal rep.: http:\/\/fedora.riscv.rocks\/repos\/\nfedora-riscv login: <\/pre>\n\n\n\n<p><strong>Further note<\/strong> : After I am done with some other experiments with the VF2 board, I will get back to Fedora on VF2 and see if I can clean up the booting and running.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I will share how I brought up and ran three different RISC-V Linux distributions &#8211; Debian, Ubuntu and Fedora, on the Starfive VisionFive 2 system I built earlier. There is already plenty of documentation on running various linux distros on VF2. I will focus on specific tweaks I needed to do and&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[6,8,3,5,4],"tags":[],"class_list":["post-438","post","type-post","status-publish","format-standard","hentry","category-homelab","category-kernel","category-linux","category-oss","category-riscv"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":86,"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/posts\/438\/revisions\/529"}],"wp:attachment":[{"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hill9.org\/journal\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}