# Building firmware on openSUSE, the hard way

**URL:** <https://community.keyboard.io/t/building-firmware-on-opensuse-the-hard-way/1219>\
**Category:** Programming\
**Created:** [March 7, 2018, 8:17pm UTC](https://community.keyboard.io/t/building-firmware-on-opensuse-the-hard-way/1219 "2018-03-07T20:17:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aspiers](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/aspiers/32/245_2.png) [@aspiers](https://community.keyboard.io/u/aspiers)\
**Post date:** [March 7, 2018, 8:17pm UTC](https://community.keyboard.io/t/building-firmware-on-opensuse-the-hard-way/1219/1 "2018-03-07T20:17:47Z")

</div>

This is very similar to [Building firmware on Gentoo, the hard way](https://community.keyboard.io/t/building-firmware-on-gentoo-the-hard-way/962) except for openSUSE Leap (42.3 currently) instead of Gentoo. And before I go further, let me clarify that I can already build firmware fine using the Arduino download from [https://www.arduino.cc/en/Main/Software](https://www.arduino.cc/en/Main/Software) - but I want to do it with the openSUSE native Arduino packages too. So here’s what I’ve figured out so far for the latter case:

Firstly manually remove the `-tools "${ARDUINO_PATH}/tools-builder"` line from `Arduino-Boards/libraries/Kaleidoscope/bin/kaleidoscope-builder` as mentioned in [Building firmware on Gentoo, the hard way](https://community.keyboard.io/t/building-firmware-on-gentoo-the-hard-way/962?u=aspiers). Then do:

```
sudo zypper ar -f https://download.opensuse.org/repositories/Java:/packages/openSUSE_Leap_42.3/Java:packages.repo
sudo zypper ar -f https://download.opensuse.org/repositories/CrossToolchain:/avr/openSUSE_Leap_42.3/CrossToolchain:avr.repo
sudo zypper in Arduino{,-kit} cross-avr-gcc
export ARDUINO_PATH=/usr/share/arduino
export ARDUINO_BUILDER=/usr/bin/arduino-builder
export AVR_GCC_PREFIX=/usr
cd Model01-Firmware # assuming already cloned
make flash

```

This results in:

```auto
BOARD_HARDWARE_PATH="/home/adam/software/hardware/Arduino/hardware" /home/adam/software/hardware/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.22-33-gea59) ...
In file included from /tmp/tmp.LhNeGQlRza/sketch/Model01-Firmware.ino.cpp:1:0:
/usr/share/arduino/hardware/arduino/avr/cores/arduino/Arduino.h:23:20: fatal error: stdlib.h: No such file or directory
compilation terminated.
exit status 1
/home/adam/software/hardware/Arduino/hardware/keyboardio/avr/build-tools/makefiles//rules.mk:75: recipe for target 'flash' failed
make: *** [flash] Error 1

```

which is where I’m currently stuck. I’m sure it’s something to do with it not looking in the standard places for `stdlib.h` due to use of the cross-compiler. In fact I note that even though `cross-avr-gcc` installs to `/opt/cross`, `/opt/cross/include` is currently empty, which looks wrong.

---

<div class="post-metadata">

**Author:** ![to1ne](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/to1ne/32/35_2.png) [@to1ne](https://community.keyboard.io/u/to1ne)\
**Post date:** [March 10, 2018, 9:32pm UTC](https://community.keyboard.io/t/building-firmware-on-opensuse-the-hard-way/1219/2 "2018-03-10T21:32:02Z")

</div>

Ah, too bad you haven’t got it working yet. I would love to build a CI setup that builds the firmware for me. This would help me a lot.

---

<div class="post-metadata">

**Author:** ![aspiers](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/aspiers/32/245_2.png) [@aspiers](https://community.keyboard.io/u/aspiers)\
**Post date:** [March 11, 2018, 4:43pm UTC](https://community.keyboard.io/t/building-firmware-on-opensuse-the-hard-way/1219/3 "2018-03-11T16:43:03Z")

</div>

I _have_ got it working, just not in one particular way. Just making sure you understand that, if you didn’t already see my second sentence above.
