下载 osc 构建工具
sudo zypper in osc -y
添加 AUR 源,并且下载 osc 构建工具
yay -S osc-git obs-build-git
基于 python3 环境的源码构建
git clone https://github.com/openSUSE/osc.git
cd osc
chmod +x setup.py
./setup.py build
sudo ./setup.py install
在 ~/.bashrc
添加一行
alias osc="osc-wrapper.py"
git clone https://github.com/openSUSE/obs-build.git
cd obs-build
sudo make install
如何进行基础的 OBS 工程本地构建请参考:
需要先安装好 glibc-static
pcre-static
glib2-static
zlib-static
依赖包
git clone https://github.com/qemu/qemu.git
cd qemu
./configure \
--static \
--enable-attr \
--enable-tcg \
--enable-linux-user \
--target-list=riscv64-linux-user \
--without-default-devices \
--without-default-features \
--disable-install-blobs \
--disable-debug-info \
--disable-debug-tcg \
--disable-debug-mutex
make -j$(nproc)
sudo make install
sudo ./scripts/qemu-binfmt-conf.sh --persistent yes --credential yes --systemd riscv64
sudo systemctl restart systemd-binfmt
sudo apt install zstd systemd-container
osc build
命令添加 –-vm-type=nspawn
即可
osc build standard_riscv64 riscv64 --vm-type=nspawn
如果如下错误
[ 37s] [1/346] /.build/init_buildsystem: line 1032: perl: command not found
在项目 project config
中添加对应包即可,如: Preinstall: perl
- https://blog.jiejiss.com/Setup-an-Arch-Linux-RISC-V-Development-Environment/
- https://wiki.archlinux.org/title/Systemd-nspawn
- https://openeuler.riscv.club/wiki/tmp/qemu-static
- https://gitee.com/zxs-un/openEuler-port2riscv64/blob/master/doc/build-osc-config-oscrc.md
- https://gitee.com/openeuler/RISC-V/blob/master/doc/tutorials/workflow-for-build-a-package.md