[SOLVED] xzm2lzm?
Posted: 03 Jun 2011, 15:38
Don't know whether this is the right place to ask? How can I possibly convert xzm modules back to lzm? Is there something like xzm2lzm?
To unpack on slackware (providing you have squashfs support)
unsquashfs -f -dest /path/to/unpack /path/to/module.xzm
mksquashfs directory module.xzm
You can download the squashfs tools and stick them in your $PATH.
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/xzm2lzm $1"
exit
fi
else
if [ `whoami` != "root" ]; then
echo "Please enter root's password below"
su -c "/opt/porteus-scripts/xzm2lzm $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 xzm module or folder containing xzm's as an argument
examples:
$0 /mnt/sda2/porteus_modules
$0 /root/module.xzm"$e
exit
fi
if [ -d "$1" ]; then cd $1; fi
for x in `ls $1 | grep .xzm`; do
path=`readlink -f $x`
name=`echo $path | rev | cut -d/ -f1 | rev | cut -d. -f1`
newnm=`echo $path | sed 's/.xzm/.lzm/g'`
unsquashfs -d /tmp/$name$$ $path
mksquashfs /tmp/$name$$ $newnm -comp lzma -b 256K
rm -r /tmp/$name$$
echo $newnm >> /tmp/list
done
echo && echo -e "${c}this is the list of converted modules..."$e
echo && cat /tmp/list
rm /tmp/list
Code: Select all
#!/bin/sh
# script by fanthom
# Switch to root
if [ "$DISPLAY" ]; then
if [ `whoami` != "root" ]; then
xterm -e su -c "xzm2lzm $1"
exit
fi
else
if [ `whoami` != "root" ]; then
echo "Please enter root's password below"
su -c "xzm2lzm $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 xzm module or folder containing xzm's as an argument
examples:
$0 /mnt/sda2/porteus_modules
$0 /root/module.xzm"$e
exit
fi
if [ -d "$1" ]; then cd $1; fi
for x in `ls $1 | grep .xzm`; do
path=`readlink -f $x`
name=`echo $path | rev | cut -d/ -f1 | rev | sed 's/.xzm//g'`
newnm=`echo $path | sed 's/.xzm/.sq4.lzm/g'`
unsquashfs -d /tmp/$name$$ $path
mksquashfs /tmp/$name$$ $newnm -comp lzma -b 256k
rm -r /tmp/$name$$
echo $newnm >> /tmp/list
done
echo && echo -e "${c}this is the list of converted modules..."$e
echo && cat /tmp/list
rm /tmp/list
Code: Select all
lrwxrwxrwx 1 root root 16 Jun 4 13:19 liblzma.so.0 -> liblzma.so.0.0.0
-rwxr-xr-x 1 root root 134088 May 7 16:53 liblzma.so.0.0.0
lrwxrwxrwx 1 root root 16 Jun 4 13:19 liblzma.so.5 -> liblzma.so.5.0.2
-rwxr-xr-x 1 root root 138984 May 7 16:53 liblzma.so.5.0.2