Author |
Message |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Sun 23 Mar 2014, 11:20 Post subject:
dir2sfs with xz compression, How can I? (Solved) |
|
Hello Everyone,
Can dir2sfs be edited to and or have xz compression?
Code: |
#!/bin/bash
. /etc/DISTRO_SPECS
t=`echo "$1" | sed "s/\/$//"`
z=`echo "$1" | sed "s/\/$//"`
if [ ! -d "$t" ];then
echo "error: no valid folder specified!"
exit 0
fi
### if no _versionnummer in the end, get it from system
check=`echo $t | sed "s/\(.*\)_[0-9][0-9][0-9]$/\1/"`
#echo --- $check
if [ "$check" == "$t" ];then
v=$DISTRO_VERSION
z="${check}_$v"
fi
#echo $t - $z
if [ -f "$z.sfs" ];then
echo "$z.sfs already exists, refusing to overwrite it!"
exit 0
fi
mksquashfs "$t" "$z.sfs"
md5sum "$z.sfs" > "$z.sfs-md5.txt"
sync
echo
echo
s=`du -m "$z.sfs" | sed "s/\s.*//"`
echo "created: $z.sfs ( $s MB )"
echo "created: $z.sfs-md5.txt"
echo
echo "...byebye..."
echo
|
Last edited by oldyeller on Sun 23 Mar 2014, 15:57; edited 1 time in total
|
Back to top
|
|
 |
Keef

Joined: 20 Dec 2007 Posts: 1001 Location: Staffordshire
|
Posted: Sun 23 Mar 2014, 11:38 Post subject:
|
|
Adding
to the mksquashfs line ought to do it I think.
|
Back to top
|
|
 |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Sun 23 Mar 2014, 15:56 Post subject:
|
|
Keef wrote: | Adding
to the mksquashfs line ought to do it I think. |
Thanks that worked save 3m off my sfs.
Cheers
|
Back to top
|
|
 |
Geoffrey

Joined: 30 May 2010 Posts: 2379 Location: Queensland
|
Posted: Sun 23 Mar 2014, 21:28 Post subject:
Re: dir2sfs with xz compression How can I SOLVED |
|
oldyeller wrote: | Hello Everyone,
Can dir2sfs be edited to and or have xz compression?
|
This is the code from Saluki/Carolina, select gz or xz
Code: | #!/bin/bash
t=`echo "$1" | sed "s/\/$//"`
z=`echo "$1" | sed "s/\/$//"`
if [ ! -d "$t" ];then
echo "error: no valid folder specified!"
exit 0
fi
### if no _versionnummer in the end, get it from system
check=`echo $t | sed "s/\(.*\)_[0-9][0-9][0-9]$/\1/"`
#echo --- $check
#echo $t - $z
if [ -f "$z.sfs" ];then
yad --title "sfs exists" --text "$z.sfs already exists, refusing to overwrite it!" --button=ok:0
exit 0
fi
yad --title "Choose Compression Type" --button=XZ:0 --button=GZIP:1 --text "Choose which algorthim to compress the sfs with.
Chosing XZ here will give you a smaller iso but
may be slower than GZIP on very lowspec machines."
[ $? = 0 ] && COMP="-comp xz"
mksquashfs "$t" "$z.sfs" $COMP |while read -n 50 LINE ; do
echo $LINE |egrep '[0-9]\%'| cut -f1 -d% |awk '{print $NF}'|grep -v '\.' ;done | \
Xdialog --title "Building Squashfile " --gauge "Building Squashfile. Please Wait..." 0 0
md5sum "$z.sfs" > "$z.sfs-md5.txt"
sync
echo
echo
s=`du -m "$z.sfs" | sed "s/\s.*//"`
echo "created: $z.sfs ( $s MB )"
echo "created: $z.sfs-md5.txt"
echo
echo "...byebye..."
echo
|
_________________ Carolina: Recent Repository Additions

|
Back to top
|
|
 |
oldyeller

Joined: 15 Nov 2011 Posts: 891 Location: Alaska
|
Posted: Mon 24 Mar 2014, 14:47 Post subject:
|
|
Hi Geoffrey,
Will give this a go. Thanks
|
Back to top
|
|
 |
saintless

Joined: 11 Jun 2011 Posts: 3882 Location: Bulgaria
|
Posted: Mon 24 Mar 2014, 15:14 Post subject:
|
|
oldyeller wrote: | Keef wrote: | Adding
to the mksquashfs line ought to do it I think. |
Thanks that worked save 3m off my sfs.
Cheers |
I think you will save some more with this one:
Code: | -b 1024k -comp xz -Xbcj x86 |
Gives the best compression xz can do for squashfs.
Toni
_________________ Farewell, Nooby, you will be missed...
|
Back to top
|
|
 |
ASRI éducation

Joined: 09 May 2009 Posts: 3203 Location: France
|
Posted: Tue 08 Jul 2014, 22:18 Post subject:
|
|
saintless wrote: | I think you will save some more with this one:
Code: | -b 1024k -comp xz -Xbcj x86 |
Gives the best compression xz can do for squashfs. |
Thank you,
I just tried and the result is impressive.
For a 509 MB folder, I get 149MB with -comp xz, and 129MB with -b 1024k -comp xz -Xbcj x86
_________________ Projet ASRI éducation => Association | Forum | Dépôt | Espace kids
|
Back to top
|
|
 |
hamoudoudou
Joined: 24 Jul 2014 Posts: 1467 Location: rabat
|
Posted: Sat 09 Jun 2018, 05:18 Post subject:
Asri did a pet for adrive |
|
Bookmarked.
Asri did a pet for adrive, similar as dir2sfs. Somebody would have any idea where to retrieve it ?
|
Back to top
|
|
 |
hamoudoudou
Joined: 24 Jul 2014 Posts: 1467 Location: rabat
|
Posted: Mon 16 Jul 2018, 22:52 Post subject:
pas de réponse. |
|
pas de réponse.. le résultat d'une compression dépend aussi du fichier à comprimer..
blank is the main character
When 1000 blanks, they are replaced by a flag '1000 blanks to write' flag is only 2 or 3 characters
Description |
Chinese is hard to compress |
Filesize |
29.78 KB |
Viewed |
165 Time(s) |

|
|
Back to top
|
|
 |
|