Page 1 of 3

Self-updating PorteuX

Posted: 08 Feb 2025, 11:40
by rych
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.

Self-updating PorteuX

Posted: 09 Feb 2025, 19:54
by M. Eerie
HI.

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

Hope it helps.

Self-updating PorteuX

Posted: 09 Feb 2025, 21:21
by Ed_P
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?

Self-updating PorteuX

Posted: 09 Feb 2025, 21:45
by beny
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.

Self-updating PorteuX

Posted: 09 Feb 2025, 21:49
by Ed_P
Is there an .xzm module for it?

Self-updating PorteuX

Posted: 09 Feb 2025, 22:09
by beny
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

Self-updating PorteuX

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

Self-updating PorteuX

Posted: 09 Feb 2025, 23:21
by beny
the link work ok on my browser,and fzf is a salix package so you can download it with slapt-mod

Self-updating PorteuX

Posted: 09 Feb 2025, 23:33
by Ed_P
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$ 

Self-updating PorteuX

Posted: 10 Feb 2025, 07:56
by vinnie
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

Self-updating PorteuX

Posted: 10 Feb 2025, 09:28
by M. Eerie
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. :)

Self-updating PorteuX

Posted: 10 Feb 2025, 13:21
by porteux
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.

Self-updating PorteuX

Posted: 10 Feb 2025, 17:19
by Ed_P
: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. :)

Self-updating PorteuX

Posted: 24 Feb 2025, 13:10
by rych
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.

Self-updating PorteuX

Posted: 24 Feb 2025, 14:42
by porteux
@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?