Post here if you are a new Porteus member and you're looking for some help.
-
feng
- Black ninja
- Posts: 63
- Joined: 18 Jan 2011, 15:51
- Distribution: xfce 32bits/64bits
- Location: internet
Post#1
by feng » 04 Jun 2011, 16:38
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".
Last edited by
feng on 05 Jun 2011, 14:02, edited 1 time in total.
feng
-
beny
- Full of knowledge
- Posts: 2184
- Joined: 02 Jan 2011, 11:33
- Location: italy
Post#2
by beny » 04 Jun 2011, 18:03
wrong syntax feng, you can write lzm2xzm flash_player_10_2.lzm flash_player_10_2.xzm and i think that work
beny
-
fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
-
Contact:
Post#3
by fanthom » 05 Jun 2011, 07:29
@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.
Please add [Solved] to your thread title if the solution was found.
fanthom