Skip to content
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

Update Raspbian image? #21

Open
aeppert opened this issue Nov 18, 2016 · 12 comments
Open

Update Raspbian image? #21

aeppert opened this issue Nov 18, 2016 · 12 comments

Comments

@aeppert
Copy link

aeppert commented Nov 18, 2016

The default Raspbian image that is present has grown rather old, especially with regard to repositories underlying it. There needs to be an automated mechanism for updating the image.

sdt added a commit that referenced this issue Nov 19, 2016
@sdt
Copy link
Owner

sdt commented Nov 19, 2016

Do you mean the sysroot that is pulled in from https://github.com/sdhibit/docker-rpi-raspbian ?
I believe that image gets built on a raspberry pi, so might be tricky to build in docker.

I've added an apt-get upgrade step to the Dockerfile to upgrade the raspbian packages.

Does that do what you need @aeppert ?

@aeppert
Copy link
Author

aeppert commented Nov 23, 2016

That certainly helps.

Has there been a change in the sysroot though for installing gcc, etc for raspbian? I noticed rpdo, which seems to call the appropriate gcc if I do "rpxc rpdo gcc", however otherwise the sysroot seems to be wrong?

@sdt
Copy link
Owner

sdt commented Nov 23, 2016

When you say "raspbian image", are you referring to the cross-compile toolchain?

ie. this https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64

@aeppert
Copy link
Author

aeppert commented Nov 23, 2016

Correct. I want to be able to use the raspbian cross-compiler toolchain
that was installed via "install-raspbian gcc" when I built a new image
based on your example.

On Wed, Nov 23, 2016 at 5:18 PM, Stephen Thirlwall <notifications@github.com

wrote:

When you say "raspbian image", are you referring to the cross-compile
toolchain?

ie. this https://github.com/raspberrypi/tools/tree/master/
arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAE6UgNv1KGAFJCYNyFANMPgZpN4ZCEeks5rBLuvgaJpZM4K285n
.

@sdt
Copy link
Owner

sdt commented Nov 23, 2016

I made a bunch of changes a while back to make rpxc work properly with full-blown autotools/configure/make projects. I've just realised that's made doing simple things less simple.

If you're just trying to cross-compile some of your own code, here's an example.

  1. Save this as hw.c
#include <stdio.h>
int main() {
    printf("Hello, world!\n");
    return 0;
}
  1. Compile this with: rpxc arm-linux-gnueabihf-gcc -o hw hw.c

  2. Copy hw to your raspberry pi and run it.

This uses the x64-native cross compiler. The install-raspbian command is more intended for installing somelib-dev type packages as build-time dependencies.

You could also create a Makefile like below and then just run rpxc make

CC=${CROSS_COMPILE}gcc
hw: hw.c
    $(CC) -o hw hw.c

@aeppert
Copy link
Author

aeppert commented Nov 23, 2016 via email

@aeppert
Copy link
Author

aeppert commented Nov 24, 2016 via email

@sdt
Copy link
Owner

sdt commented Nov 24, 2016

I haven't.

@aeppert
Copy link
Author

aeppert commented Dec 1, 2016

Cross-compiler is working appropriately. However, I am failing, painfully, to get the newly built image with the requisite Raspbian libraries for what I am trying to build (I modified the rpxc script to point to my new Docker image too). How do I point the cross-compiler to the sysroot inside the docker image? Failing that, I will just have to build them freestanding, which brings me 180degrees back to the way I use to build cross-compilers anyway.

@sdt
Copy link
Owner

sdt commented Dec 3, 2016

Could you make a gist or something of what you're trying to do?

@aeppert
Copy link
Author

aeppert commented Feb 6, 2017

Just getting back to this after months on another project. Do you have an example exercising the Raspbian packages installed? I absolutely need to link against those and have a host of them installed, including libpcap, as a definitive example I need to link against. My final binary will be hosted on Raspbian and I will end up putting together a .deb for it all.

@sdt
Copy link
Owner

sdt commented Feb 7, 2017

Both the axel and qtbase examples link against raspbian packages.

https://github.com/sdt/docker-raspberry-pi-cross-compiler/blob/master/example/axel/Dockerfile
https://github.com/sdt/docker-raspberry-pi-cross-compiler/blob/master/example/qtbase/Dockerfile

Do you have a repo or gist or something I could look at?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants