Skip to content

Commit 893634a

Browse files
committed
Build virglrenderer and DirectFB2
1 parent 19bdea8 commit 893634a

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

configs/riscv-cross-file

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[binaries]
2+
c = 'riscv32-buildroot-linux-gnu-gcc'
3+
strip = 'riscv32-buildroot-linux-gnu-strip'
4+
pkgconfig = 'pkg-config'
5+
python = '/usr/bin/python3'
6+
7+
[properties]
8+
pkg_config_libdir = ['@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot/usr/local/lib/pkgconfig',
9+
'@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot/usr/share/pkgconfig/',
10+
'@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/'
11+
]
12+
sys_root = '@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot'
13+
14+
[host_machine]
15+
system = 'linux'
16+
cpu_family = 'riscv'
17+
cpu = 'riscv32-ima'
18+
endian = 'little'

scripts/build-image.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,58 @@ function do_buildroot
3838
function do_linux
3939
{
4040
ASSERT git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git -b linux-6.1.y --depth=1
41+
mkdir -p linux/out
4142
cp -f configs/linux.config linux/.config
4243
export PATH="$PWD/buildroot/output/host/bin:$PATH"
4344
export CROSS_COMPILE=riscv32-buildroot-linux-gnu-
4445
export ARCH=riscv
46+
export INSTALL_MOD_PATH="out"
4547
pushd linux
4648
ASSERT make olddefconfig
4749
ASSERT make $PARALLEL
50+
ASSERT make modules_install
4851
cp -f arch/riscv/boot/Image ../Image
4952
popd
5053
}
5154

55+
function do_directfb
56+
{
57+
export PATH=$PATH:$PWD/buildroot/output/host/bin
58+
export BUILDROOT_OUT=$PWD/buildroot/output/
59+
mkdir -p directfb
60+
61+
# Build DirectFB2
62+
ASSERT git clone https://github.com/directfb2/DirectFB2.git
63+
pushd DirectFB2
64+
cp ../configs/riscv-cross-file .
65+
ASSERT meson -Ddrmkms=true --cross-file riscv-cross-file build/riscv
66+
ASSERT meson compile -C build/riscv
67+
DESTDIR=$BUILDROOT_OUT/host/riscv32-buildroot-linux-gnu/sysroot meson install -C build/riscv
68+
DESTDIR=../../../directfb meson install -C build/riscv
69+
popd
70+
71+
# Build DirectFB2 examples
72+
ASSERT git clone https://github.com/directfb2/DirectFB-examples.git
73+
pushd DirectFB-examples/
74+
cp ../configs/riscv-cross-file .
75+
ASSERT meson --cross-file riscv-cross-file build/riscv
76+
ASSERT meson compile -C build/riscv
77+
DESTDIR=../../../directfb meson install -C build/riscv
78+
popd
79+
}
80+
81+
function do_virglrenderer
82+
{
83+
ASSERT git clone https://gitlab.freedesktop.org/virgl/virglrenderer.git
84+
pushd virglrenderer
85+
cp ../configs/riscv-cross-file .
86+
ASSERT meson --cross-file riscv-cross-file build/riscv
87+
ASSERT meson compile -C build/riscv
88+
DESTDIR=../../../virglrenderer_out meson install -C build/riscv
89+
popd
90+
}
91+
5292
do_buildroot && OK
5393
do_linux && OK
94+
do_virglrenderer && OK
95+
do_directfb && OK

0 commit comments

Comments
 (0)