-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
system.sh
694 lines (609 loc) · 21.9 KB
/
system.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
#!/usr/bin/env bash
# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#
function setup_env() {
__ERRMSGS=()
__INFMSGS=()
# if no apt-get we need to fail
[[ -z "$(which apt-get)" ]] && fatalError "Unsupported OS - No apt-get command found"
test_chroot
get_platform
get_os_version
get_retropie_depends
conf_memory_vars
conf_binary_vars
conf_build_vars
if [[ -z "$__nodialog" ]]; then
__nodialog=0
fi
}
function test_chroot() {
# test if we are in a chroot
if [[ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]]; then
[[ -z "$QEMU_CPU" && -n "$__qemu_cpu" ]] && export QEMU_CPU=$__qemu_cpu
__chroot=1
# detect the usage of systemd-nspawn
elif [[ -n "$(systemd-detect-virt)" && "$(systemd-detect-virt)" == "systemd-nspawn" ]]; then
__chroot=1
else
__chroot=0
fi
}
function conf_memory_vars() {
__memory_total_kb=$(awk '/^MemTotal:/{print $2}' /proc/meminfo)
__memory_total=$(( __memory_total_kb / 1024 ))
if grep -q "^MemAvailable:" /proc/meminfo; then
__memory_avail_kb=$(awk '/^MemAvailable:/{print $2}' /proc/meminfo)
else
local mem_free=$(awk '/^MemFree:/{print $2}' /proc/meminfo)
local mem_cached=$(awk '/^Cached:/{print $2}' /proc/meminfo)
local mem_buffers=$(awk '/^Buffers:/{print $2}' /proc/meminfo)
__memory_avail_kb=$((mem_free + mem_cached + mem_buffers))
fi
__memory_avail=$(( __memory_avail_kb / 1024 ))
}
function conf_binary_vars() {
[[ -z "$__has_binaries" ]] && __has_binaries=0
# set location of binary downloads
__binary_host="files.retropie.org.uk"
__binary_base_url="https://$__binary_host/binaries"
__binary_path="$__os_codename/$__platform"
isPlatform "kms" && __binary_path+="/kms"
__binary_url="$__binary_base_url/$__binary_path"
__archive_url="https://files.retropie.org.uk/archives"
# set the gpg key used by RetroPie
__gpg_retropie_key="retropieproject@gmail.com"
# if __gpg_signing_key is not set, set to __gpg_retropie_key
[[ ! -v __gpg_signing_key ]] && __gpg_signing_key="$__gpg_retropie_key"
# if the RetroPie public key is not installed, install it.
if ! gpg --list-keys "$__gpg_retropie_key" &>/dev/null; then
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys DC9D77FF8208FFC51D8F50CCF1B030906A3B0D31
fi
}
function conf_build_vars() {
__gcc_version=$(gcc -dumpversion)
# extract only the major version
# gcc -dumpversion on GCC >= 7 seems to provide the major version but the documentation
# suggests this depends on how it's configured
__gcc_version="${__gcc_version%%.*}"
# calculate build concurrency based on cores and available memory
__jobs=1
local unit=512
isPlatform "64bit" && unit=$(($unit + 256))
if [[ "$(nproc)" -gt 1 ]]; then
local nproc="$(nproc)"
# max one thread per unit (MB) of ram
local max_jobs=$(($__memory_avail / $unit))
if [[ "$max_jobs" -gt 0 ]]; then
if [[ "$max_jobs" -lt "$nproc" ]]; then
__jobs="$max_jobs"
else
__jobs="$nproc"
fi
fi
fi
__default_makeflags="-j${__jobs}"
# set our default gcc optimisation level
if [[ -z "$__opt_flags" ]]; then
__opt_flags="$__default_opt_flags"
fi
# set default cpu flags
[[ -z "$__cpu_flags" ]] && __cpu_flags="$__default_cpu_flags"
# if default cxxflags is empty, use our default cflags
[[ -z "$__default_cxxflags" ]] && __default_cxxflags="$__default_cflags"
# add our cpu and optimisation flags
__default_cflags+=" $__cpu_flags $__opt_flags"
__default_cxxflags+=" $__cpu_flags $__opt_flags"
__default_asflags+=" $__cpu_flags"
# if not overridden by user, configure our compiler flags
[[ -z "$__cflags" ]] && __cflags="$__default_cflags"
[[ -z "$__cxxflags" ]] && __cxxflags="$__default_cxxflags"
[[ -z "$__asflags" ]] && __asflags="$__default_asflags"
[[ -z "$__makeflags" ]] && __makeflags="$__default_makeflags"
# workaround for GCC ABI incompatibility with threaded armv7+ C++ apps built
# on Raspbian's armv6 userland https://github.com/raspberrypi/firmware/issues/491
if [[ "$__os_id" == "Raspbian" ]] && compareVersions $__gcc_version lt 5; then
__cxxflags+=" -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"
fi
# export our compiler flags so all child processes can see them
export CFLAGS="$__cflags"
export CXXFLAGS="$__cxxflags"
export ASFLAGS="$__asflags"
export MAKEFLAGS="$__makeflags"
# if __use_ccache is set, then add ccache to PATH/MAKEFLAGS
if [[ "$__use_ccache" -eq 1 ]]; then
PATH="/usr/lib/ccache:$PATH"
MAKEFLAGS+=" PATH=$PATH"
fi
}
function get_os_version() {
# make sure lsb_release is installed
getDepends lsb-release
# get os distributor id, description, release number and codename
local os
# armbian uses a minimal shell script replacement for lsb_release with basic
# parameter parsing that requires the arguments split rather than using -sidrc
mapfile -t os < <(lsb_release -s -i -d -r -c)
__os_id="${os[0]}"
__os_desc="${os[1]}"
__os_release="${os[2]}"
__os_codename="${os[3]}"
local error=""
case "$__os_id" in
Raspbian|Debian|Bunsenlabs)
# get major version (8 instead of 8.0 etc)
__os_debian_ver="${__os_release%%.*}"
# Debian unstable is not officially supported though
if [[ "$__os_release" == "unstable" ]]; then
__os_debian_ver=14
fi
# we still allow Raspbian 8 (jessie) to work (We show an popup in the setup module)
if [[ "$__os_debian_ver" -lt 8 ]]; then
error="You need Raspbian/Debian Stretch or newer"
fi
# 64bit Raspberry Pi OS identifies as Debian, but functions (currently) as Raspbian
# we will check package sources and set to Raspbian
if isPlatform "aarch64" && apt-cache policy | grep -qE "archive.raspberrypi.(com|org)"; then
__os_id="Raspbian"
fi
# set a platform flag for osmc
if grep -q "ID=osmc" /etc/os-release; then
__platform_flags+=(osmc)
fi
# and for xbian
if grep -q "NAME=XBian" /etc/os-release; then
__platform_flags+=(xbian)
fi
# we provide binaries for RPI on Raspberry Pi OS 10/11
if isPlatform "rpi" && \
isPlatform "32bit" && \
[[ "$__os_debian_ver" -ge 10 && "$__os_debian_ver" -le 11 ]]; then
# only set __has_binaries if not already set
[[ -z "$__has_binaries" ]] && __has_binaries=1
fi
;;
Devuan)
if isPlatform "rpi"; then
error="We do not support Devuan on the Raspberry Pi. We recommend you use Raspbian to run RetroPie."
fi
# devuan lsb-release version numbers don't match jessie
case "$__os_codename" in
jessie)
__os_debian_ver="8"
;;
ascii)
__os_debian_ver="9"
;;
beowolf)
__os_debian_ver="10"
;;
ceres)
__os_debian_ver="11"
;;
esac
;;
LinuxMint|Linuxmint)
if [[ "$__os_desc" != LMDE* ]]; then
if compareVersions "$__os_release" lt 18; then
error="You need Linux Mint 18 or newer"
elif compareVersions "$__os_release" lt 19; then
__os_ubuntu_ver="16.04"
__os_debian_ver="8"
elif compareVersions "$__os_release" lt 20; then
__os_ubuntu_ver="18.04"
__os_debian_ver="10"
else
__os_ubuntu_ver="20.04"
__os_debian_ver="11"
fi
fi
if [[ "$__os_desc" == LMDE* ]]; then
if compareVersions "$__os_release" lt 4; then
error="You need Linux Mint Debian Edition 4 or newer"
elif compareVersions "$__os_release" lt 5; then
__os_debian_ver="10"
elif compareVersions "$__os_release" lt 6; then
__os_debian_ver="11"
else
__os_debian_ver="12"
fi
fi
;;
Ubuntu|[Nn]eon|Pop)
if compareVersions "$__os_release" lt 16.04; then
error="You need Ubuntu 16.04 or newer"
# although ubuntu 16.04/16.10 report as being based on stretch it is before some
# packages were changed - we map to version 8 to avoid issues (eg libpng-dev name)
elif compareVersions "$__os_release" le 16.10; then
__os_debian_ver="8"
elif compareVersions "$__os_release" lt 18.04; then
__os_debian_ver="9"
elif compareVersions "$__os_release" lt 20.04; then
__os_debian_ver="10"
elif compareVersions "$__os_release" lt 22.10; then
__os_debian_ver="11"
else
__os_debian_ver="12"
fi
__os_ubuntu_ver="$__os_release"
;;
Zorin)
if compareVersions "$__os_release" lt 14; then
error="You need Zorin OS 14 or newer"
elif compareVersions "$__os_release" lt 14; then
__os_debian_ver="8"
else
__os_debian_ver="9"
fi
__os_ubuntu_ver="$__os_release"
;;
Deepin)
if compareVersions "$__os_release" lt 15.5; then
error="You need Deepin OS 15.5 or newer"
fi
__os_debian_ver="9"
;;
[eE]lementary)
if compareVersions "$__os_release" lt 0.4; then
error="You need Elementary OS 0.4 or newer"
elif compareVersions "$__os_release" eq 0.4; then
__os_ubuntu_ver="16.04"
__os_debian_ver="8"
else
__os_ubuntu_ver="18.04"
__os_debian_ver="10"
fi
;;
Kali)
__os_debian_ver="12"
;;
*)
error="Unsupported OS"
;;
esac
[[ -n "$error" ]] && fatalError "$error\n\n$(lsb_release -idrc)"
# check for Armbian, which can be built on Debian/Ubuntu
if [[ -f /etc/armbian-release ]]; then
__platform_flags+=("armbian")
fi
# configure Raspberry Pi graphics stack
isPlatform "rpi" && get_rpi_video
}
function get_retropie_depends() {
local depends=(git subversion dialog curl gcc g++ build-essential unzip xmlstarlet python3-pyudev ca-certificates dirmngr)
# on RaspiOS, install an extra package for X11 support on Pi5
if isPlatform "rpi5" && [[ "$__os_id" == "Raspbian" ]]; then
depends+=(gldriver-test)
fi
[[ -n "$DISTCC_HOSTS" ]] && depends+=(distcc)
[[ "$__use_ccache" -eq 1 ]] && depends+=(ccache)
if ! getDepends "${depends[@]}"; then
fatalError "Unable to install packages required by $0 - ${md_ret_errors[@]}"
fi
# make sure we don't have xserver-xorg-legacy installed as it breaks launching x11 apps from ES
if ! isPlatform "x11" && hasPackage "xserver-xorg-legacy"; then
aptRemove xserver-xorg-legacy
fi
}
function get_rpi_video() {
local pkgconfig="/opt/vc/lib/pkgconfig"
if [[ -z "$__has_kms" ]]; then
if [[ "$__chroot" -eq 1 ]]; then
# in chroot, use kms by default for rpi4 or Debian 11 (bullseye) or newer
if isPlatform "rpi4" || [[ "$__os_debian_ver" -ge 11 ]]; then
__has_kms=1
fi
else
# detect driver via inserted module / platform driver setup
[[ -d "/sys/module/vc4" ]] && __has_kms=1
fi
fi
if [[ "$__has_kms" -eq 1 ]]; then
__platform_flags+=(mesa kms)
if ! isPlatform "aarm64" && [[ -z "$__has_dispmanx" ]]; then
if [[ "$__chroot" -eq 1 ]]; then
# in a chroot default to fkms (supporting dispmanx) when debian is older than 11 (bullseye)
[[ "$__os_debian_ver" -lt 11 ]] && __has_dispmanx=1
else
# if running fkms driver, add dispmanx flag
[[ "$(ls -A /sys/bus/platform/drivers/vc4_firmware_kms/*.firmwarekms 2>/dev/null)" ]] && __has_dispmanx=1
fi
fi
[[ "$__has_dispmanx" -eq 1 ]] && __platform_flags+=(dispmanx)
else
__platform_flags+=(videocore)
if ! isPlatform "aarm64"; then
__platform_flags+=(dispmanx)
fi
fi
# delete legacy pkgconfig that conflicts with Mesa (may be installed via rpi-update)
# see: https://github.com/raspberrypi/userland/pull/585
rm -rf $pkgconfig/{egl.pc,glesv2.pc,vg.pc}
# set pkgconfig path for vendor libraries
export PKG_CONFIG_PATH="$pkgconfig"
}
function get_rpi_model() {
# calculated based on the information from https://github.com/AndrewFromMelbourne/raspberry_pi_revision
# see also https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes
local rev="0x$(sed -n '/^Revision/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo)"
# if bit 23 is not set, we are on a rpi1 (bit 23 means the revision is a bitfield)
if [[ $((($rev >> 23) & 1)) -eq 0 ]]; then
__platform="rpi1"
else
# if bit 23 is set, get the cpu from bits 12-15
local cpu=$((($rev >> 12) & 15))
case $cpu in
0)
__platform="rpi1"
;;
1)
__platform="rpi2"
;;
2)
__platform="rpi3"
;;
3)
__platform="rpi4"
;;
4)
__platform="rpi5"
;;
esac
fi
}
function get_platform() {
local architecture="$(uname --machine)"
if [[ -z "$__platform" ]]; then
case "$(sed -n '/^Hardware/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo)" in
BCM*)
# RPI kernels before 2023-11-24 print a 'Hardware: BCM2835' line
get_rpi_model
;;
*ODROIDC)
__platform="odroid-c1"
;;
*ODROID-C2)
__platform="odroid-c2"
;;
"Freescale i.MX6 Quad/DualLite (Device Tree)")
__platform="imx6"
;;
*ODROID-XU[34])
__platform="odroid-xu"
;;
"Rockchip (Device Tree)")
__platform="tinker"
;;
Vero4K|Vero4KPlus)
__platform="vero4k"
;;
"Allwinner sun8i Family")
__platform="armv7-mali"
;;
*)
# jetsons can be identified by device tree or soc0/family (depending on the L4T version used)
# refer to the nv.sh script in the L4T DTS for a similar implementation
if [[ -e "/proc/device-tree/compatible" ]]; then
case "$(tr -d '\0' < /proc/device-tree/compatible)" in
*raspberrypi*)
get_rpi_model
;;
*tegra186*)
__platform="tegra-x2"
;;
*tegra210*)
__platform="tegra-x1"
;;
*tegra194*)
__platform="xavier"
;;
*rockpro64*)
__platform="rockpro64"
;;
*imx6dl*)
__platform="imx6"
;;
*imx6q*)
__platform="imx6"
;;
*imx8mm*)
__platform="imx8mm"
;;
*rk3588*)
__platform="rk3588"
;;
esac
elif [[ -e "/sys/devices/soc0/family" ]]; then
case "$(tr -d '\0' < /sys/devices/soc0/family)" in
*tegra30*)
__platform="tegra-3"
;;
*tegra114*)
__platform="tegra-4"
;;
*tegra124*)
__platform="tegra-k1-32"
;;
*tegra132*)
__platform="tegra-k1-64"
;;
*tegra210*)
__platform="tegra-x1"
;;
esac
else
__platform="$architecture"
fi
;;
esac
fi
# check if we wish to target kms for platform
if [[ -z "$__has_kms" ]]; then
iniConfig " = " '"' "$configdir/all/retropie.cfg"
iniGet "force_kms"
[[ "$ini_value" == 1 ]] && __has_kms=1
[[ "$ini_value" == 0 ]] && __has_kms=0
fi
set_platform_defaults
# if we have a function for the platform, call it, otherwise use the default "native" one.
if fnExists "platform_${__platform}"; then
platform_${__platform}
else
platform_native
fi
}
function set_platform_defaults() {
__default_opt_flags="-O2"
# add platform name and 32bit/64bit to platform flags
__platform_flags=("$__platform" "$(getconf LONG_BIT)bit")
__platform_arch=$(uname -m)
}
function cpu_arm1176() {
__default_cpu_flags="-mcpu=arm1176jzf-s -mfpu=vfp"
__platform_flags+=(arm armv6)
__qemu_cpu=arm1176
}
function cpu_armv7() {
local cpu="$1"
if [[ -n "$cpu" ]]; then
__default_cpu_flags="-mcpu=$cpu -mfpu=neon-vfpv4"
else
__default_cpu_flags="-march=armv7-a -mfpu=neon-vfpv4"
cpu="cortex-a7"
fi
__platform_flags+=(arm armv7 neon)
__qemu_cpu="$cpu"
}
function cpu_armv8() {
local cpu="$1"
__default_cpu_flags="-mcpu=$cpu"
if isPlatform "32bit"; then
__default_cpu_flags+=" -mfpu=neon-fp-armv8"
__platform_flags+=(arm armv8 neon)
else
__platform_flags+=(aarch64)
fi
__qemu_cpu="$cpu"
}
function cpu_arm_state() {
if isPlatform "32bit"; then
__default_cpu_flags+=" -marm"
fi
}
function platform_conf_glext() {
# required for mali-fbdev headers to define GL functions
__default_cflags="-DGL_GLEXT_PROTOTYPES"
}
function platform_rpi1() {
cpu_arm1176
__platform_flags+=(rpi gles)
}
function platform_rpi2() {
cpu_armv7 "cortex-a7"
__platform_flags+=(rpi gles)
}
function platform_rockpro64() {
cpu_armv8 "cortex-a53"
__platform_flags+=(gles kms)
}
function platform_rpi3() {
cpu_armv8 "cortex-a53"
__platform_flags+=(rpi gles)
}
function platform_rpi4() {
cpu_armv8 "cortex-a72"
__platform_flags+=(rpi gles gles3 gles31)
}
function platform_rpi5() {
cpu_armv8 "cortex-a76"
__platform_flags+=(rpi gles gles3 gles31)
}
function platform_odroid-c1() {
cpu_armv7 "cortex-a5"
cpu_arm_state
__platform_flags+=(mali gles)
}
function platform_odroid-c2() {
cpu_armv8 "cortex-a72"
cpu_arm_state
__platform_flags+=(mali gles)
}
function platform_odroid-xu() {
cpu_armv7 "cortex-a7"
cpu_arm_state
platform_conf_glext
__platform_flags+=(mali gles)
}
function platform_tegra-x1() {
cpu_armv8 "cortex-a57+crypto"
__platform_flags+=(x11 gl vulkan)
}
function platform_tegra-x2() {
cpu_armv8 "cortex-a57+crypto"
__platform_flags+=(x11 gl vulkan)
}
function platform_xavier() {
cpu_armv8 "native"
__platform_flags+=(x11 gl vulkan)
}
function platform_tegra-3() {
cpu_armv7 "cortex-a9"
__platform_flags+=(x11 gles vulkan)
}
function platform_tegra-4() {
cpu_armv7 "cortex-a15"
__platform_flags+=(x11 gles vulkan)
}
function platform_tegra-k1-32() {
cpu_armv7 "cortex-a15"
__platform_flags+=(x11 gl vulkan)
}
function platform_tegra-k1-64() {
cpu_armv8 "native"
__platform_flags+=(x11 gl vulkan)
}
function platform_tinker() {
cpu_armv7 "cortex-a17"
cpu_arm_state
platform_conf_glext
__platform_flags+=(kms gles)
}
function platform_native() {
__default_cpu_flags="-march=native"
__platform_flags+=(gl vulkan)
if [[ "$__has_kms" -eq 1 ]]; then
__platform_flags+=(kms)
else
__platform_flags+=(x11)
fi
# add x86 platform flag for x86/x86_64 archictures.
[[ "$__platform_arch" =~ (i386|i686|x86_64) ]] && __platform_flags+=(x86)
}
function platform_armv7-mali() {
cpu_armv7
__platform_flags+=(mali gles)
}
function platform_imx6() {
cpu_armv7 "cortex-a9"
[[ -d /sys/class/drm/card0/device/driver/etnaviv ]] && __platform_flags+=(x11 gles mesa)
}
function platform_imx8mm() {
cpu_armv8 "cortex-a53"
__platform_flags+=(x11 gles)
[[ -d /sys/class/drm/card0/device/driver/etnaviv ]] && __platform_flags+=(mesa)
}
function platform_rk3588() {
cpu_armv8 "cortex-a76.cortex-a55"
__platform_flags+=(x11 gles gles3 gles32)
}
function platform_vero4k() {
cpu_armv7 "cortex-a7"
__default_cflags="-I/opt/vero3/include -L/opt/vero3/lib"
__platform_flags+=(mali gles)
}