Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 14 Nov 2018, 01:34
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
dir2sfs with xz compression, How can I? (Solved)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 889
Location: Alaska

PostPosted: 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
View user's profile Send private message 
Keef


Joined: 20 Dec 2007
Posts: 922
Location: Staffordshire

PostPosted: Sun 23 Mar 2014, 11:38    Post subject:  

Adding
Code:
 -comp xz
to the mksquashfs line ought to do it I think.
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 889
Location: Alaska

PostPosted: Sun 23 Mar 2014, 15:56    Post subject:  

Keef wrote:
Adding
Code:
 -comp xz
to the mksquashfs line ought to do it I think.


Thanks that worked save 3m off my sfs.

Cheers
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 2362
Location: Queensland

PostPosted: 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
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 889
Location: Alaska

PostPosted: Mon 24 Mar 2014, 14:47    Post subject:  

Hi Geoffrey,

Will give this a go. Thanks
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Mon 24 Mar 2014, 15:14    Post subject:  

oldyeller wrote:
Keef wrote:
Adding
Code:
 -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:
-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
View user's profile Send private message MSN Messenger 
ASRI éducation


Joined: 09 May 2009
Posts: 3203
Location: France

PostPosted: 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
View user's profile Send private message Visit poster's website 
hamoudoudou

Joined: 24 Jul 2014
Posts: 1467
Location: rabat

PostPosted: 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
View user's profile Send private message 
hamoudoudou

Joined: 24 Jul 2014
Posts: 1467
Location: rabat

PostPosted: 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
Chinois.jpg
 Description   Chinese is hard to compress
 Filesize   29.78 KB
 Viewed   87 Time(s)

Chinois.jpg

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0754s ][ Queries: 12 (0.0151s) ][ GZIP on ]