No txz2dir in 3.1 Porteus ?

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

No txz2dir in 3.1 Porteus ?

Post#1 by Rava » 13 Feb 2016, 05:40

Seems, in current Porteus (3.1 XFCe, x86-64) there is no longer a txz2dir:

Code: Select all

root@porteus:/mnt/live/memory/images# find . |grep txz2dir
root@porteus:/mnt/live/memory/images# 
Does anyone have the script at hand that works well in this version?


I duckduckgo'd forit, and the only distro that I found is: wifislax 4.10.1 or 4.11.1 VMware Edition , which is > 1.1 GB, and quite the overkill to download for a tiny script as such... :wall:
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 3156
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: No txz2dir in 3.1 Porteus ?

Post#2 by Ed_P » 13 Feb 2016, 07:14

Rava wrote:Seems, in current Porteus (3.1 XFCe, x86-64) there is no longer a txz2dir:

Code: Select all

root@porteus:/mnt/live/memory/images# find . |grep txz2dir
root@porteus:/mnt/live/memory/images# 
Does anyone have the script at hand that works well in this version?
Not in 3.0 either.

Code: Select all

guest@porteus:~$ txz2dir
bash: txz2dir: command not found
guest@porteus:~$ su
Password: 
root@porteus:/home/guest# txz2dir
bash: txz2dir: command not found
root@porteus:/home/guest# 
You sure you spelled it right?

-edit-

There is a txz2xzm and a xzm2dir though/

txz2xzm

Code: Select all

#!/bin/bash
# Convert Slackware's package(s) into .xzm module
#
# Author: Tomas M. <http://www.linux-live.org>
# Modifications for Porteus by fanthom


# Exit if nothing is provided as an argument:
if [ "$1" = "" ]; then
    echo
    echo "Convert Slackware's TXZ package into .xzm compressed module"
    echo "usage:"
    echo
    echo "$0 package.txz"
    echo "$0 package1.txz package2.txz package3.txz"
    echo "$0 /folder/with_packages/*"
    exit 1
fi

# Work only on txz/tgz packages:
for x in $*; do
    ext=`echo $x | rev | cut -d. -f1 | rev`
    if [ "$ext" = txz -o "$ext" = tgz ]; then
	mod=`readlink -f $x`
	MOD=`echo $MOD $mod`
    fi
done

# Switch to root:
if [ "$DISPLAY" ]; then
    if [ `whoami` != "root" ]; then
	/opt/porteus-scripts/xorg/psu "/opt/porteus-scripts/txz2xzm $MOD"
	exit
    fi
else
    if [ `whoami` != "root" ]; then
	echo "Please enter root's password below"
        su - -c "/opt/porteus-scripts/txz2xzm $MOD"
        exit
    fi
fi

# Create module:
for y in $MOD; do
    TMPDIR=/tmp/txz2xzm$$
    XZM="`echo $y | rev | cut -d. -f2- | rev`.xzm"

    installpkg -root $TMPDIR $y
    if [ $? != 0 ]; then echo "error installing $y package"; exit; fi

    # optimalization procedures, this doesn't hurt
    find $TMPDIR/usr{/local/,/share/,/}{man,info} -type l -name "*.gz" 2>/dev/null | xargs -r gunzip -f
    find $TMPDIR/usr{/local/,/share/,/}{man,info} -type f -name "*.gz" 2>/dev/null | xargs -r gunzip
    cp -a $TMPDIR/usr/share/man $TMPDIR/usr 2>/dev/null; rm -rf $TMPDIR/usr/share/man
    rm -f $TMPDIR/{usr,usr/local,var}/man/cat*/*

    echo -e "Creating $XZM\n"
    dir2xzm $TMPDIR $XZM >/dev/null
    if [ $? != 0 ]; then echo "error building compressed image"; exit; fi

    rm -Rf $TMPDIR
done
xzm2dir

Code: Select all

#!/bin/bash
# convert .xzm compressed file back into directory tree
#
# Author: Tomas M. <http://www.linux-live.org>
# Modifications for Porteus by fanthom

mod=`readlink -f $1`
mod2=`readlink -f $2`
# Switch to root
if [ "$DISPLAY" ]; then
   if [ `whoami` != "root" ]; then
      /opt/porteus-scripts/xorg/psu "/opt/porteus-scripts/xzm2dir $mod $mod2"
      exit
   fi
else
   if [ `whoami` != "root" ]; then
      echo "Please enter root's password below"
      su -c "/opt/porteus-scripts/xzm2dir $mod $mod2"
      exit
   fi
fi

if [ ! -d "$2" ]; then
   echo 
   echo "Convert .xzm compressed module back into directory tree"
   echo "usage: $0 source_file.xzm existing_output_directory"
   exit 1
fi

unsquashfs -f -dest "$2" "$1"
Ed

bour59
Samurai
Samurai
Posts: 118
Joined: 29 Dec 2010, 08:10
Distribution: porteus v3.2.2-xfce
Location: France

Re: No txz2dir in 3.1 Porteus ?

Post#3 by bour59 » 13 Feb 2016, 09:07

Hi
to do this I use explodepkg

aus9

Re: No txz2dir in 3.1 Porteus ?

Post#4 by aus9 » 13 Feb 2016, 13:29

I have in the past used as root
unsquashfs <packagename>

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

Re: No txz2dir in 3.1 Porteus ?

Post#5 by beny » 16 Feb 2016, 20:11

hi rava you can do this with file roller or ark

tome
Contributor
Contributor
Posts: 562
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: No txz2dir in 3.1 Porteus ?

Post#6 by tome » 16 Feb 2016, 21:39

tar -xvf %F
or
installpkg -root %d/%N %F - only for root, not tested

port
Samurai
Samurai
Posts: 135
Joined: 18 Feb 2016, 09:25
Distribution: Linux porteus 3.2.2 KDE
Location: Spain

Re: No txz2dir in 3.1 Porteus ?

Post#7 by port » 23 Mar 2016, 17:04

a txz2dir is trivial:

Code: Select all

mkdir DIRNAME && tar xvJf FILE.txz -C DIRNAME
if you want a command with same parameters as old txt2dir ( txz2dir file.txz directory ) just add this function to your .bashrc or similar:

Code: Select all

txz2dir () {
mkdir $1 && tar xvJf $2 -C $1
}
you can improve the function with error checking in parameters passed, I let this to you as exercise ;-)

Bogomips
Full of knowledge
Full of knowledge
Posts: 2540
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: No txz2dir in 3.1 Porteus ?

Post#8 by Bogomips » 23 Mar 2016, 20:15

tome wrote:tar -xvf %F
Or bsdtar -xf <pkg>.txz -C <dir> or explodepkg.
tome wrote:installpkg -root %d/%N %F - only for root, not tested
Here however install script will be run on the fake root directory.

Depends on the needs of the moment.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
wread
Module Guard
Module Guard
Posts: 1065
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v3.2.5-kde5-64 bits
Location: Santo Domingo
Contact:

Re: No txz2dir in 3.1 Porteus ?

Post#9 by wread » 01 May 2016, 20:26

I do it the brutal way: txz2xzm, then extract xzm 8)
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!

jmhoward56
Black ninja
Black ninja
Posts: 37
Joined: 08 Dec 2011, 19:28
Location: USA

Re: No txz2dir in 3.1 Porteus ?

Post#10 by jmhoward56 » 19 Aug 2016, 18:16

you should be root to do the following;
First create a directory where you want to install the txz pkg

Code: Select all

mkdir /tmp/mytxz
Then in the same directory where the txz file is located do this;

Code: Select all

ROOT="/tmp/mytxz" installpkg "txz filename"
replace "tmp/mytxz" with your directory name, less quotes and the same with "txz filename"

When it completes you will find your file "installed" in the directory you created. You could then do a dir2xzm if you wanted to create a module from the contents of the directory.

User avatar
francois
Contributor
Contributor
Posts: 4942
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: No txz2dir in 3.1 Porteus ?

Post#11 by francois » 19 Aug 2016, 20:31

There are very elegant cli solutions in this post. Thanks for that great knowledge. :D

My way, the newbie way is:
right click on the txz package > submenu txz2xzm
right click on the xzm package (porteus module) > submenu extract module

8)
Voltaire: Le mieux est l'ennemi du bien.

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: No txz2dir in 3.1 Porteus ?

Post#12 by Rava » 24 Aug 2016, 04:35

With all these possibilities, we really need a working wiki, or at least post in in our HOWTO part of the forum. Of course someone needs to not only check out all these possibilities, but also put it into [ code ] with examples (and probably with the command output / data and file result as well when these differ, and they might differ)
wread wrote:I do it the brutal way: txz2xzm, then extract xzm 8)
That was my lazy ass variant as well, but when I try to create a slim custom build all-in-one-with-only-the-really-needed-dependencies txz and hace to open and try out 15 or more modules, I tell you that sucks, since not only you have to convert each single one into a folder, but also have to work in monitoring which dependencies you really need, and so I want a more robust and less workload solution..
Cheers!
Yours Rava

User avatar
francois
Contributor
Contributor
Posts: 4942
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: No txz2dir in 3.1 Porteus ?

Post#13 by francois » 24 Aug 2016, 16:18

fanthom solution:
viewtopic.php?f=94&t=4398

Code: Select all

activate /path/*
Locically, I imagine that also should work:

Code: Select all

deactivate /path/*

Code: Select all

txz2xzm /path/*

Code: Select all

xzm2dir /path/*
etc.
Voltaire: Le mieux est l'ennemi du bien.

Jack
Contributor
Contributor
Posts: 1063
Joined: 09 Aug 2013, 14:25
Distribution: Porteus 3.2.rc5 Mate 64 bit
Location: Marysville, OHIO USA

Re: No txz2dir in 3.1 Porteus ?

Post#14 by Jack » 24 Aug 2016, 16:42

Was there ever txz2dir in any version of Porteus? Cause for me to build a bundle package, here what I have to do. Take a *.txz and convert to *.xzm then xzm2dir and then from dir2xzm to build the bundle. That a lot of work.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
francois
Contributor
Contributor
Posts: 4942
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: No txz2dir in 3.1 Porteus ?

Post#15 by francois » 24 Aug 2016, 17:24

Yes there was I am almost sure in 2.x.
Voltaire: Le mieux est l'ennemi du bien.

Post Reply