Skip to content

Companion Linux: build AppImage#829

Merged
pfeerick merged 2 commits intomainfrom
build-appimage-poc
Oct 6, 2021
Merged

Companion Linux: build AppImage#829
pfeerick merged 2 commits intomainfrom
build-appimage-poc

Conversation

@raphaelcoeffic
Copy link
Copy Markdown
Member

No description provided.

@raphaelcoeffic raphaelcoeffic force-pushed the build-appimage-poc branch 2 times, most recently from e9e11af to 4d52e39 Compare September 28, 2021 17:23
@raphaelcoeffic raphaelcoeffic linked an issue Sep 28, 2021 that may be closed by this pull request
@pfeerick
Copy link
Copy Markdown
Member

Well, I think that's that issue put to rest! 😁 Was in a VM for now, but had access to real transmitter, and was able to both read from and write to it. Just need the simulators now! :)

Screenshot_20210929_152843

@raphaelcoeffic
Copy link
Copy Markdown
Member Author

raphaelcoeffic commented Sep 29, 2021

Well, I think that's that issue put to rest! 😁 Was in a VM for now, but had access to real transmitter, and was able to both read from and write to it. Just need the simulators now! :)

Dfu-util isn’t missing? I’d bet the dependencies are not packaged…

@pfeerick
Copy link
Copy Markdown
Member

pfeerick commented Sep 29, 2021

You'd win that bet... it's looking for the system installed dfu-util... I hadn't tried dfu-read as that's what Flasher is for! 😛
image

@raphaelcoeffic
Copy link
Copy Markdown
Member Author

@pfeerick no clue which consequences it has, but there is no way to copy the udev rules from within an AppImage... (see AppImageCommunity/pkg2appimage#200)

@pfeerick
Copy link
Copy Markdown
Member

I wouldn't worry about that so much in this first instance - and I'm not surprised, to do anything udev related you'd need root/admin privileges since you're messing around with system rules. In this case, the rules in /companion/targets/linux are simply setting permissions, so that the owner-group-users all have read and write access, meaning Companion doesn't need to be run as a admin user to access the taranis or usbasp.

Worst case scenario, we come up with a shell script the user runs on their system, which is able to detect the difference between debian/arch/suse systems, run the appropriate package manager commands to install dfu-utils for that distro, and apply any udev rules necessary. The likelihood is you won't have to hand-hold Linux users that much (else they shouldn't be using Linux in the first place!) - just tell them they need to install dfu-util (if they can't figure it out from the error message), and

@raphaelcoeffic
Copy link
Copy Markdown
Member Author

I wouldn't worry about that so much in this first instance - and I'm not surprised, to do anything udev related you'd need root/admin privileges since you're messing around with system rules. In this case, the rules in /companion/targets/linux are simply setting permissions, so that the owner-group-users all have read and write access, meaning Companion doesn't need to be run as a admin user to access the taranis or usbasp.

Worst case scenario, we come up with a shell script the user runs on their system, which is able to detect the difference between debian/arch/suse systems, run the appropriate package manager commands to install dfu-utils for that distro, and apply any udev rules necessary. The likelihood is you won't have to hand-hold Linux users that much (else they shouldn't be using Linux in the first place!) - just tell them they need to install dfu-util (if they can't figure it out from the error message), and

dfu-util needs to be installed in the AppImage, otherwise it cannot be executed from Companion. Imagine a AppImage as a sort of a sandbox ;-)

@pfeerick
Copy link
Copy Markdown
Member

pfeerick commented Sep 29, 2021

No, not quite... AppImages aren't sandboxes (like a virtual machine)... it's a self-contained packaged that can also access host resources and files... i.e. I just did an apt install dfu-util on the host OS (Ubuntu), and now instead of an error, I can flash the firmware...

All that bundling dfu-util does is 1) ensure it's actually present and 2) because it's bundled, you have certainly as to the version available.

image

@raphaelcoeffic raphaelcoeffic force-pushed the build-appimage-poc branch 2 times, most recently from 17c78d8 to a8f0ff5 Compare September 29, 2021 15:40
@raphaelcoeffic raphaelcoeffic changed the title PoC: build AppImage Companion Linux: build AppImage Sep 29, 2021
@raphaelcoeffic raphaelcoeffic marked this pull request as ready for review September 29, 2021 15:41
Comment thread companion/src/simulation/simulatorinterface.cpp Outdated
@pfeerick
Copy link
Copy Markdown
Member

Regardless, this package is working fine for me on Windows and Linux (Ubuntu), and seems to be able to read and write to the radio properly in both cases. Simulators also both run for both.

@raphaelcoeffic
Copy link
Copy Markdown
Member Author

@pfeerick by the way, I assume that the code for windows is basically trying to do the same thing with some strange Win32 API:

  char name[MAX_PATH];
  GetModuleFileName(NULL, name, MAX_PATH);
  QString path(name);
  path.truncate(path.lastIndexOf('\\'));
  dir.setPath(path);

I think we should try to get rid of this at the same time. Is that something you could try out?

@pfeerick pfeerick added the companion Related to the companion software label Oct 1, 2021
@pfeerick pfeerick added this to the 2.5 milestone Oct 1, 2021
Copy link
Copy Markdown
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Risto has identified the dfu-utils problems to be a combination of host-install path issues and a underlying bug in companion which has been since fixed.

I haven't had any issues with this when trying it on Linux - either in a VM or on actual hardware.

@pfeerick pfeerick merged commit 63a5160 into main Oct 6, 2021
@pfeerick pfeerick deleted the build-appimage-poc branch October 6, 2021 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

companion Related to the companion software

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Companion: Linux builds

2 participants