Page 1 of 1

[SOLVED]lzm2xzm problem

Posted: 04 Jun 2011, 16:38
by feng
i create a directory /porteus/crashman_lzm
where i collette .lzm files created by crashman

and then, i tried to run the command lzm2xzm to covert the files

things happened, the script dead since the directory contain of "lzm"

Code: Select all

bash-4.1# lzm2xzm flash_player_10_2.lzm
Parallel unsquashfs: Using 1 processor
1 inodes (47 blocks) to write

[================================================================\] 47/47 100%
created 1 files
created 5 directories
created 0 symlinks
created 0 devices
created 0 fifos
Could not create destination file: No such file or directory
error building compressed image

this is the list of converted modules...

/mnt/sda1/porteus/crashman.xzm/flash_player_10_2.xzm

the command lzm2xzm worked fine after i rename the directory
from "crashman_lzm" to "crashman".

Re: lzm2xzm problem

Posted: 04 Jun 2011, 18:03
by beny
wrong syntax feng, you can write lzm2xzm flash_player_10_2.lzm flash_player_10_2.xzm and i think that work

Re: lzm2xzm problem

Posted: 05 Jun 2011, 07:29
by fanthom
@feng
i have replaced 'sed' with 'cut' and now is ok.

Code: Select all

#!/bin/sh
# script by fanthom

# Switch to root
if [ "$DISPLAY" ]; then
   if [ `whoami` != "root" ]; then
      xterm -T "Please enter root's password below" -e su -c "/opt/porteus-scripts/lzm2xzm $1"
      exit
   fi
else
   if [ `whoami` != "root" ]; then
      echo "Please enter root's password below"
      su -c "/opt/porteus-scripts/lzm2xzm $1"
      exit
   fi
fi

# Variables
c='\e[36m'
r='\e[31m'
e=`tput sgr0`

# Let's start
if [ "$1" = "" ]; then
echo && echo -e "${r}need a lzm module or folder containing lzm's as an argument
examples:

$0 /mnt/sda2/porteus_modules
$0 /root/module.sq4.lzm
$0 /root/module.lzm"$e
exit
fi

if [ -d "$1" ]; then cd $1; fi

for x in `ls $1 | grep .lzm`; do
    path=`readlink -f $x`
    name=`echo $path | rev | cut -d/ -f1 | cut -d. -f2- | rev`
    dest=`echo $path | rev | cut -d/ -f2- | rev`
    typ=`file $x | grep "endian"`
    if [ -n $typ ] > /dev/null 2>&1; then
        unsquashfs3 -d /tmp/$name$$ $path
    else
        unsquashfs -d /tmp/$name$$ $path
    fi
    dir2xzm /tmp/$name$$ $dest/$name.xzm
    rm -r /tmp/$name$$
    echo $dest/$name.xzm >> /tmp/list
done

echo && echo -e "${c}this is the list of converted modules..."$e
echo && cat /tmp/list
rm /tmp/list
thanks for bug report.

@beny
"wrong syntax feng, you can write lzm2xzm flash_player_10_2.lzm flash_player_10_2.xzm and i think that work"
this is not necessary as only suffix (lzm to xzm) changes, the rest stays the same.