[SOLVED] Module creation (compaction)

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
User avatar
RamonTavarez
Contributor
Contributor
Posts: 81
Joined: 14 Mar 2011, 12:00
Distribution: 32 bit, KDE
Location: Dominican Republic

[SOLVED] Module creation (compaction)

Post#1 by RamonTavarez » 15 Mar 2013, 13:45

Hi:

I'm using the following script to combine or compact two modules into one.

Code: Select all

#!/bin/bash
for a in /mnt/sdb1/porteus/Documents/LibO-4.0.1/*.xzm
do 
     echo $a
     xzm2dir $a /mnt/sdb1/porteus/Documents/libreoffice-4.0.1-i586.xzm 
     echo "ok"
done
Details of usage:
  • 1.- Porteus 2.0, 32-bit, KDE 4.
    2.-Both modules resides and the script into the same dir.
    3.- Both modules belongs to the same software (the main program and the helppack)
    4.- I' ve checked capital letters and null spaces in the name of each module.
    5.- I' m logged as root.
    6.- The working dir of the script is the same dir where it resides.
Results: The new module was not created. The output is the following:
root@porteus:/mnt/sdb1/porteus/Documents/LibO-4.0.1# sh makeLibreoffice
/mnt/sdb1/porteus/Documents/LibO-4.0.1/libreoffice-4.0.1-i586-helppack_en_US.xzm

Convert .xzm compressed module back into directory tree
usage: /usr/bin/xzm2dir source_file.xzm existing_output_directory
ok
/mnt/sdb1/porteus/Documents/LibO-4.0.1/libreoffice-4.0.1-i586.xzm

Convert .xzm compressed module back into directory tree
usage: /usr/bin/xzm2dir source_file.xzm existing_output_directory
ok
Questions: I' ve used before, with Porteus 1.2, the same syntax to make the same job without the actual result
Is something wrong?! :wall:
Wath is missing? :O:
Please help, I'm getting :crazy: !
Last edited by RamonTavarez on 16 Mar 2013, 02:36, edited 1 time in total.
Ramón E. Tavárez

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Module creation (compaction)

Post#2 by Hamza » 15 Mar 2013, 14:14

Please try with this.

Code: Select all

for a in $(ls -1 /mnt/sdb1/porteus/Documents/LibO-4.0.1/*.xzm)
Also, are you sure that this directory exists "/mnt/sdb1/porteus/Documents/libreoffice-4.0.1-i586.xzm"? It seems to be a filename and not a folder name.
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 5456
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Module creation (compaction)

Post#3 by brokenman » 15 Mar 2013, 15:13

Code: Select all

mkdir /tmp/new

for a in /path/to/*.xzm; do
  xzm2dir $a /tmp/new
done

dir2xzm /tmp/new /tmp/new-module.xzm
rm -rf /tmp/new
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
RamonTavarez
Contributor
Contributor
Posts: 81
Joined: 14 Mar 2011, 12:00
Distribution: 32 bit, KDE
Location: Dominican Republic

Re: Module creation (compaction)

Post#4 by RamonTavarez » 16 Mar 2013, 02:33

Thanks a lot for your feedback.

The script is working now! :Yahoo!:

@Hamza:
When I used $(ls -l /path-to-module/*.xzm), the additional data listed generate several fake errors for each data that isn't the dir where the module is, so I didn't used it.

@Brokenman:
I could see my mistake: I wasn't using dir2xzm after the combination.

The final script, including comments, is:

Code: Select all

#!/bin/bash
#This script works based  at the fact that the booting device is  not the main HDD of the computer
#Create a  temporary dir into a HDD to ensure space for the operation
mkdir /mnt/sda2/tmp/libreoffice

#Read all the modules wanted beggining with the specific name. 
for a in $(ls  /mnt/sdb1/porteus/Documents/LibO-4.0.1/libreoffice-4.0.1*.xzm)
do 
     #This echo tell us wich module is beong worked
     echo $a
	#Uncompress each module toe temporary dir created before.
	xzm2dir $a /mnt/sda2/tmp/libreoffice
        #This echo is just for fun, it doesn't  check if it's really OK
        echo "ok"
done

#Compress the temporary dir containing the combined files and subdirs to  a new module at /tmp of your booting device.
dir2xzm  /mnt/sda2/tmp/libreoffice /mnt/sdb1/tmp/libreoffice-4.0.1-i586+helppack.zxm

#Remove the files and the temporary dir created at beggining.
rm -rf /mnt/sda2/tmp/libreoffice
Thanks again! :good:
Ramón E. Tavárez

Post Reply