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#1 by rych » 08 Feb 2025, 11:40

I'd like to always run the latest release of PorteuX. I have been doing it manually and never encountered anything breaking in my set-up, at least on the current channel, of lxde flavour.

Similar to how Porteus self-updates base modules on request, I'd like to make a script that runs automatically once per session, checking for example:

Code: Select all

curl -s https://api.github.com/repos/porteux/porteux/releases/latest | grep -Po '"tag_name": "\K.*?(?=")'
and if it's different to the current

Code: Select all

cat /etc/os-release | grep VERSION
, download the new .iso file, extract the new versions of modules etc.

The previous version of activated modules can often be renamed and then deleted on the reboot. Not sure about initrd.zst and vmlinuz. Porteus self-updating script cannot replace active base modules in-place: it does it on reboot. So do most self-updating applications. Take Firefox or any browser for example: it' quietly downloads the new version and updates it on the program restart.

So, basically, in 2025 I don't want to know which particular PorteuX v1.* I'm running: I just want it to always be the latest, until an update breaks something, but I'm willing to take that risk.

@porteux and @all could you help me develop such a script and let me hear your thoughts and objections to this idea please.

User avatar
M. Eerie
Moderator
Moderator
Posts: 711
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

Self-updating PorteuX

Post#2 by M. Eerie » 09 Feb 2025, 19:54

HI.

This is how I'm downloading Porteux current these days...

Hope it helps.
> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=102066#p102066
https://forum.porteus.org/viewtopic.php?p=102306#p102306
https://forum.porteus.org/viewtopic.php?p=72741#p72741

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#3 by Ed_P » 09 Feb 2025, 21:21

When I tried running a version of your script, I named Erie.sh, I got this:

Code: Select all

guest@porteux:/mnt/nvme0n1p7/porteux$ ./Erie.sh
La dependencia 'fzf' no está instalada.
guest@porteux:/mnt/nvme0n1p7/porteux$ 
The dependency 'fzf' is not installed. Is there an .xzm file for it?

beny
Full of knowledge
Full of knowledge
Posts: 2275
Joined: 02 Jan 2011, 11:33
Location: italy

Self-updating PorteuX

Post#4 by beny » 09 Feb 2025, 21:45

hi there is a slackbuild for this package:

fzf - A command-line fuzzy finder written in Go

Vim Users: A fzf.vim plugin is installed to
/usr/share/vim/vimfiles/plugin. If you'd rather exclude the plugin,
or only manually enable it in your vim, you can build with:

WITH_VIM=no ./fzf.SlackBuild

and the plugin will be installed to /usr/share/fzf/vim/ instead.

NOTE: google-go-lang is only needed at compile time - not at runtime.

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#5 by Ed_P » 09 Feb 2025, 21:49

Is there an .xzm module for it?

beny
Full of knowledge
Full of knowledge
Posts: 2275
Joined: 02 Jan 2011, 11:33
Location: italy

Self-updating PorteuX

Post#6 by beny » 09 Feb 2025, 22:09

https://slackware.nl/slakfinder/index.p ... e=#results
this is the link to the search web page: https://slackware.nl/slakfinder/ . if you have to search again

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#7 by Ed_P » 09 Feb 2025, 23:04

When I click on the fzf download link on your webpage I get this beny:
Image

This don't help either:

Code: Select all

guest@porteux:/mnt/nvme0n1p7/porteux$ slapt-get fzf
bash: slapt-get: command not found
guest@porteux:/mnt/nvme0n1p7/porteux$ su
Password: 
root@porteux:/mnt/nvme0n1p7/porteux# slapt-get
bash: slapt-get: command not found
root@porteux:/mnt/nvme0n1p7/porteux# slapt-mod
bash: slapt-mod: command not found
root@porteux:/mnt/nvme0n1p7/porteux# 

beny
Full of knowledge
Full of knowledge
Posts: 2275
Joined: 02 Jan 2011, 11:33
Location: italy

Self-updating PorteuX

Post#8 by beny » 09 Feb 2025, 23:21

the link work ok on my browser,and fzf is a salix package so you can download it with slapt-mod

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#9 by Ed_P » 09 Feb 2025, 23:33

Easier to do in Porteus.

Code: Select all

root@porteus:/home/guest# slapt-mod -m fzf
Reading Package Lists...Done
The following NEW packages will be installed:
  fzf 
0 upgraded, 0 reinstalled, 1 newly installed, 0 to remove, 0 not upgraded.
Need to get 875.0kB of archives.
Do you want to continue? [y/N] y
1/1 Get http://slackware.uk/salix/x86_64/extra-15.0/ fzf 0.30.0-x86_64-1salix15.0 [875.0kB]...Done

Done
Verifying package fzf-0.30.0-x86_64-1salix15.0.txz.
Installing package fzf-0.30.0-x86_64-1salix15.0.txz:
PACKAGE DESCRIPTION:
# fzf (A command-line fuzzy finder written in Go)
#
# fzf is a general-purpose command-line fuzzy finder.
#
# https://github.com/junegunn/fzf
#
Executing install script for fzf-0.30.0-x86_64-1salix15.0.txz.
Package fzf-0.30.0-x86_64-1salix15.0.txz installed.
Parallel mksquashfs: Using 8 processors
Creating 4.0 filesystem on /tmp/fzf-0.30.0-x86_64-1salix15.0.xzm, block size 262144.
[======================================================================|] 19/19 100%

Exportable Squashfs 4.0 filesystem, zstd compressed, data block size 262144
	compressed data, compressed metadata, compressed fragments,
	compressed xattrs, compressed ids
	duplicates are removed
Filesystem size 939.32 Kbytes (0.92 Mbytes)
	38.73% of uncompressed filesystem size (2425.53 Kbytes)
Inode table size 533 bytes (0.52 Kbytes)
	34.45% of uncompressed inode table size (1547 bytes)
Directory table size 510 bytes (0.50 Kbytes)
	51.62% of uncompressed directory table size (988 bytes)
Number of duplicate files found 0
Number of inodes 44
Number of files 10
Number of fragments 1
Number of symbolic links 5
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 29
Number of ids (unique uids + gids) 1
Number of uids 1
	root (0)
Number of gids 1
	root (0)
chown: warning: '.' should be ':': ‘guest.’
 
====> '/tmp/fzf-0.30.0-x86_64-1salix15.0.xzm' was created successfully.
 
root@porteus:/home/guest# 
Added in 2 hours 15 minutes 17 seconds:
And we're done with this.

Code: Select all

guest@porteux:/mnt/nvme0n1p7/porteux$ ./Erie.sh
La dependencia 'jq' no está instalada.
guest@porteux:/mnt/nvme0n1p7/porteux$ 

vinnie
Shogun
Shogun
Posts: 210
Joined: 13 Jun 2024, 08:25
Distribution: alpine

Self-updating PorteuX

Post#10 by vinnie » 10 Feb 2025, 07:56

You need to install also jq, I tried it and it works (nice).
I have little understanding of how it works, basically after you launch it it works that you write the repository (the final two parts) and then press CTRL+A to add. When they are in the list if you click on it, it tells you what is there to download in the latest release (when it can parse).
Or you can use topics which I'm not sure what they are but I think it uses github search

User avatar
M. Eerie
Moderator
Moderator
Posts: 711
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce/MATE x64

Self-updating PorteuX

Post#11 by M. Eerie » 10 Feb 2025, 09:28

vinnie wrote:
10 Feb 2025, 07:56
Or you can use topics which I'm not sure what they are but I think it uses github search
You've described it (almost) perfectly. THANKS.

For convenience, I have translated the script and added the complete instructions in the original post. :)
> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=102066#p102066
https://forum.porteus.org/viewtopic.php?p=102306#p102306
https://forum.porteus.org/viewtopic.php?p=72741#p72741

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

Self-updating PorteuX

Post#12 by porteux » 10 Feb 2025, 13:21

rych wrote:
08 Feb 2025, 11:40
@porteux and @all could you help me develop such a script and let me hear your thoughts and objections to this idea please.
From our side, what we can provide is this script to detect a new version and download it:

Code: Select all

#!/bin/bash

repository=porteux
project=porteux
porteuxChannel=current
desktopEnvironment=lxde

porteuxCurrentVersion=$(cat /etc/os-release | grep VERSION | cut -f 2 -d '"' | head -1)
porteuxLatestVersion=$(curl -s https://github.com/${repository}/${project}/tags/ | grep "/${repository}/${project}/releases/tag/" | grep -oP "(?<=/${repository}/${project}/releases/tag/)[^\"]+" | uniq | grep -v "alpha" | grep -v "beta" | grep -v "rc[0-9]" | grep -v "master." | grep -v "clutter-keyring-dialog" | head -1)

if [[ ${porteuxLatestVersion//v} > ${porteuxCurrentVersion} ]]; then
	porteuxIso=$(curl -s https://api.github.com/repos/${repository}/${project}/releases/latest | grep ${porteuxChannel} | grep ${desktopEnvironment} | grep url | cut -f 4 -d '"')
	wget ${porteuxIso}
fi
Now, how you're going to extract the ISO content and copy the files I'll leave to you. Maybe $PORTDIR variable can help you.

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#13 by Ed_P » 10 Feb 2025, 17:19

:o :celebrate3: Nicely done porteux. :worship:

I would suggest a simple 'echo "Current=$porteuxCurrentVersion"' and 'echo "Latest=$porteuxLatestVersion"' line before the "if" line to inform the user the status of the system and why no download is happening. :)

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

Self-updating PorteuX

Post#14 by rych » 24 Feb 2025, 13:10

porteux wrote:
10 Feb 2025, 13:21
From our side, what we can provide is
For future releases could you maybe unpack the 2 nvidia-driver zips on the server side - archives with a single 08-nvidia xzm inside? So, 2 xzms 08-nvidia-current and -stable? And then those zips aren't even needed?

For example, please refer to https://github.com/porteux/porteux/releases/tag/v1.9

Otherwise my update_porteux script has to deal with the special case of the 08-nvidia- .xzm that only lives inside the nvidia-driver- zip on the server unlike all other xzms I'm updating.

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

Self-updating PorteuX

Post#15 by porteux » 24 Feb 2025, 14:42

@rych,

Those files are in .zip format to make things easier for the App Store. We don't need to care about filename changes because they're fixed regardless of the driver version (i.e. always 'nvidia-driver-stable.zip' and 'nvidia-driver-current.zip').

I guess you can take advantage of that too, no?

Post Reply