pine64/pine64_updater

I would like to apply for demand for a linux version

myxor opened this issue · 11 comments

myxor commented

Just wanted to make sure you know that a linux version of the updater would be highly appreciated.
Thanks for your work.

dal00 commented

There is this https://twitter.com/dal000/status/1344630316015755265?s=19

not sure about the current status

@dal00 As in tweet, it's probably job for Ralim.
@myxor Okay :-) I will take look on it in near days.

It works on Linux as is right now.

qmake #to generate the Makefile
nano Makefile #Add -lusb-1.0 to the LIBS line
ln -s /usr/bin/dfu-util . #tool expects dfu-util in the same folder
sudo ./pinecil_firmware_updater

image

If you want it to look for dfu-util in PATH edit this line

https://github.com/pine64/pinecil-firmware-updater/blob/master/flashingthread.cpp#L58

and change it to

    dfuUtil.start("dfu-util", dfuUtilArgs);

fyi, the correct way to handle unix/linux addition of libusb is to add the following line into the qmake pro file ( pinecil_firmware_updater.pro ) and then regenerate makefile.

unix:!android: LIBS += -lusb-1.0

line 37-ish is the approximate place for it.

It'd be nice if that line to qmake could be added officially, and perhaps a small document on these steps could be made... If there's interest, I can give it a try (are PR's accepted?)

@canihavesomecoffee PRs are always welcomed 😊

the compile instructions didnt work on two different linux systems. one being PopOS 20.10 and the other being opensuse leap. The error happens when executing make and is the same on both systems.

Opensuse Leap 15.2

Info: creating stash file /home/~/bin/pinecil-firmware-updater/.qmake.stash
Project MESSAGE: /home/~/bin/pinecil-firmware-updater/deps/libusb/lib/


:~/bin/pinecil-firmware-updater> make
/usr/lib64/qt5/bin/uic aboutdialog.ui -o ui_aboutdialog.h
/usr/lib64/qt5/bin/uic connectpinecildialog.ui -o ui_connectpinecildialog.h
/usr/lib64/qt5/bin/uic mainwindow.ui -o ui_mainwindow.h
g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o aboutdialog.o aboutdialog.cpp
g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o connectpinecildialog.o connectpinecildialog.cpp
g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o flashingthread.o flashingthread.cpp
In file included from flashingthread.cpp:1:0:
flashingthread.h: In constructor ‘FlashingThread::FlashingThread(QObject*, bool, QString, bool)’:
flashingthread.h:18:13: warning: ‘FlashingThread::firmwarePath’ will be initialized after [-Wreorder]
     QString firmwarePath;
             ^~~~~~~~~~~~
flashingthread.h:17:10: warning:   ‘bool FlashingThread::massErase’ [-Wreorder]
     bool massErase;
          ^~~~~~~~~
flashingthread.h:10:5: warning:   when initialized here [-Wreorder]
     FlashingThread(QObject *parent = nullptr, bool driverMissing = false, QString firmwarePath = "", bool massErase = false)
     ^~~~~~~~~~~~~~
g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o main.o main.cpp
g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o mainwindow.o mainwindow.cpp
In file included from mainwindow.cpp:9:0:
flashingthread.h: In constructor ‘FlashingThread::FlashingThread(QObject*, bool, QString, bool)’:
flashingthread.h:18:13: warning: ‘FlashingThread::firmwarePath’ will be initialized after [-Wreorder]
     QString firmwarePath;
             ^~~~~~~~~~~~
flashingthread.h:17:10: warning:   ‘bool FlashingThread::massErase’ [-Wreorder]
     bool massErase;
          ^~~~~~~~~
flashingthread.h:10:5: warning:   when initialized here [-Wreorder]
     FlashingThread(QObject *parent = nullptr, bool driverMissing = false, QString firmwarePath = "", bool massErase = false)
     ^~~~~~~~~~~~~~
mainwindow.cpp: In constructor ‘MainWindow::MainWindow(QWidget*)’:
mainwindow.cpp:140:36: error: ‘errorOccurred’ is not a member of ‘QNetworkReply’
     connect(reply, &QNetworkReply::errorOccurred, [this] {
                                    ^~~~~~~~~~~~~
make: *** [Makefile:545: mainwindow.o] Error 1

@Mirppc Which version of Qt are you using? errorOccurred was introduced in Qt 5.15 (https://doc.qt.io/qt-5/qnetworkreply.html#errorOccurred)

I.e.

$ qmake-qt5 --version
QMake version 3.1
Using Qt version 5.15.2 in /usr/lib

Pop OS 20.10

QMake version 3.1
Using Qt version 5.14.2 in /usr/lib/x86_64-linux-gnu

Opensuse Leap 15.2

QMake version 3.1
Using Qt version 5.12.7 in /usr/lib64

The build problem above (with older Qt) has now been fixed.