WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Flatpak  (Read 8124 times)

Offline Lachu

  • Newbie
  • *
  • Posts: 15
Flatpak
« on: May 05, 2020, 08:34:34 AM »
Is there a way to install Flatpak? How to add repository or on which name package is using?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Flatpak
« Reply #1 on: May 05, 2020, 10:46:42 AM »
Lachu, I was able to install  flatpak  on TCL in a roundabout way (just to see if I could help you--I'm not a flatpak user). However, I can't get any flatpak applications to work in TCL. Here's an example:
Code: [Select]
bruno@box:~$ flatpak run --verbose org.gnome.Recipes
F: No installations directory in /nix/store/8rj42gd89vzji98vg8406khv2cqp3yz5-flatpak-1.6.3/etc/flatpak/installations.d. Skipping
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/bruno/.local/share/flatpak
F: Opening user flatpak installation at path /home/bruno/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/bruno/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
F: Regenerating ld.so.cache /home/bruno/.var/app/org.gnome.Recipes/.ld.so/59d51f0236f09d8006d0957ea20ec10eab34b125018c670def91a3bc153d903b
F: Running: '/nix/store/7sm1z3jcnkpr37s7g7c1khp1lpw6qyd6-bubblewrap-0.4.1/bin/bwrap --args 14 ldconfig -X -C /run/ld-so-cache-dir/59d51f0236f09d8006d0957ea20ec10eab34b125018c670def91a3bc153d903b'
bwrap: pivot_root: Invalid argument
error: ldconfig failed, exit status 256
Apparently the  pivot_root  issue on TCL has been around for a few years: https://github.com/flatpak/flatpak/issues/1007
Maybe juanito would know if there's a solution for it.

Is/are the application(s) you need available in the TCL repository or as AppImages? For the record, most AppImages I've tried worked perfectly on TCL. For the few that didn't work right away, usually the solution was to run one or more of these commands:
Code: [Select]
$ tce-load -wi bash
$ sudo ln -s /lib /lib64
$ sudo ln -s /usr/local/etc/fonts /etc/fonts
$ sudo ln -s /usr/local/etc/ssl /etc/ssl
« Last Edit: May 05, 2020, 10:48:33 AM by GNUser »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: Flatpak
« Reply #2 on: May 05, 2020, 11:06:26 AM »
Maybe juanito would know if there's a solution for it.

Not that I know of  :)

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Flatpak
« Reply #3 on: May 05, 2020, 11:25:25 AM »
Generally, with all those modern unprivileged container dreams...

On the one side there are the people who want to make sure containers can only be run from a user ("rootless"), so that there is no attackable daemon with root/kernel privileges. those people are scared that bec. everything is so complicated somebody will be able to gain full privileges by attacking that daemon from the VM, so they want to have no such daemon.
On the other side there are those people who now can only run as user, who try to get more and more privileges from the kernel into userland...

companies like google, facebook, redhat, are actually spending ludicrous amount of work on all the many related issues creating more and more fine-grained privilege escalation possibilities for these use cases.

it can only end badly IMO.

don't bother, guys :)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Flatpak
« Reply #4 on: May 05, 2020, 11:47:09 AM »
those people are scared that bec. everything is so complicated somebody will be able to gain full privileges

Haha, indeed. If KISS principle were followed, then there'd be nothing to be afraid of.
Truth be told, I really dislike flatpak for the very reason that it's quite complicated.

AppImages are conceptually quite simple: At runtime, the AppImage mounts the squashfs archive inside of it, which contains the application's binaries and any libraries it might need. The portability "magic" is achieved by a wrapper script that exports LD_LIBRARY_PATH and, in some cases, a handful of other environmental variables. It's really as simple as that.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Flatpak
« Reply #5 on: May 05, 2020, 04:19:06 PM »
yep, and i do like the idea of user namespaces in principle...

there was just no way to make a unix lest a posix or linux do these things either correctly, securely or efficiently.
sometimes the legacy just weighs too much. so they made a new OS instead: the first plan9 release was 27 years ago.

and since then, while they are trying to nail on more and more cruft to get those user namespaces in there at any cost, all those meltdown & spectre things happened, and we realize even the most basic guarantees like virtual memory and thus process and user separation aren't upheld any more.

too late to go full circle. there is no more left to do.

but enjoy the firework.

Offline Lachu

  • Newbie
  • *
  • Posts: 15
Re: Flatpak
« Reply #6 on: May 06, 2020, 05:48:53 AM »
Is/are the application(s) you need available in the TCL repository or as AppImages?
I created custom application as Flatpak and need to install it on TCE. I will try to create AppImage with this application. I think I could create gaming console platform using TCE, because it is light OS and starting fast. Application I need to install is my gaming shop/platform created for GNU/Linux. As I said, I will try to create AppImage with my app.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11050
Re: Flatpak
« Reply #7 on: May 06, 2020, 12:38:41 PM »
Why would you need to use a container at all, if it's a custom application?
The only barriers that can stop you are the ones you create yourself.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Flatpak
« Reply #8 on: May 06, 2020, 02:20:23 PM »
@Lachu - I haven't used this, but it may be of interest to you: https://github.com/sudo-give-me-coffee/flatpak2appdir

Offline Lachu

  • Newbie
  • *
  • Posts: 15
Re: Flatpak
« Reply #9 on: May 07, 2020, 12:06:45 PM »
I created AppImage. It worked under OpenSUSE, but not on TinyCore. I must download another appimage (appimagetool) to made last step of creation my own appimage. Problem is ever appimagetool not worked under tinycore.
On both cases I got message: bash: <name of appimage file>: No such file or directory
I installed fuse, but this didn't helps.
As I remember No such file or directory also means executable doesn't support your current architecture, but my AppImage contains 64 bit application and I have 64 bit linux kernel installed.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Flatpak
« Reply #10 on: May 07, 2020, 12:12:20 PM »
In my experience, "No such file or directory" errors on TCL (when the file or directory in question clearly exists) is usually due to one of 2 things:
a) the interpreter (in this case bash) can't be found or
b) the linker (ld-linux-x86-64.so.2) can't be found

Please run the commands below then try again. The first command takes care of the interpreter here, the second command helps applications looking for linker in /lib64 to find them in /lib (where it is actually located in TCL).

Code: [Select]
$ tce-load -wi bash
$ sudo ln -s /lib /lib64
$ sudo ln -s /usr/local/etc/fonts /etc/fonts
$ sudo ln -s /usr/local/etc/ssl /etc/ssl
« Last Edit: May 07, 2020, 12:19:15 PM by GNUser »

Offline Lachu

  • Newbie
  • *
  • Posts: 15
Re: Flatpak
« Reply #11 on: May 07, 2020, 12:26:14 PM »
I probably found an issue.
Running normal linux/elf with assets in subdirectories application causes the same problem. I migrated to 64bit version by downloading 64bit kernel, rootfs and modules64 and added these files to initrd command. Maybe there's something I do wrong.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Flatpak
« Reply #12 on: May 07, 2020, 12:37:40 PM »
Code: [Select]
sudo ln -s /lib /lib64

Offline Lachu

  • Newbie
  • *
  • Posts: 15
Re: Flatpak
« Reply #13 on: May 09, 2020, 09:56:05 AM »
I created symbolic link to /lib under /lib64 and symbolic link to /usr/lib under /usr/lib64. So games runs without problems, but to made AppImage working I must install fuse. There's also error with my app (bundled to appimage). Assertion inside g_subprocess_launcher_spawnv complains and program segfaults. On other systems this app works.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Flatpak
« Reply #14 on: May 09, 2020, 04:07:54 PM »
Assertion inside g_subprocess_launcher_spawnv complains
This is just a shot in the dark, but does it help if you do this?
Code: [Select]
$ tce-load -wi gobject-introspection
If not, please copy the exact error and paste it here. I'd like to help but need more information.