-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor installation code #27
Conversation
Extracted code from the maintainer scripts to a central script to avoid duplicate code. Added support for systemd-binfmt with a binfmt.d config for distros without binfmt-support packages. Fixes #19
The debian binfmt-support package actually uses it's own systemd service: So, if this package is installed it will use that, not the upstream (systemd) bundled service. |
@NuLogicSystems that file just enables or disables the whole binfmts support entirely, apparently. I'm furthermore not 100% sure whether it loads the binfmt.d config files, and doesn't just read the |
Either way, if binfmt-support was installed when you installed your package, then systemctl restart systemd-binfmt wouldn't work, but systemctl restart binfmt-support probably would. |
@NuLogicSystems that's getting a little too complicated, in my opinion. I just tried restarting by the way, it didn't activate the binfmt.d files, but only applied the changes in |
Yea, that makes sense if it follows the normal systemd config file hierarchy actually. |
@NuLogicSystems I merged the PR for now, as it contains a few fixes, and doesn't break with the existing integration methods. I'll test the whole thing with the AUR PKGBUILD on Manjaro now, to see whether the integration works now. |
Did you already fix the pre >> post uninstall issue? |
Ah, crap! I forgot to push that commit. I'll fix that immediately. Thanks. |
Building it now on my Enlightenment system. |
I pushed a commit to AUR removing the old install file. |
The default pacman hook for binfmts "Registering binary formats" works on installation. |
OK, /usr/share/libalpm/hooks/systemd-binfmt.hook only has Install and Upgrade as operations. |
I added a task here: |
Did you try to manually call this hook after uninstalling? Did it clean up the integration? |
No the hook needs an Operation=Remove line for that to work.
|
I meant like "do whatever the hook does" (like me calling |
Yes, that is basically what the hook does: systemd restart systemd-binfmt |
You didn't reply to my actual question: does it re-enable "normal" AppImage execution? In my tests on Debian/Ubuntu, it didn't work. |
I've never had an issue with appimages running if the exec bit is enabled on arch. |
Stupid me, I was trying to do this in terminology. |
That's a critical issue. |
So yes, it is working. |
@NuLogicSystems You need to be a bit more elaborate, I think I'm missing your point. Let's recapitulate: If we set up binfmt support with such a config file, on installation, the format is registered in the kernel, and AppImageLauncher is called when (executable!) AppImages are executed. Now, we want to remove the package. We restart this service, like the hook would do (doesn't matter if it's in the Expected behavior: kernel format is unregistered, AppImages can be executed, they launch normally. Actual behavior (on Debian): Launching does no longer work. Expected problem: format is still registered, the "restart" didn't unregister it, but the interpreter is missing, therefore the call fails. Actual behavior (on Arch): ? |
I'm switching to another machine, I've had issues launching appimages with appimagelauncher under Enlightenment. |
Does this work as intended under rpm based distrobutions? |
I'll re-check, let me quickly boot some openSUSE. |
The reason I ask is our conf file looks much different than the others I've looked at. |
Check https://www.freedesktop.org/software/systemd/man/binfmt.d.html for more information. The configuration file adheres to the format referred on this page, https://www.kernel.org/doc/Documentation/admin-guide/binfmt-misc.rst. |
Ours: :CLR:M::MZ::/usr/bin/mono: |
Please let me know how openSUSE goes. |
@NuLogicSystems they look different because the formats are different. I can explain to you what these lines mean. The line is correct, it works fine here, really! |
I just noticed a minor bug (another directory conflict) in the RPM, I'll fix it and will try then. |
Well, I'm getting the same error on both my arch enlightenment and Netrunner Rolling machines with the AUR package. |
If I use the old package from the repository I don't get the error runnning AppImageLauncher *.appimage. |
What error? I am referring to an installation bug "directory conflict", CMake's auto generated file list often includes empty directories, which is not a problem with Debian packages, but with RPM packages. Hence I added it to the exclude list I maintain. |
The "Failed to clean up old desktop files" error i'm getting with AppImageLauncher *.appimage.
|
I can reproduce the bug now with the official packages. I'll have a look. |
Still, I don't know why it's not trying to launch with the interpereter when executing the appimage files by themselves. But one thing at a time. ;) |
The function is |
@NuLogicSystems works now. |
That does, no more error.
|
What system? How can I reproduce the issue? Maybe create a separate issue with more information? |
Netrunner Rolling |
This works: So it has to be something in your magic that arch doesn't like. |
@NuLogicSystems this only uses the extension, and isn't reliable at all. We need the magic bytes check. So far I can tell that the registration itself works, calling Looking at the contents, though, I found the issue: The |
Fixed, @NuLogicSystems. |
BTW, in the interum since using my /etc/binmft.d/appimage.conf file was working. |
Rebuilding from AUR now. |
Good to know. Nevertheless, your file was only relying on the extension, which is unreliable for various reasons. Some AppImages ship without extension. And, technically, an extension on unix-ish platforms is merely a form of decorating the filename, but nothing technically necessary. |
Thanks for that. Been using Linux since 1995, before that i used Minux, AIX, 4.4BSD + (actually still use freeBSD), SunOS (Solaris), and System V. I also owned a SPARC V8 and then a DEC Alpha back in the day.. Man I'm getting old.. Anyway, I only used the extension as a test to see if the magic numbers might have been the problem. ;) |
Yes, success. Launched the appimage with appimagelauncher this time. |
And uninstalling the pakage, then running systemctl restart systemd-binfmt, restores normal function. We have a winner.. Yeahhhh. |
@NuLogicSystems thanks for your help. I did by the way not try to lecture you, but I write my comments in a way that future readers who don't know about a fact will understand it completely, therefore I tend to be more elaborate in my replies than the average GitHub user. I'm just glad we have a working Arch setup now... was way more work than for any other distro... |
I didn't think you were lecturing me. It just inadvertantly made me feel bit old, not your fault. ;) |
Extracted code from the maintainer scripts to a central script to
avoid duplicate code.
Added support for systemd-binfmt with a binfmt.d config for distros
without binfmt-support packages.
Fixes #19