how to compile Linux from the SDK ?
#1
There is a "BSP Linux SDK ver 4.19 for Quartz64 model A SBC"  here https://wiki.pine64.org/wiki/Quartz64#BSP_Linux_SDK

But it isn't obvious how to use it.

So I had a guess.  I want Linux for a Quartz64 model A.

First I run ./envsetup.sh and it asks me to pick a "combo" out of 0-91.
Code:
62. rockchip_rk3566

looks good to me. So I go for that.

Then I run ./build.sh

it asks me
Code:
You're building on Linux
Lunch menu...pick a combo:

0. default BoardConfig.mk
1. BoardConfig-rk3566-evb2-lp4x-v10.mk
2. BoardConfig-rk3568-evb1-ddr4-v10-spi-nor-64M.mk
3. BoardConfig-rk3568-evb1-ddr4-v10.mk
4. BoardConfig-rk3568-nvr-spi-nand.mk
5. BoardConfig-rk3568-nvr.mk
6. BoardConfig.mk
Which would you like? [0]:

Which one is a Quartz64 ?



Must be option 1 right? as it's the only option with RK3566

Code:
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:108: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:425: scripts/dtc] Error 2
make: *** [Makefile:491: scripts] Error 2
ERROR: Running build_uboot failed!
ERROR: exit code 2 from line 341:
    ./make.sh $RK_UBOOT_DEFCONFIG ${RK_TRUST_INI_CONFIG:+../rkbin/RKTRUST/$RK_TRUST_INI_CONFIG} ${RK_SPL_INI_CONFIG:+../rkbin/RKBOOT/$RK_SPL_INI_CONFIG} ${RK_UBOOT_SIZE_CONFIG:+--sz-uboot $RK_UBOOT_SIZE_CONFIG} ${RK_TRUST_SIZE_CONFIG:+--sz-trust $RK_TRUST_SIZE_CONFIG}

Sad

The same patch that I suggest here for Android https://wiki.pine64.org/wiki/Android_SDK_for_RK3566 seems to help with Linux too
  Reply
#2
Is there any reason why you're picking the BSP Linux? Mainline kernels are pretty far with regards to support at the moment.

Even if you want to use BSP Linux, I recommend you just use the BSP kernel from https://gitlab.com/pine64-org/quartz-bsp...hip-linux/

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#3
I really thought it was going to finish compiling, but then:-
Code:
2021-11-17T19:32:41 Scanning dependencies of target pseudo_valgrind
2021-11-17T19:32:41 [ 91%] Building CXX object Tests/CMakeLib/PseudoMemcheck/CMakeFiles/pseudo_valgrind.dir/ret0.cxx.o
2021-11-17T19:32:41 /data.ssd/philip/rk3566/manjaro/sdk/new_rk3566_linux/buildroot/output/rockchip_rk3566/build/host-cmake-3.8.2/Source/cmServerProtocol.cxx: In member function 'std::size_t std::hash<LanguageData>::operator()(const LanguageData&) const':
2021-11-17T19:32:41 /data.ssd/philip/rk3566/manjaro/sdk/new_rk3566_linux/buildroot/output/rockchip_rk3566/build/host-cmake-3.8.2/Source/cmServerProtocol.cxx:620:43: error: 'numeric_limits' is not a member of 'std'
2021-11-17T19:32:41 620 |                          (i.second ? std::numeric_limits<size_t>::max() : 0));
2021-11-17T19:32:41 |                                           ^~~~~~~~~~~~~~
2021-11-17T19:32:41 /data.ssd/philip/rk3566/manjaro/sdk/new_rk3566_linux/buildroot/output/rockchip_rk3566/build/host-cmake-3.8.2/Source/cmServerProtocol.cxx:620:64: error: expected primary-expression before '>' token
2021-11-17T19:32:41 620 |                          (i.second ? std::numeric_limits<size_t>::max() : 0));
2021-11-17T19:32:41 |                                                                ^
2021-11-17T19:32:41 /data.ssd/philip/rk3566/manjaro/sdk/new_rk3566_linux/buildroot/output/rockchip_rk3566/build/host-cmake-3.8.2/Source/cmServerProtocol.cxx:620:67: error: '::max' has not been declared; did you mean 'std::max'?
2021-11-17T19:32:41 620 |                          (i.second ? std::numeric_limits<size_t>::max() : 0));
2021-11-17T19:32:41 |                                                                   ^~~
2021-11-17T19:32:41 |                                                                   std::max
  Reply
#4
adding these two lines to buildroot/output/rockchip_rk3566/build/host-cmake-3.8.2/Source/cmServerProtocol.cxx seems to fix cmake:-
Code:
#include <stdexcept>
#include <limits>
  Reply
#5
(11-17-2021, 03:14 PM)CounterPillow Wrote: Is there any reason why you're picking the BSP Linux? Mainline kernels are pretty far with regards to support at the moment.

Even if you want to use BSP Linux, I recommend you just use the BSP kernel from https://gitlab.com/pine64-org/quartz-bsp...hip-linux/

BSP isn't my motive.

I have been able to modify an Armbian image from another device to boot on the quartz, and there are mara's excellent SLARM64 images, and the official Mandrake images as well (but none with the older 4.19 kernel, so no HDMI output).

However there is nothing that I can find that I can compile myself from source. I want working, compilable source code.

If anyone can help me to compile something for myself then I would be really helpful.

The boards are supposed to be "open source", but if all that you can run on them are images that other people have compiled and you can't compile it yourself, then is it really open source?
  Reply
#6
(11-19-2021, 06:17 AM)dieselnutjob Wrote: However there is nothing that I can find that I can compile myself from source. I want working, compilable source code.

Then use upstream linux 5.16-rc1 and your own userland (buildroot or whatever?) instead of these jank rockchip bsp source dumps with awful tooling.

You can for example see what pgwipeout's CI does: https://gitlab.com/pgwipeout/quartz64_ci...lab-ci.yml

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#7
(11-19-2021, 08:33 AM)CounterPillow Wrote: You can for example see what pgwipeout's CI does: https://gitlab.com/pgwipeout/quartz64_ci...lab-ci.yml

would you mind explaining what that is please?

I don't think it's the kernel that's the problem. I am struggling to get u-boot to compile in Armbian. Once that works as you say it would be pretty easy to swap in any kernel that we like.
  Reply
#8
For u-boot, you'll currently have to use downstream u-boot with some quartz specific patches, which you can find here: https://gitlab.com/pine64-org/quartz-bsp...e/quartz64

The CI I linked shows you how pgwipeout builds his u-boot for example in "u-boot-job", the lines in the "script" section of the yaml file are the shell commands that are run.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  irradium (based on crux linux) Quartz64 riscv64, aarch64 mara 4 1,113 11-20-2024, 10:45 AM
Last Post: mara
  SOQuartz Linux Builds stormwyrm 1 932 11-13-2023, 02:53 AM
Last Post: diederik
  Plebian Linux CounterPillow 8 4,712 07-19-2023, 08:51 AM
Last Post: CounterPillow
  Installing linux images emveepee 8 6,472 07-07-2022, 08:19 AM
Last Post: emveepee
  Mainline linux Mwo87 4 4,020 07-06-2022, 05:38 AM
Last Post: CounterPillow
  Debian Userland on top of existing Linux build? dieselnutjob 3 4,004 01-25-2022, 01:12 PM
Last Post: dieselnutjob
  Boot Linux on microSD card? dieselnutjob 2 3,967 10-01-2021, 05:15 PM
Last Post: dieselnutjob

Forum Jump:


Users browsing this thread: 1 Guest(s)