Self-updating PorteuX

PorteuX - The Next Experience. It's inspired by Slax and Porteus but with heaps of improvements
rych
Warlord
Warlord
Posts: 787
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Self-updating PorteuX

Post#31 by rych » 07 Apr 2025, 09:24

porteux wrote:
06 Apr 2025, 22:17
instead of patching the system using rootcopy or savechanges, you can just extract the module that contains the file that needs to be changed, make the change then recreate the module
Ah, yes, that's right.
porteux wrote:
06 Apr 2025, 22:17
zstd PorteuX default:
0m1.070s
647.1 MB

lz4 default:
0m0.891s
1.0 GB
Hm. There is a very positive testimony from roadie dir2lz4 anyone?. I'm following that thread for more.

rych
Warlord
Warlord
Posts: 787
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Self-updating PorteuX

Post#32 by rych » 02 Jun 2025, 10:04

porteux wrote:
03 Apr 2025, 18:01
Please, edit /etc/rc.d/rc.4 and replace this
I have removed this patch in preparation for update to v2.1. Also I've patched my script, as follows

Code: Select all

#the following comparison is lexicographical so for example 1.8.10<1.8.9
#if [[ $latest > $current ]]; then
if [[ $(printf '%s\n' "$current" "$latest" | sort -V | tail -n1) != "$current" ]]; then
-- I can't edit earlier posts here, but I can on the Telegram: so it's updated there: https://t.me/PorteusX/98/100

By the way, I rely on DeepSeek to get the ball rolling writing these little bash scripts, but have to be careful. When I pointed out to him that his suggested line ```if [[ $latest > $current ]]; then``` was a lexicographical comparison, he said "oh shit", and gave me a solution with printf, which was ALSO buggy. I had to find out those bugs and come up with the final solution myself. I think despite rapid progress a human programmer/tester/advanced user is still needed.

Turning back to the topic, when updating porteux distribution, one shouldn't contaminate its renewed system with left-over changes from previous version. I mean the /etc folder for example. I've decided to remove it from changes-exit.conf:
#/etc
/etc/gtk*
/etc/changes-exit.conf
-- so will add any /etc lines very economically only for the files I actually need to be persistent right there. For example those gtk settings should more properly live in my home directory, and are just temporary modified in the /etc.
Last edited by rych on 02 Jun 2025, 10:08, edited 2 times in total.

rych
Warlord
Warlord
Posts: 787
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Self-updating PorteuX

Post#33 by rych » 02 Jun 2025, 10:05

The update went like this:

Code: Select all

root@porteus:~# update_porteux 
2.1 > 2.0

Getting latest ISO
porteux-v2.1-curren 100%[===================>] 478.00M  14.2MB/s    in 41s     
Updating base
Updating other modules
updating 05-devel in optional
devel-current.zip   100%[===================>] 177.87M  11.0MB/s    in 19s     
Archive:  /mnt/sda5/porteux/backup2.0/download/devel-current.zip
 extracting: /mnt/sda5/porteux/optional/05-devel-current-20250530.xzm  
updating 0050-multilib in optional
multilib-current.zi 100%[===================>] 123.05M  13.2MB/s    in 8.6s    
Archive:  /mnt/sda5/porteux/backup2.0/download/multilib-current.zip
 extracting: /mnt/sda5/porteux/optional/0050-multilib-lite-current-20250530.xzm  
updating 08-nvidia in optional
nvidia-driver-curre 100%[===================>] 444.92M  15.1MB/s    in 34s     
Archive:  /mnt/sda5/porteux/backup2.0/download/nvidia-driver-current.zip
 extracting: /mnt/sda5/porteux/optional/08-nvidia-575.57.08-k.6.15.0-porteux-x86_64.xzm  
 
Old files are saved in
/mnt/sda5/porteux/backup2.0:
base
download
initrd.zst
optional
vmlinuz

/mnt/sda5/porteux/backup2.0/base:
000-kernel-6.14.xzm
001-core-current-20250401.xzm
002-gui-current-20250401.xzm
002-xtra-current-20250401.xzm
003-lxde-0.10.1-current-20250401.xzm

/mnt/sda5/porteux/backup2.0/download:
devel-current.zip
multilib-current.zip
nvidia-driver-current.zip
porteux-v2.1-current-lxde-0.11.1-x86_64.iso

/mnt/sda5/porteux/backup2.0/optional:
0050-multilib-lite-current-20250401.xzm
05-devel-current-20250401.xzm
08-nvidia-570.133.07-k.6.14.0-porteux-x86_64.xzm
 
Would you like to delete the entire /mnt/sda5/porteux/backup2.0? [y/N] 
root@porteus:~# 

porteux
Shogun
Shogun
Posts: 288
Joined: 12 Mar 2023, 22:10
Distribution: PorteuX

Self-updating PorteuX

Post#34 by porteux » 02 Jun 2025, 13:05

@rych, just a reminder that 06-crippled_sources-[version].xzm module has been renamed to 06-crippled-sources-[version].xzm, i.e. underscore replaced with dash.

rych
Warlord
Warlord
Posts: 787
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Self-updating PorteuX

Post#35 by rych » 07 Jun 2025, 11:13

porteux wrote:
02 Jun 2025, 13:05
just a reminder that 06-crippled_sources-[version].xzm module has been renamed to 06-crippled-sources-[version].xzm
Thanks, I changed that spelling.

Also, instead of comparing version number, I'm thinking of comparing individual modules and only downloading and installing those that changed, including the base modules inside iso file, to allow for individual module updates that don't trigger PorteuX version increment. For example, you've just updated a module calling it 2.1.1 patch, yet

Code: Select all

cat /etc/os-release
still shows 2.1. Is it the one and only way PorteuX (and porteus) is self-aware of its own version number? Otherwise, my updater will have to have some persistent knowledge on what version it installed last :)

Simply put, you forgot or intended to leave /etc/os-release version number unchanged, so 2.1.1>2.1 is always true in my update_porteux if statement :) It's a small thing, but leads to the above consideration: should there even be such a thing as a version number for the always current, rolling PorteuX?

porteux
Shogun
Shogun
Posts: 288
Joined: 12 Mar 2023, 22:10
Distribution: PorteuX

Self-updating PorteuX

Post#36 by porteux » 08 Jun 2025, 10:41

@rych, PorteuX version is in a file inside 001-core, but because 2.1.1 only updated 002-gui we didn't ship the new version number. Gonna think about a better solution for the next time we need to release a hotfix.

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

Self-updating PorteuX

Post#37 by Ed_P » 08 Jun 2025, 17:50

Or an update script needs to be more flexible. :) Dates work?

rych
Warlord
Warlord
Posts: 787
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

Self-updating PorteuX

Post#38 by rych » 10 Jun 2025, 04:40

porteux wrote:
08 Jun 2025, 10:41
PorteuX version is in a file inside 001-core, but because 2.1.1 only updated 002-gui we didn't ship the new version number. Gonna think about a better solution for the next time we need to release a hotfix.
Ideally my updater shouldn't even look that deep for the installed version number. Why don't we have a file in the /porteux folder, for example, version.txt with the installed iso filename in the top line? Parsing that line my script will also automatically deduce the DE and channel:

Code: Select all

/porteux/version.txt:
porteux-v2.1.1-current-lxqt-2.2.0-x86_64

Post Reply