## # Yocto Project Dev Day Prague 2017 # crops session # Tim Orling # # These instructions are tailored for Mac OS X # Windows and Linux will differ # # download eSDK wget http://downloads.yoctoproject.org/releases/yocto/milestones/yocto-2.4_M3/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-armv5e-toolchain-ext-2.3.sh # download Docker eSDK container docker pull crops/extsdk-container # create volume docker volume create --name myvolume # set proper ownership docker run -it --rm -v myvolume:/workdir busybox chown -R 1000:1000 /workdir # download Docker samba container docker pull crops/samba # create the instance docker create -t -p 445:445 --name samba -v myvolume:/workdir crops/samba docker start samba # Mac will not allow us to connect to 127.0.0.1 for samba # workaround sudo ifconfig lo0 127.0.0.2 alias up # # Open the Finder and hit Command-K # In the "Server Address" box, type smb://127.0.0.2/workdir # and hit "Connect" # When prompted, choose to login as Guest # # copy the eSDK installer to the workdir cp ~/Downloads/poky-glibc-x86_64-core-image-sato-armv5e-toolchain-ext-2.3.sh /Volumes/workdir/ # run the eSDK container docker run --rm -it -v myvolume:/workdir crops/extsdk-container --url file:///workdir/poky-glibc-x86_64-core-image-sato-armv5e-toolchain-ext-2.3.sh # you will now be at a bash prompt _inside_ the Docker container . ./environment-setup-armv5e-poky-linux-gnueabi # create a placeholder file that we can edit with Mac host tools touch hello.c # Open an editor in Mac, such as Visual Studio Code # Open the "hello.c" from the "workdir" connection # # type in the program #------- # include int main(void) { printf("Hello, Prague 2017!\n"); return 0; } #-------- # in the Docker teriminal session # cross-compile $CC hello.c # examine the result file a.out >> a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=17bdf1d27076e3e579c20007f60397c96984a012, not stripped # done for now exit # When we exit Docker, we need to restart samba docker start samba # The eSDK is already extracted, no '--url' required docker run --rm -it -v myvolume:/workdir crops/extsdk-container # Profit!