[Porteus 5.0's USM replacement] getmod: A wrapper for slapt-get to build modules

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
Ed_P
Contributor
Contributor
Posts: 8315
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus 5.0's USM replacement: slapt-get, getmod

Post#76 by Ed_P » 29 Sep 2022, 17:18

babam wrote:
29 Sep 2022, 09:30
I leave this thread to you.
no, no, no babam. You developed this great utility and we want you to enjoy it's notoriety. :D

In our searching the web for more info on slapt-get we encountered this link: https://software.jaos.org/git/slapt-get/plain/FAQ and it's point number 17. Have you seen it?
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus 5.0's USM replacement: slapt-get, getmod

Post#77 by Rava » 29 Sep 2022, 17:43

@babam I will edit the initial post as you said I should and write in the "reason" section that I only did some minor cosmetic moving around, since it will be no more than that.

In my book it should be made clear why getmod is a great idea. :)
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus 5.0's USM replacement: slapt-get, getmod

Post#78 by Rava » 30 Sep 2022, 03:08

I created for my own convenience an activate-011-slapt-get to have the symlinks done automatically and to also not have to remember where I put the module. I put activate-011-slapt-get into /usr/local/bin like with all my scripts.

It is only meant to be run by root and run by root only:

Code: Select all

root@porteus:/usr/local/bin# ls -l activate-011-slapt-get
-rwxr--r-- 1 root root 1758 2022-09-30 04:39 activate-011-slapt-get
If you use the code make sure to adjust the path to where your own 011-slapt-get-0.11.6-x86_64-2gv.xzm sits in your system.
For reference I use the fake path of /MYMODULESPATH/ - in all caps so that it's easier to spot what you need to edit.
The code itself is not the most elegant one, but it works. Image And it has a minimum of sanity checks.

CAVE! Do not change the ownership or permissions. My script has not the ability to ask for the root password. It needs only be executable by root and root.root needs to be the owner and group of it.

CAVE2! It uses colour codes that are by default not part of your system. When such codes not exist in your system your version of the script just doesn't display colours.
Examples are ${bld}${yel} for bold + yellow or
${off} for switching the colour and bold off. I cannot post the code of the file I use for that here since it uses escape sequences and that won't work as [ code ] (tput is a better alternative but many of my scripts are based on years old code and I just use the same basic method as back then and me is too lazy to edit dozens of scripts into using tput - and you have to debug the new versions if there is now an error added by mistake or not)

Code: Select all

#!/bin/sh
VERSION="0.3" # added parameter -i aka --info
MYNAME="activate-011-slapt-get"

echo -e "${bld}${yel}$MYNAME$off V$yel$VERSION${off}"

actifile="/MYMODULESPATH/011-slapt-get-0.11.6-x86_64-2gv.xzm"

if [ -f "$actifile" ] ; then
	# file exists
	file "$actifile" | grep "Squashfs filesystem" 2>&1 >/dev/null
	declare -i returnval=$?
	if [ $returnval -eq 0 ] ; then
		# and is of file type "Squashfs filesystem"
		if [ $# -eq 1 ]; then
		    # one parameter given, check if its -i or --info
		    if [ "$1" = "-i"  -o "$1" = "--info" ]; then
			echo "Parameter -i aka --info given, show only info about module to be loaded when starting this script without any parameter:"
			/bin/ls -oatr --time-style=long-iso "$actifile"|cut -c 19-
			du -m "$actifile"
			exit 0
		    else
			echo  -e ${red}"Error- Unknown parameter, only '-i' or '--info' is supported! Abort!"${off}not
			exit 3
		    fi
		elif [ $# -gt 1 ]; then
		    echo  -e ${red}"Error- Only one valid parameter '-i' or '--info'! Abort!"${off}
		    exit 3
		else
		    echo activate "$actifile"
		    activate "$actifile"
		fi
	else
		echo -e ${red}"Error- File to activate
$actifile
is not of file type 'Squashfs filesystem'. Abort!"${off}
		exit 2
	fi
else
	echo -e ${red}"Error- File to activate
$actifile
not found. Abort!"${off}
exit 1
fi

echo cd /var/lib/pkgtools/packages
cd /var/lib/pkgtools/packages
ln -vs gtk3-classic* gtk+3-3.24.33-x86_64-1
ln -vs boost-stripped* boost-1.78.0-x86_64-1
ln -vs llvm-stripped* llvm-13.0.0-x86_64-1

# v0.2 added sanity check file "$actifile" | grep "Squashfs filesystem"
# v0.3 added parameter -i / --info
this is what it looks like when executed:

Code: Select all

root@porteus:/usr/local/bin# activate-011-slapt-get 
activate-011-slapt-get V0.3
activate /MYMODULESPATH/011-slapt-get-0.11.6-x86_64-2gv.xzm
Updating shared library links:  /sbin/ldconfig
cd /var/lib/pkgtools/packages
'gtk+3-3.24.33-x86_64-1' -> 'gtk3-classic-3.24.33-x86_64-2ncm'
'boost-1.78.0-x86_64-1' -> 'boost-stripped-1.78.0-x86_64-2_slack15.0'
'llvm-13.0.0-x86_64-1' -> 'llvm-stripped-13.0.0-x86_64-2'
and this is the result of using

Code: Select all

activate-011-slapt-get
instead of running

Code: Select all

activate /MYMODULESPATH/011-slapt-get-0.11.6-x86_64-2gv.xzm
:

Code: Select all

root@porteus:/# cd /var/lib/pkgtools/packages
root@porteus:/var/lib/pkgtools/packages# ls -o gtk+3-3.24.33-x86_64-1 boost-1.78.0-x86_64-1 llvm-13.0.0-x86_64-1
lrwxrwxrwx 1 root 40 2022-09-30 04:40 boost-1.78.0-x86_64-1 -> boost-stripped-1.78.0-x86_64-2_slack15.0
lrwxrwxrwx 1 root 32 2022-09-30 04:40 gtk+3-3.24.33-x86_64-1 -> gtk3-classic-3.24.33-x86_64-2ncm
lrwxrwxrwx 1 root 29 2022-09-30 04:40 llvm-13.0.0-x86_64-1 -> llvm-stripped-13.0.0-x86_64-2
:)
Last edited by Rava on 30 Sep 2022, 03:14, edited 1 time in total.
Reason: info on tput
Cheers!
Yours Rava

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

Porteus 5.0's USM replacement: slapt-get, getmod

Post#79 by Ed_P » 30 Sep 2022, 17:30

An impressive script Rava.

For those that might like something shorter I suggest:

slapt-get.sh

Code: Select all

#!/bin/sh

MODPATH="/MYMODULESPATH"                       # Edit accordingly to your module's path
MODULE="011-slapt-get-0.11.6-x86_64-2gv.xzm"   # Edit accordingly to your module's name 
PSWD=toor                                      # Password for the root account
#set -x;

if [ ! -e /mnt/live/memory/images/$MODULE ]; then
   echo $PSWD | sudo -S activate $MODPATH/$MODULE > /dev/null 2>&1 &
   sleep 2
   echo $MODULE activated.
   cd /var/lib/pkgtools/packages
   ln -vs gtk3-classic* gtk+3-3.24.33-x86_64-1
   ln -vs boost-stripped* boost-1.78.0-x86_64-1
   ln -vs llvm-stripped* llvm-13.0.0-x86_64-1
   sleep 1
   ls -o gtk+3-3.24.33-x86_64-1 boost-1.78.0-x86_64-1 llvm-13.0.0-x86_64-1 
else
   echo $FOLDER/$MODULE not found.
   sleep 7
fi
If you'd like to add colors supported in Porteus 5.0 Rava:

Code: Select all

# Colors                          # ignisdownloader.sh
WHITE="\e[1;37m"                  # https://techstop.github.io/bash-script-colors/
CYAN="\e[1;96m"                   # Regular   - \e[0;**m
PURPLE="\e[1;35m"                 # Bold      - \e[1;**m
BLUE="\e[1;94m"                   # Underline - \e[4;**m
YELLOW="\e[1;93m"                 # High Intensity - \e[0;9*m
GREEN="\e[1;32m"
RED="\e[1;31m"
BLACK="\e[1;30m"
BOLD="\e[1m"
CLR="\e[0m"

# Color definitions               # ups.sh
txtbld=$(tput bold)               # Bold
rst=$(tput sgr0)                  # Reset
function Bold() {
  echo -e $txtbld"$1"$rst "$2"; 
}

function Title() {
  echo -en "\033]0;$1\a";
}

echo -e "$BOLD" "$YELLOW" " ***Flash Games ***""$CLR"

Hope those help.
Ed

Testuser
Samurai
Samurai
Posts: 136
Joined: 26 May 2021, 15:11
Distribution: Porteus-v5.0-64-LXDE

Porteus 5.0's USM replacement: slapt-get, getmod

Post#80 by Testuser » 30 Sep 2022, 18:54

Guys from this forum I got Gslapt-get.xzm (GUI version of slapt-get). With this we can search for a package and it will download all the dependencies as well.

But at start of installation the program is exiting. Dont know why.

But I have the package and dependencies download in "/var/slapt-get" folder and can convert all of them into once single module.

If we can fix that issue, then we will have a working GUI tool as package manager, right?

Or is that everyone trying to find :unknown:

:roll: :oops: :no: :unknown:

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus 5.0's USM replacement: slapt-get, getmod

Post#81 by Rava » 30 Sep 2022, 19:11

Testuser wrote:
30 Sep 2022, 18:54
Guys from this forum I got Gslapt-get.xzm (GUI version of slapt-get)
Can you give us a link to that post with the download URL?

Can you try starting the program via terminal (as user guest) so that you can tell us about possible error messages (e.g. missing library or such)?

Update
My bad, I gave the above generic tips without creating the xzm and activating it.
I now have activated gslapt-0.5.9-x86_64-4gv.xzm and realized that aside from the /usr/bin/gslapt-polkit script gslapt sits in /usr/sbin/ and binaries in sbin are meant to be only accessible for root, so telling you to try starting it as guest should fail, e.g. like so:

Code: Select all

guest@porteus:~$ gslapt
bash: gslapt: command not found
guest@porteus:~$ cd /usr/sbin/
guest@porteus:/usr/sbin$ l gslapt 
-rwxr-xr-x 1 root 114768 2022-07-10 21:24 gslapt
guest@porteus:/usr/sbin$ ./gslapt 
/var/slapt-get: Permission denied
Please update permissions on /var/slapt-get or run with appropriate privileges
But when executed as root like so

Code: Select all

root@porteus:/# gslapt
it works like a charm:
Image
:celebrate14:

Trying to start it via the main menu via System / Gslapt Package Manager results in only this:
Image
reason: /usr/share/applications/gslapt.desktop uses this

Code: Select all

Exec=gksu /usr/sbin/gslapt
and gksu is not part of Porteus
info on gksu e.g. here https://slakfinder.org/show.php?pkg=1716358
| gksu (Gtk+ frontend to su and sudo)
|
| GKSu is a library that provides a Gtk+ frontend to su and sudo.
| It supports login shells and preserving environment when acting as
| a su frontend. It is useful to menu items or other graphical
| programs that need to ask a user's password to run another program
| as another user.
|
| Homepage: http://www.nongnu.org/gksu/
(So far I only ran it and did not try downloading anything with it…
and I used the download from beny's post :good: just below this one…)
Cheers!
Yours Rava

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

Porteus 5.0's USM replacement: slapt-get, getmod

Post#82 by beny » 30 Sep 2022, 19:26

hi this work: https://slakfinder.org/index.php?act=se ... e=#results
or we can download via getmod, but the download rate of the packages are too slow

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

Porteus 5.0's USM replacement: slapt-get, getmod

Post#83 by Ed_P » 30 Sep 2022, 19:33

Clicking on the /download link simply displays the hex code with Firefox. :o
Ed

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

Porteus 5.0's USM replacement: slapt-get, getmod

Post#84 by beny » 30 Sep 2022, 19:36

hi the gslapt for porteus is an eye candy well download all the packages and install witout convert into xzm do not merge so the getmod utility is the standard of the porteus package manager slapt-get
Rava you have to click on the name to download from the salix repos

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus 5.0's USM replacement: slapt-get, getmod

Post#85 by Rava » 30 Sep 2022, 19:37

Ed_P wrote:
30 Sep 2022, 19:33
Clicking on the /download link simply displays the hex code with Firefox. :o
Weird, hovering on it with Palemoon displays

Code: Select all

https://download.salixos.org/x86_64/15.0/salix/xap/gslapt-0.5.9-x86_64-4gv.txz
Cheers!
Yours Rava

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

Porteus 5.0's USM replacement: slapt-get, getmod

Post#86 by Ed_P » 30 Sep 2022, 19:40

This tweaked link looks promising: https://slakfinder.org/index.php?act=do ... e=#results

Added in 1 minute 57 seconds:
Same results as before with Firefox. :(

Added in 2 minutes 1 second:
And same results with your link Rava. :shock:
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus 5.0's USM replacement: slapt-get, getmod

Post#87 by Rava » 30 Sep 2022, 19:47

Ed_P wrote:
30 Sep 2022, 19:40
This tweaked link looks promising: https://slakfinder.org/index.php?act=do ... e=#results
It has i586 and x86-64 - and all distros - therefore the long list. beny's made the selection of only choosing 15.0 and x86-64…
Ed_P wrote:
30 Sep 2022, 19:42
Same results as before with Firefox. :(
And same results with your link Rava. :shock:
That is … troubling. Are you sure your system not got compromised?
Try rebooting.
Or try rebooting and trying palemoon.
Current version is

Code: Select all

root@porteus:~# palemoon --version
Moonchild Productions Pale Moon 31.3.0.1
B)

Added in 1 minute 19 seconds:
Ed_P
I forgot: The links are indeed binary files. FFx should not try to display them but should download them.

Added in 52 seconds:
Maybe some setup in your FFx got corrupted? Do you have an older FFx setup that you saved?
Cheers!
Yours Rava

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

Porteus 5.0's USM replacement: slapt-get, getmod

Post#88 by Ed_P » 30 Sep 2022, 19:50

This one works, for an older version: https://slacky.eu/repository/slackware6 ... 64-1sl.txz :good:

Apparently slaxfinder's mirrors are not all updated.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus 5.0's USM replacement: slapt-get, getmod

Post#89 by Rava » 30 Sep 2022, 19:54

The link I posted seems legit:

Code: Select all

guest@porteus:/mnt/sda4/tmp$ wget https://download.salixos.org/x86_64/15.0/salix/xap/gslapt-0.5.9-x86_64-4gv.txz
--2022-09-30 21:53:33--  https://download.salixos.org/x86_64/15.0/salix/xap/gslapt-0.5.9-x86_64-4gv.txz
Resolving download.salixos.org (download.salixos.org)... 37.59.61.63
Connecting to download.salixos.org (download.salixos.org)|37.59.61.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 133208 (130K) [text/plain]
Saving to: ‘gslapt-0.5.9-x86_64-4gv.txz’

gslapt-0.5.9-x86_64 100%[===================>] 130.09K  --.-KB/s    in 0.1s    

2022-09-30 21:53:34 (1.22 MB/s) - ‘gslapt-0.5.9-x86_64-4gv.txz’ saved [133208/133208]

guest@porteus:/mnt/sda4/tmp$ file gslapt-0.5.9-x86_64-4gv.txz 
gslapt-0.5.9-x86_64-4gv.txz: XZ compressed data, checksum CRC64
Added in 29 seconds:

Code: Select all

guest@porteus:/mnt/sda4/tmp$ md5sum gslapt-0.5.9-x86_64-4gv.txz 
f89a591aecc5cd1cab72423da2b7d66c  gslapt-0.5.9-x86_64-4gv.txz
Cheers!
Yours Rava

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

Porteus 5.0's USM replacement: slapt-get, getmod

Post#90 by beny » 30 Sep 2022, 20:00

hi all but someone remember the command save link as....

Post Reply