How does .xzm files actually work

Post here if you are a new Porteus member and you're looking for some help.
appEnigma
White ninja
White ninja
Posts: 18
Joined: 17 Jun 2023, 12:44
Distribution: Linux

How does .xzm files actually work

Post#1 by appEnigma » 18 Jun 2023, 14:27

Hi,

I am new to Porteus and wanted to understand how .xzm files actually work. When any module is activated is it directly loaded into RAM or some program gets installed in /usr/bin or someplace similar.

How does the whole process work in the background ?

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How does .xzm files actually work

Post#2 by Ed_P » 18 Jun 2023, 18:23

appEnigma wrote:
18 Jun 2023, 14:27
When any module is activated is it directly loaded into RAM or some program gets installed in /usr/bin or someplace similar.
Yup, that's what it does. It loads into RAM what an installed app would install in RAM. The executable, the support files, the subroutines. The advantage is deactivating the module is the same as uninstalling the app but a whole lot easier. :happy62:
Ed

appEnigma
White ninja
White ninja
Posts: 18
Joined: 17 Jun 2023, 12:44
Distribution: Linux

How does .xzm files actually work

Post#3 by appEnigma » 18 Jun 2023, 19:17

Ed_P wrote:
18 Jun 2023, 18:23
appEnigma wrote:
18 Jun 2023, 14:27
When any module is activated is it directly loaded into RAM or some program gets installed in /usr/bin or someplace similar.
Yup, that's what it does. It loads into RAM what an installed app would install in RAM. The executable, the support files, the subroutines. The advantage is deactivating the module is the same as uninstalling the app but a whole lot easier. :happy62:
Ok. Got it. Thanks.

But what if I do not want it to be loaded in the RAM ? Can I convert the .xzm module to other format and install the applications normally ? :crazy:

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How does .xzm files actually work

Post#4 by Ed_P » 18 Jun 2023, 22:02

Porteus is a Linux system so it is certainly possible to download and install Linux apps. The impact that will have when you upgrade to newer releases of Porteus I don't know.

The modules only load when they are activated. Have a modules you want but don't want loaded to RAM when you boot put them in the /porteus/optional folder.
Ed

fulalas
DEV Team
DEV Team
Posts: 2050
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

How does .xzm files actually work

Post#5 by fulalas » 19 Jun 2023, 02:41

When you activate a .xzm module its files don't get loaded into RAM, instead the module is mounted just like you mount an ISO, putting in RAM just the list of files available in this module, so any time a given file is required it will get loaded into RAM; in other words: it loads files into RAM by demand. You can test that by checking the memory consumption (Xfce taskmanager is reliable, or even neofetch) before loading a .xzm module and then after, and you'll see that the memory consumption doesn't change. However, if you manually copy a file to Porteus filesystem it will be placed in RAM.

Porteus has this boot option called copy2ram, which copies all the .xzm modules to RAM without extracting them. Then it works basically as I described above, but loading from the modules in RAM not from any storage unit. This allows lower latency response (i.e. applications will open and behave a bit faster) and the possibility of removing the storage unit after boot.

The file format of .xzm module is mksquashfs, which is like a zip file but optimized for decompression speed (with the drawback of being super slow to compress). This file format is the same used by basically all distros when in live mode, including big players like Ubuntu, Fedora, Arch, etc.

If you don't want to have a given application in RAM, one option is to look for a portable one that can run from an external storage unit, like Steam, for example. But that's rare and usually they all (including appimages, flatpacks and snaps) need to go to the filesystem in order to run, which in the case of Porteus it means RAM.

appEnigma
White ninja
White ninja
Posts: 18
Joined: 17 Jun 2023, 12:44
Distribution: Linux

How does .xzm files actually work

Post#6 by appEnigma » 19 Jun 2023, 17:44

Thank you. That clears a lot :happy62:

Post Reply