dir2sfs with xz compression, How can I? (Solved)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

dir2sfs with xz compression, How can I? (Solved)

#1 Post by oldyeller »

Hello Everyone,

Can dir2sfs be edited to and or have xz compression?

Code: Select all

#!/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, 19:57, edited 1 time in total.

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#2 Post by Keef »

Adding

Code: Select all

 -comp xz
to the mksquashfs line ought to do it I think.

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#3 Post by oldyeller »

Keef wrote:Adding

Code: Select all

 -comp xz
to the mksquashfs line ought to do it I think.
Thanks that worked save 3m off my sfs.

Cheers

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

Re: dir2sfs with xz compression How can I SOLVED

#4 Post by Geoffrey »

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: Select all

#!/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
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#5 Post by oldyeller »

Hi Geoffrey,

Will give this a go. Thanks

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#6 Post by saintless »

oldyeller wrote:
Keef wrote:Adding

Code: Select all

 -comp xz
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: Select all

-b 1024k -comp xz -Xbcj x86 
Gives the best compression xz can do for squashfs.

Toni

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#7 Post by ASRI éducation »

saintless wrote:I think you will save some more with this one:

Code: Select all

-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 => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

hamoudoudou

Asri did a pet for adrive

#8 Post by hamoudoudou »

Bookmarked.
Asri did a pet for adrive, similar as dir2sfs. Somebody would have any idea where to retrieve it ?

hamoudoudou

pas de réponse.

#9 Post by hamoudoudou »

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
Attachments
Chinois.jpg
Chinese is hard to compress
(29.78 KiB) Downloaded 147 times

Post Reply