Updating modules

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
User avatar
tmsg
Black ninja
Black ninja
Posts: 44
Joined: 15 Sep 2015, 14:29
Distribution: arch, mx, porteus
Location: York, UK

Updating modules

Post#1 by tmsg » 06 Dec 2015, 16:28

I am in the process of "cleaning up" my save.dat. There's a helpful script called update-module which copies changed files into a module. My understanding of this process is that the script checks whether a file that is in the module is also in live changes. If so, that file is copied back into the module (I'm leaving out the finer details of unpacking/packing the module and copying stuff into a /tmp directory).

This prompts a couple of questions. First and foremost, for this updating process to be foolproof (in theory at least) one would either need intimate knowledge as to which files are stored in what module or one would have to apply the update to all modules. My reasoning is as follows: say /usr/bin/whatever is both in 000-core and 07-somemod. In this case the copy in 07-somemod "wins", ie is the version that makes it into the live filesystem. If I now change /usr/bin/whatever and update 07-somemod, all seems to be well. If, however, 07-somemod is not activated for some reason, the (not updated) copy in 000-core wins. So either I *know* that /usr/bin/whatever needs updating in those two modules or I have to update *all* modules. (I'm talking here about the most general case.)

Case in point: Let's say I've just compiled a new version of 7zip and I now want to propagate this new version to all modules that have a copy (000-core and 05-devel). In this case that's no big deal because it's just one file... but in general? How do others deal with that?

Second question. Let's say I've updated module X and want to get rid of the updated files in the live system because they're now in module X. How do I find those files?

User avatar
brokenman
Site Admin
Site Admin
Posts: 5574
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Updating modules

Post#2 by brokenman » 06 Dec 2015, 17:36

one would either need intimate knowledge as to which files are stored in what module
There is a complete file list of packages (for 001-core.xzm) in: /mnt/live/memory/images/001-core.xzm/var/log/packages
Let's say I've updated module X and want to get rid of the updated files in the live system because they're now in module X.
The live file system comes from the modules. So once you remove it from the module, rebooting will remove it from the live file system. If you are saving changes then you could remove it with: removepkg X and make sure no module is loading it again.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
tmsg
Black ninja
Black ninja
Posts: 44
Joined: 15 Sep 2015, 14:29
Distribution: arch, mx, porteus
Location: York, UK

Re: Updating modules

Post#3 by tmsg » 07 Dec 2015, 14:10

brokenman wrote:
Let's say I've updated module X and want to get rid of the updated files in the live system because they're now in module X.
The live file system comes from the modules. So once you remove it from the module, rebooting will remove it from the live file system. If you are saving changes then you could remove it with: removepkg X and make sure no module is loading it again.
Yes, the question was not put correctly. What I want (and that is the whole purpose of the exercise) is to move (some of) those files which have changed (ie for which a newer version exists in /mnt/live/memory/changes/) back into their respective module(s) AND remove them from the .../changes tree, ie save.dat.
I am not sure that this is at all worthwhile but doing it will give me some understanding as to how modules/save.dat/livefs etc. work.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4617
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Updating modules

Post#4 by fanthom » 07 Dec 2015, 20:02

@tmsg
First part could be done with /opt/porteus-scripts/update-module script. Perhaps you could tweak it to remove duplicates from changes but it may make the system unstable. I have created it for running only in the 'always fresh' mode which is perfect for experiments.
Please add [Solved] to your thread title if the solution was found.

Post Reply