Skip to content

Firmware Setup for Fedora 36 (Morepork Toolchain)

Praveen Rajendran edited this page Apr 4, 2023 · 9 revisions

Update Your System

  • sudo dnf upgrade
  • Reboot your machine

Install dependencies

sudo dnf install make automake libtool cmake-gui gcc gcc-c++ git git-lfs svn boost-devel glibc-devel.i686 libusbx-devel openssl-devel yajl-devel python2 python3-pip fuse-sshfs fakeroot perl-devel ncurses-devel screen patch perl

Enable SSH Daemon

sudo systemctl start sshd
sudo systemctl enable sshd

Setup Git

git config --global user.name '<Your Name for GitHub Pushes>'
git config --global user.email '<Your GitHub Email>'

Add SSH key to GitHub

The following instructions were taken from here.

  • Generate an SSH Key pair
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    Hit Enter for all prompts.
    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_rsa
    sudo dnf install xclip
    xclip -sel clip < ~/.ssh/id_rsa.pub
  • Copy the public key to GitHub
    Go to github.com -> Settings -> SSH and GPG Keys -> New SSH Key. Detailed instructions here.

Install genext2fs from source

genext2fs is not really maintained anymore and is not included in the Fedora repos. The easiest thing to do in Fedora 34 is install it from compiled source. The maintainers have not included README and ChangeLog files, which are now required by automake.
git clone https://github.com/bestouff/genext2fs.git
cd genext2fs
ln -s README.md README
touch ChangeLog
./autogen.sh
./configure
make
sudo make install

Install Qt

Maybe read all these bullet points completely before you do anything.

  • Install prerequisites packages
    sudo dnf install mesa-libGL-devel

Go to https://www.qt.io/download-open-source/, click on 'Download the Qt Online Installer', download it, and install the desired Qt5(v 5.12.7). Ideally we would want to install the same version defined here. Note: You can install the latest LTS version, but it is probably greater than what's being used on the printer itself and will have features not available on the printer's Qt5.

Get pip2 and Install Python packages

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2 get-pip.py
sudo pip2 install artifactory
sudo pip3 install protobuf==3.20.0

Artifactory DNS resolution

Since Fedora 33, artifactory cannot properly resolve the URL to our internal artifactory server over a VPN connection due to a VPN/DNS security update on Fedora's side. You must add the following line to /etc/hosts.
10.1.100.145 maven.soft.makerbot.net

Clone and build the Morepork Toolchain

git clone git@github.com:makerbot/Toolchain-Release.git
cd Toolchain-Release
python2 update-repos.py -t morepork
python2 build-repos.py -j9

Setup CESKey

This is required to SSH into a printer or use the ssh_install.py script.

  • Download the CESKey to your machine.
  • Copy it to ~/.ssh/
  • Set the correct file permissions
    chmod 400 ~/.ssh/CESkey

Install STM32CubeMX

The repositories containing STM32 MCU firmware are managed by STM32CubeMX. If you want to change MCU settings you need to install STM32CubeMX. You can get the download here. However, the one you get from there will likely not work because CubeMX now bundled with JRE and the JRE they have included is outdated. You need to download the latest AdoptOpenJDK v11 and use that to replace what comes with CubeMX. I have already done this and put it in a tar so you can just download it here from Google Drive.
To build standalone STM32 projects (eg. qt_dragon), run the following:
sudo dnf install arm-none-eabi-newlib arm-none-eabi-gcc

Install NetExtender VPN client

A heads up before you begin this journey. This is the worst VPN client ever made. It is buggy and rarely updated. Do not be surprised if you have issues with it.
Click here and download the client by selecting Linux RPM 64-Bit from the Get NetExtender for Linux Version drop down. Install it and don't bother trying to use the GUI version and instead use the terminal version.
Note: NexExtender patches a bunch of /etc/ppp/ files to make it work. It these files are updated by the system, NetExtender may not continue to work correctly. If you can experience any issue, try the following command (force reinstall NetExtender) first to fix the issues.
sudo rpm -i --force --replacefiles ./NetExtender.Linux-x.x.x-x.x86.64.rpm
Note: I have had to resort to using the following command to get newer versions to install properly (ie. for updating an already installed NetExtender).
sudo rpm -i --replacefiles ./NetExtender.Linux-x.x.x-x.x86.64.rpm
For running the client from the terminal, maybe make your life easier and make a bash script that runs the following command.
netExtender --username=first_name.last_name@makerbot.net --domain=makerbot.net vpn.makerbot.net:4433 --password=your_password
You can exclude --password from the command and it will just prompt you for it.
Note: There is a bug where the client does not revert your /etc/resolv.conf file after closing the VPN connection, which causes you to not have internet access when you change to a different network and/or be unable to restart the VPN client. If you experience either of those things, do the following.
sudo rm /etc/resolv.conf
sudo systemctl restart NetworkManager

Optional Setup

Setup terminal keyboard shortcut

  • Go to Settings -> Devices -> Keyboard Shortcuts.
  • Scroll to the bottom and click the + button.
  • For the 'Name' enter 'Launch Terminal' and for 'Command' enter 'gnome-terminal'.
  • Click the 'Set Shortcut...' button and then hit the keyboard button combo you want. Crtl+Alt+t is a common one.

Clone this wiki locally