最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

RISC-V云測平臺:Compiling The Fedora Linux Kernel Natively on RISC-V

2023-08-08 18:36 作者:澎峰科技開啟算力時代  | 我要投稿


注釋:編譯Fedora,HS-2 64核RISC-V服務(wù)器比Ryzen5700x快兩倍!

--- 以下是blog 正文 ---

# Compiling The Fedora Linux Kernel Natively on RISC-V

## Fedora RISC-V Support

There is ongoing work to Fedora to support RISC-V hardware. As of right now the Fedora documentation officially only shows how to install the distribution on the SiFive HiFive Unleashed?

board. Although there is another board which is unofficially supported by Fedora. This board is the Sispeed LicheePi 4A which I have been planning on getting for Project Andre and Fedora development.


## Setting Up A Fedora Chroot Environment On The PerfXLab System

The PerfXLab RISC-V server is running Ubuntu 22.10, so getting a Fedora environment to compile the kernel in took a bit of tinkering. I knew I needed a container or a chroot environment to

be able to get into the appropriate build environment as not to run into any issues with the build or contaminate the host system.

I started out by looking for a pre-compiled RISC-V Fedora rootfs to use as my chroot environment. During my search I found a pre-built RISC-V raw image. This raw image was perfect! It was

essentially a premade rootfs originally designed for coincidentally the Licheepi 4A and T-Head variants!?

Once I downloaded the image to the PerXLab system I started mounting the raw image as a loopback device. One of the easiest ways to dissect a raw image is by doing this quick hack! I then

found the root partition (usually the largest partition) then mounted it, so I can work on chrooting into it.?

Once I got the partition mounted I started setting up the pre-requisites for a fully functioning chroot environment. I reffered to the trust Linux From Scratch book like I often do with

this type of work and started mounting the virtual kernel filesystems.?

```


# Just for ease of running the commands :)

LFS="/home/maxinehayes90/fedora_rv_mnt"

# Populate /dev

sudo mount -v --bind /dev $LFS/dev


# Mount virtual kernel filesystems

mount -v --bind /dev/pts $LFS/dev/pts

mount -vt proc proc $LFS/proc

mount -vt sysfs sysfs $LFS/sys

mount -vt tmpfs tmpfs $LFS/run

```

Now that /dev and the VKFS are mounted I could chroot into the Fedora rootfs by simply just running ```sudo chroot $LFS /bin/bash```. In the chroot I made sure to test if I had a network

connection by running a dnf search for a package. I got an error where dnf couldn't download the metadata, so I made sure to copy /etc/resolv.conf on the host to the chroot environment. I

then ran into the issue of not being able to copy it due to it being a symlink. Once I tracked down the symlink I saw that it was pointed to /run/systemd/resolve/stub-resolv.conf. I copied

this file into the chroot as /etc/resolv.conf. Success! Dnf was able to download the metadata!?


## Building The Fedora Kernel In The Chroot Environment

For Fedora there is a Koji that supplies RISC-V package builds. I went to the Koji hosted at http://fedora.riscv.rocks/koji/ and downloaded the kernel source RPM into the chroot using wget.

To build the kernel source I initially installed mock and looked for a RISC-V config. I unfortunately didn't find one it in /etc/mock. After finding that out I went with plan b by using rpmbuild.?

To build the source code with rpmbuild I first had to install the dependencies that the specfile requires using ```dnf builddep SPECS/kernel.spec```. Once I did that I was set to build the kernel! I started the build using ```time rpmbuild -bb SPECS/kernel.spec``` then waited a few minutes to see if it would error which it did after about 7 minutes. So I tried a different

version of the kernel which had the same issue. After walking away for a while I relized what the error was. I ran out of disk space in the chroot!?

The root partition I mounted and chrooted into was only a few gigabytes in size and when building the kernel I had forgotten this detail. What I did to resolve the issue was to unmount all

of the virtual kernel filesystems and /dev. I then copied the mounted rootfs to a directory on the host. After that I remounted the VKFS then chrooted back in where I restarted the build.

Once I restarted the build I sat and waited again for about 20 minutes to see if I would run into another error. When I was sure there wouldn't be the possibility of an error I walked away

and came back the next day to find it build without any issues! To my surprise the build took 1 hour and 37 minutes to complete!


## Resources

Image used: https://openkoji.iscas.ac.cn/pub/dl/riscv/T-Head/th1520_light/images/fedora-disk-minimal_thead_th1520-f38-20230511-210358.n.0-sda.raw.xz

Fedora T-Head Documentation: https://fedoraproject.org/wiki/Architectures/RISC-V/T-Head

Linux From Scratch VKFS Page: https://www.linuxfromscratch.org/lfs/view/stable/chapter07/kernfs.html

PerfXLab (Thank you Paul Wang for giving me access to the RISC-V Server!): http://www.perfxlab.com/

  • About HS-2

HS-2 RISC-V通用主板是澎峰科技與合作伙伴共同研發(fā)的一款專為開發(fā)者設(shè)計的標(biāo)準(zhǔn)mATX主板,它預(yù)裝了澎峰科技為RISC-V高性能服務(wù)器定制開發(fā)的軟件包,包括各種標(biāo)準(zhǔn)bencmark、支持V擴展

的GCC編譯器、計算庫、中間件以及多種典型服務(wù)器應(yīng)用程序。

HS-2 RISC-V通用主板搭載了一顆國產(chǎn)RISC-V 64核處理器(SG2042)。SG2042是目前已量產(chǎn)的性能最高的RISC-V處理器,主要針對高性能計算領(lǐng)域需求設(shè)計,適用于科學(xué)計算、工程計算、AI計算、融合計算等大算力應(yīng)用場景。

  • 加入我們的RISC-V社區(qū)

1. 發(fā)郵件到 riscvinfo@perfxlab.com 進行申請

2. 加入微信討論群:加iYuta-R2為好友后可拉入群

3. 加入QQ討論群:906962594(RVBoards·Only RISC-V)

  • 關(guān)于RISC-V公共測試平臺

RISC-V高性能處理器公共測試云平臺 ·快速使用指南,下載鏈接:https://www.kdocs.cn/l/cmnYcyFIlVRx

  • "RISC-V成長日志"BLOG

這是第一個運行在RISC-V服務(wù)器上的正式BLOG,它記錄RISC-V社區(qū)的一些關(guān)于成長的動態(tài)。歡迎收藏!

htpp://blog.rvv.top:8002


  • RISC-V公共測試云平臺系列文章

  • 1.?RISC-V公測平臺發(fā)布 ·Stream帶寬完整測試

  • 2.?RISC-V公測平臺發(fā)布 · 我的世界MohistMC

  • 3.?RISC-V公測平臺發(fā)布 · 第一個WEB Server“Hello RISC-V world!”

  • 4.?RISC-V公測平臺發(fā)布 ·如何在SG2042上玩轉(zhuǎn)k3s

  • 5.?“RISC-V成長日記” blog發(fā)布,第一個運行在RISC-V服務(wù)器上的blog?

  • 6.?RISC-V公測平臺發(fā)布:如何在SG2042上玩轉(zhuǎn)OpenMPI

  • 7. RISC-V公測平臺發(fā)布:Compiling The Fedora Linux Kernel Natively on RISC-V(本篇)

    歡迎投稿,發(fā)送至riscvinfo@perfxlab.com

RISC-V云測平臺:Compiling The Fedora Linux Kernel Natively on RISC-V的評論 (共 條)

分享到微博請遵守國家法律
安阳市| 马关县| 长岛县| 西宁市| 荣昌县| 新密市| 华阴市| 襄樊市| 武城县| 平谷区| 合川市| 泸定县| 屯留县| 扶绥县| 宜君县| 胶南市| 沁阳市| 永平县| 南城县| 仁布县| 桑植县| 屏东市| 庆城县| 仪陇县| 吴忠市| 周口市| 罗山县| 宝丰县| 惠东县| 鹿邑县| 宜阳县| 蓬安县| 东平县| 横山县| 洛浦县| 林芝县| 顺义区| 铁岭市| 德安县| 尖扎县| 奎屯市|