fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.08k stars 110 forks source link

JuNest-based AppImages (ArchImages): how can I keep only JuNest and the files needed to execute one app? #336

Closed ivan-hc closed 9 months ago

ivan-hc commented 1 year ago

Hi, I'm sorry if I bother you with my requests. The ArchImages are working and them can be also smaller than the normal AppImages when all the bloatwares are removed. You can already test some of them:

however, to made them so small I need to remove all the stuff manually, and this take a lot of time.

By virtue of your immense experience in making Arch Linux a portable application (via PROOT), I ask you if it is also possible to download, somehow, only the files necessary to allow JuNest (or at least a small part of them by removing the superfluous ) to run just one application and keep its dependencies.

For example, last night I was able to convert GIMP to an AppImage which from 490 to 250MB of space, is now only 97MB. Tonight I had a request, which is to include plugins. These being from the AUR, the package has now reached 200MB, so I'd have to manually remove it all over again.

Do you have any idea? Is there anything I can do using pacman and yay to speed this up and lighten the final packages? I only need a fraction of those files, not all of them.

Any suggestions would be important for me and for those who use these JuNest based programs.

Thank you!

ivan-hc commented 1 year ago

UPDATE, I've patially solved for the files of the app, now I only need the basic files of JuNest.

In brief, the basic installation of JuNest after junest setup is about 500 MB.

What are the few files I should use to run just one program? I get some errors related to proot.

fsquillace commented 1 year ago

Hey @ivan-hc ,

I think I would need to look at this more deeply but if the objective would be to only run the specific program (e.g. GIMP) and make a junest just tailored for that, I'd guess one option could be to remove pacman package itself and all its package dependencies.

I would expect that the majority of the space is taken by pacman and all its dependencies. You may want to look at which dependencies are needed for pacman using pacman -Qi pacman and individually remove the associated files.

So you could go over all pacman package dependencies and list all package files through:

pacman -Ql <package_name>

and remove them. Not sure if that helps but I would give it a try.

Regards, Filippo

ivan-hc commented 1 year ago

Hi, nope, this does not helps much. However I'm near to another solution for my problem:

https://github.com/ivan-hc/ArchImage/blob/eebb58fb427cd3305430a3af4ee46daf2c57285c/sample-next-junest.sh#L97

from this line I can take only the files installed with the app (total sizes 270 MB for GIMP, still reducible)... however I'm stuck due to some errors that prevent me to run the app without errors. For example, I need to mount --bind=/usr/share to made GIMP run without icons, by removing that flag my window manager (xfwm4) crashes. In both cases this is not good. I'm still investigating.

ivan-hc commented 9 months ago

Just found what are the binaries needed in /usr/bin: bash, env, sh and proot... plus the main executable of the app (and if needed we can keep what we need, for example mpv also needs youtube-related binaries to play videos in streaming).

However, bash, env, sh and proot are all we need to in /usr/bin.

I'm still working to made these packages more smaller, and now to work on /usr/lib and /usr/share is easier for me.

My script to build Emacs is an example https://github.com/ivan-hc/Emacs-appimage