Closed Sourabh1107 closed 2 years ago
What host system are you trying to build on? Are you trying to build gcc from scratch (the Buildroot default) or are you using a pre-built Bootlin toolchain (as suggested in the comments: https://github.com/cdsteinkuehler/br2rauc/blob/master/README.md?plain=1#L61-L64)?
Hello Charles,
I am using Buildroot toolchain and not Bootlin toolchain. My build system is docker desktop for windows with WSL2 backend.
Update:
By changing Toolchain to Bootlin Toolchain and using "aarch64 glibc stable 2020.08-1" I get below errors related to "libzlib":
(cd /root/raspcm4/sources/output/build/libzlib-1.2.11; rm -rf config.cache; ac_cv_lbl_unaligned_fail=yes ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_memcmp_working=yes ac_cv_have_decl_malloc=yes gl_cv_func_malloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes ac_cv_func_calloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes lt_cv_sys_lib_search_path_spec="" ac_cv_c_bigendian=no PATH="/root/raspcm4/sources/output/host/bin:/root/raspcm4/sources/output/host/sbin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" AR="/root/raspcm4/sources/output/host/bin/aarch64-linux-ar" AS="/root/raspcm4/sources/output/host/bin/aarch64-linux-as" LD="/root/raspcm4/sources/output/host/bin/aarch64-linux-ld" NM="/root/raspcm4/sources/output/host/bin/aarch64-linux-nm" CC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc" GCC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc" CPP="/root/raspcm4/sources/output/host/bin/aarch64-linux-cpp" CXX="/root/raspcm4/sources/output/host/bin/aarch64-linux-g++" FC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gfortran" F77="/root/raspcm4/sources/output/host/bin/aarch64-linux-gfortran" RANLIB="/root/raspcm4/sources/output/host/bin/aarch64-linux-ranlib" READELF="/root/raspcm4/sources/output/host/bin/aarch64-linux-readelf" STRIP="/root/raspcm4/sources/output/host/bin/aarch64-linux-strip" OBJCOPY="/root/raspcm4/sources/output/host/bin/aarch64-linux-objcopy" OBJDUMP="/root/raspcm4/sources/output/host/bin/aarch64-linux-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc" CXX_FOR_BUILD="/usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/root/raspcm4/sources/output/host/include" CFLAGS_FOR_BUILD="-O2 -I/root/raspcm4/sources/output/host/include" CXXFLAGS_FOR_BUILD="-O2 -I/root/raspcm4/sources/output/host/include" LDFLAGS_FOR_BUILD="-L/root/raspcm4/sources/output/host/lib -Wl,-rpath,/root/raspcm4/sources/output/host/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/root/raspcm4/sources/output/host/bin/aarch64-linux-as" DEFAULT_LINKER="/root/raspcm4/sources/output/host/bin/aarch64-linux-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1" CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1" LDFLAGS="" FCFLAGS=" -Os -g0" FFLAGS=" -Os -g0" PKG_CONFIG="/root/raspcm4/sources/output/host/bin/pkg-config" STAGING_DIR="/root/raspcm4/sources/output/host/aarch64-buildroot-linux-gnu/sysroot" INTLTOOL_PERL=/usr/bin/perl CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -fPIC" ./configure --shared --prefix=/usr )
Checking for shared library support...
Building shared library libz.so.1.2.11 with /root/raspcm4/sources/output/host/bin/aarch64-linux-gcc.
Checking for size_t... No.
Checking for long long... Yes.
Failed to find a pointer-size integer type.
** ./configure aborting.
make[1]: *** [package/pkg-generic.mk:285: /root/raspcm4/sources/output/build/libzlib-1.2.11/.stamp_configured] Error 1
make: *** [Makefile:23: _all] Error 2
I suggest trying to build outside of the Docker framework. I can verify builds succeed normally on a WSL2 Debian install (both Bullseye & Buster) as well as on a "traditional" Debian install (Stretch VM running on VMWare).
Hello Charles,
I made some progress. And now I am not facing any issue related to compiling libraries. Even rootfs images are built.
But there is an issue with post-image.sh
script. At the end of make
, I am getting below error:
Number of uids 4
root (0)
unknown (1000)
unknown (1001)
www-data (33)
Number of gids 4
root (0)
unknown (1000)
unknown (1001)
www-data (33)
>>> Executing post-image script /root/raspcm4/sources/br2rauc/board/raspberrypi/post-image.sh
/root/raspcm4/sources/br2rauc/board/raspberrypi/genimage.cfg:41: no such option 'partition-table-type'
make[1]: *** [Makefile:827: target-post-image] Error 1
make: *** [Makefile:23: _all] Error 2
There are no changes made to genimage.cfg
file.
Can you please let me know what could be the reason for it?
The partition-table-type option is valid for an hdimage entry in the genimage.cfg file: https://github.com/pengutronix/genimage/blob/master/README.rst
I will not be able to help you further if you do not provide details of your non-working environment. I detailed 3 different confirmed to work build environments in my previous comment. You have not indicated the changes you made to get past your library compiling issue or whether or not you have migrated to a non-Docker based build environment.
If you build in a conventional Debian Linux environment (either a "real" machine, virtual machine, or WSL2) you should have no issues. I have not run any builds in Docker containers and you are on your own (or ask the Buildroot list for help) if you are having problems when using Docker containers as a build machine.
I am sorry, I forgot to mention about non-working env. For now, I switched to VirtualBox VM with Ubuntu 20.04. I am on a Windows machine.
BTW, I could also solve the issue with Docker container by properly setting the PATH
variable in .bashrc
file. Now, build system is not using any x86_64
files in include path (or that's what I observed).
Now, the partition-table-type
error is happening in both VM and docker container.
Update
I found that partition-table-type
option is introduced in newer version of genimage
i.e., in version 15. But I have genimage version 14.
One option is to use gpt = true
and partition-type-uuid = "L"
instead of partition-type
in partition
section for older genimage versions.
I am glad you got it working. The genimage command should be built as part of the Buildroot host packages. I have been working with the 2022.02 release candidates for Buildroot, but they are tags and not (yet) a branch so the "getting started" directions still list the 2021.11.x branch. I believe I have built successfully with the partition-table-type option in genimage.cfg and Buildroot 2021.11.x, but I've been bouncing around between various working copies enough I'm not 100% positive.
Yes, I am using 2021.11.2 Buildroot.
Have you tried casync
feature of rauc? And also how about doing atomic delta updates using rauc? For example, doing updates to only appfs. Currently, rauc supports slot-skipping
wherein we can skip installing updates to rootfs and only update associated appfs. This reduces update time but not rauc bundle size. But in order to reduce bundle size it should contain appfs image and hash value of installed rootfs. Is it possible to implement this feature?
I have not tried the casync
feature of RAUC as it does not fit with my needs. The br2rauc images, however, should support all RAUC mechanisms including casync. The setup for a casync deployment is mostly on the upstream server end. You would need to convert a standard RAUC bundle into a casync bundle and deploy this to your server resource(s).
As for slot-skipping
, you can create separate rootfs and appfs partitions. To reduce the bundle size the way you imply I think you need to use something like casync. As far as I know, RAUC doesn't support an update mechanism where you simply include a hash in the bundle but do not have the actual content available via some mechanism (eg: casync, http, included directly in the bundle, etc). The entire purpose of this project is to make it easy to begin experimenting with these RAUC features without having to take a couple weeks to get the baseline pieces in place and building.
There is a known issue that given how the sdcard images are created, there is no rauc status available on the initial image. The rauc.status file does not get populated until you actually install a bundle using RAUC. Seeing if the status file can be 'primed' with the contents which were installed via the genimage tool is on the ToDo list: https://github.com/cdsteinkuehler/br2rauc/blob/master/README.md?plain=1#L399
Hello @cdsteinkuehler Thanks for the update. I will try casync and will update here.
I have one more doubt. I changed the config.txt file in board/raspberrypi/raspberrypicm4io_64
to include enable_uart=1
. I have a Pl2303TA USB to TTL Rs232 Module Converter Serial Cable Adapter and connected to pins 8 & 10 of IO board. But after running make
, the changes are not visible in /output/images/rpi-firmware
.
Should I do make clean
, before running make
?
There should be no need to run a full make clean
when changing config.txt, but you need to understand how Buildroot builds and copies it's pacakges. You need to look for the package that installs the config.txt file into the output directory and rebuild that package. The BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE setting which points to the config.txt file is part of the rpi-firmware package, so instead of rebuilding everything you should be able to simply:
make rpi-firmware-rebuild && make
As always, see the Buildroot documentation for details:
When in doubt, run a full rebuild after a make clean. If you have enabled ccache, this shouldn't take too much time or resources.
Hello @cdsteinkuehler make rpi-firmware-rebuild && make
worked for me. Thanks
I switched to Buildroot 2022 version and reverted the changes made to genimage.cfg I copied the SD card image to uSD and tried to boot from it.
I encountered some errors during boot:
MESS:00:00:03.959471:0: HDMI0:EDID error reading EDID block 0 attempt 1
MESS:00:00:03.968985:0: HDMI0:EDID error reading EDID block 0 attempt 2
.
.
MESS:00:00:05.351593:0: brfs: File read: /mfs/sd/overlays/vc4-kms-v3d.dtbo
MESS:00:00:05.360492:0: dterror: can't find symbol 'i2c2'
MESS:00:00:05.362770:0: Failed to resolve overlay 'vc4-kms-v3d'
.
.
[ 1.524926] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[ 1.524967] bcm2708_fb: probe of soc:fb failed with error -2
.
.
[ 1.630267] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
.
.
[ 4.558132] systemd[1]: Load Kernel Modules was skipped because all trigger condition checks failed.
.
.
[ 5.733114] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 5.743586] cfg80211: failed to load regulatory.db
.
.
[ OK ] Started 6.027921] bcmgenet fd580000.ethernet eth0: Link is Down
.
[ 6.165737] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.bin failed with error -2
.
.
[FAILED] Failed to start Rauc Update Service.
See 'systemctl status rauc.service' for details.
.
.
Welcome to Buildroot+RAUC
Default username:password is [user:<empty>]
Root login disabled, use sudo su -
eth0:
br2rauc login: [ 33.764413] cam-dummy-reg: disabling
[ 33.768030] cam1-reg: disabling
I tried to login with username=root. But the console is stuck here.
Can you please let me know what could be the issue here?
Thanks in advance.
P.S: I have a Raspberry Pi CM4 Lite.
Default username:password is [user:<empty>]
Login with username=user, there is no password
I am not able to type anything from console. Like my keyboard input is not being passed to console. Also tried by connecting keyboard to IO board, but still same situation. I am using MobaXterm tool for serial console and this USB to TTL Rs232 Module Converter Serial Cable Adapter. And 12V 1.2A power source for IO board. And console is stuck here:
Default username:password is [user:<empty>]
Root login disabled, use sudo su -
eth0:
br2rauc login: [ 33.764541] cam-dummy-reg: disabling
[ 33.768158] cam1-reg: disabling
There is no cam connected to IO board but it is complaining about cam1-reg: disabling
.
Your help will be much appreciated.
Thanks in advance
I have no issues when using the serial console. You might try seeing if you can break into the U-Boot shell to make sure your serial terminal is wired up correctly. If you can't get to the U-Boot console the problem is your serial terminal or wiring and not the OS. If you get a U-Boot shell but can't login to the Buildroot OS, something strange is going on.
I also see the cam
-reg: disabling.` message, so that is expected. There's probably a way to disable that I haven't figured out yet...pull requests welcome! :)
Hello @cdsteinkuehler you were right, it was the issue with serial cable. After replacing it, it's working fine. Below is the image from linux user-space and hopefully it looks fine with RAUC running on it.
Thank you for your help :-)
Hello Charles,
I came across your Buildroot + RAUC configuration and wanted to try it out. Even I have Raspberry Pi Compute Module 4. I did the exact steps given in https://github.com/cdsteinkuehler/br2rauc#getting-started. But I am facing many errors related to
libgcc
. Below are the some of the errors:Can you please let me know why am I getting these errors and how to resolve it?
Your help will be much appreciated.
Thanks in advance.