New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for rpi0 #59
Added support for rpi0 #59
Conversation
Nice! How do you compile Mender? Is it the default one in the mender-convert container? Have you produced a build of Mender that runs on this device in the past? How did you do that? |
It was precompiled from docker container |
Check output of |
I just mounted rootfs and file mender produce:
compared to:
which looks same to me (except armhf version) |
Which Linux kernel version is on your Raspbian? Mender seems to be for 2.6, the other tool is 3.2. |
kernel is 4.14 |
Yeah the Linux kernel version mentioned in the Probably un-related but the file we create is not stipped. We should probably do that as part of the build to reduce the file size. |
Could you try re-building the container (mender-client) with the addition |
Tried with that :
but symptoms are same. IIRC when we developing with version where we need to put explicitly mender binary it was working fine. Need to check what is difference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase PR. Few commits have been merged in the meantime. It will affect e.g. renaming rpi3-convert-stage-3.sh
to simply convert-stage-3.sh
rpi-convert-stage-5.sh
Outdated
@@ -57,7 +57,12 @@ build_uboot_files() { | |||
git checkout $commit >> "$build_log" 2>&1 | |||
|
|||
make --quiet distclean >> "$build_log" | |||
make --quiet rpi_3_32b_defconfig >> "$build_log" 2>&1 | |||
if [ "$2" = "raspberrypi3" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add $2 to the list of arguments the function takes. Add separate variable for 'defconfig' (or name it as you wish) so that you can call make --quiet $defconfig
only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apodogrocki can be something like that:
local defconfig="rpi_3_32b_defconfig"
if [ "$2" = "raspberrypi0" ]; then
defconfig="rpi_0_w_defconfig"
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. Only remember about ==
for comparison.
rpi-convert-stage-5.sh
Outdated
@@ -118,12 +123,21 @@ install_files() { | |||
sudo ln -sf /dev/null ${rootfs_dir}/etc/systemd/system/udisks2.service | |||
|
|||
# Extract Linux kernel and install to /boot directory on rootfs | |||
sudo cp ${boot_dir}/kernel7.img ${rootfs_dir}/boot/zImage | |||
if [ "${device_type}" = "raspberrypi3" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here, use a variable for kernel7.img / kernel.img file and call sudo cp ...
only once. Having this you will also call a single command in line 135, instead of checking again device_type
.
I remember having to use |
ok let me try to build with GOARM=5 and verify |
@tuupola Same issue -> very strange |
@tuupola, |
Yeah, I do not believe that it is a compile time arch problem. As the error is a segfault.
Could you try running "strace mender", to try to pin-point where the segfault is. |
|
|
This seems to be fine, Debian patch to glibc after a quick search and should fail in most cases. But the fact that it segfaults just after:
Stack-overflow?
Curious, can you run |
|
ecb49d1
to
9ffcb4b
Compare
@apodogrocki pushed fixes + rebased on top of actual master |
rpi-convert-stage-5.sh
Outdated
|
||
# Replace kernel with U-boot and add boot script | ||
sudo mkdir -p ${rootfs_dir}/uboot | ||
|
||
sudo cp ${bin_dir_pi}/u-boot.bin ${boot_dir}/kernel7.img | ||
if [ "${device_type}" = "raspberrypi3" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
instead of =
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apodogrocki yes sure sorry overlooked that -> pushed new version
9ffcb4b
to
c988b6b
Compare
Final changes are fine. Could you please do one more thing and squash two first commits, so that there is not separate |
@apodogrocki sure I'll do. Also I plan to add note to README that autobuild mender client is not working on rpi0 |
- bump mender-uboot (as patches for rpi0w are present in later revisions) - reuse as much as possible rpi3 convert files Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
As we now support also rpi0 drop 3 from script name Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
c988b6b
to
a4b23b0
Compare
@apodogrocki done |
@nandra, You mention that the pre-built mender binary does not work, as we have discussed here. Have you built one that does work? And how if that is the case? |
@mirzak well it was build by customer and I'll try to get info how it was build and update. Thanks. |
I have some good news. I was able to fix mender client segfault on rpi0w by using raspberrypi toolchain (taken from https://github.com/raspberrypi/tools). There are 2 commits in This is more less hack and clean solution would be to IMO add parameter to docker-build to specify for which device we want to build and then use proper toolchain to build mender client + also u-boot. Or use precompiled versions of mender + u-boot and pass it as parameters. Ideas? Thanks. |
Nice! I would really like to avoid different toolchains for different boards, this is getting more and more custom.. As an alternative, perhaps upgrading U-Boot for every board would help? See this ticket: https://tracker.mender.io/browse/MEN-2198 The precompiled option would be my dream. :) But would this work on most boards, or would we have to provide a precompiled uboot for each and every board? |
Well currently we need to have separate u-boot for every board (basically every board have different config) and there doesn't exists something like multiarch u-boot. Also rpi0w is bit exception as architecture is armv6 while current linaro + ubuntu toolchain have support only armv7+ So for that reason we need to have custom toolchain for that purpose. Other commonly used arm board should work fine with linaro toolchains though. u-boot update is doable we just need to add few mender specific patches + 2018.x (not sure exactly which version) require gcc >= 6.x so we will have then problem for rpi0w (or we compile by hand new toolchain for this board). |
Note that we only rely on compiling U-boot for Raspberry Pi boards, e.g BBB we use GRUB and this is not a problem. I would suggest that we keep the raspberry0w as experimental and try to document the limitations (maybe a seperate Mender Hub post for it with link t your fork with the fixes) until we have explored more boards and confirmed that the raspberrypi boards are the exception. We probably need to rework this anyway if we are to generalise the tool. |
@mirzak ok clear. I'll add post to Mender Hub (debian family). But from testing it looks like also sunxi boards doesn't support grub yet so if anyone would like to have e.g. armbian we need to anyway compile u-boot to support that boards (but we can stick with current setup and don't need extra toolchain) |
Added few tweaks to have support for rpi0. With actual mender-convert master I anyway get crash when staring mender like:
even reading of version failed:
Any ideas? I'm using raspbian lite (so maybe something is missing there)? Thanks.