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 16 Apr 2014, 15:46
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 [6 Posts]  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 720
Location: Mishawaka IN

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: 562
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: 720
Location: Mishawaka IN

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: 1212
Location: Queensland Australia ɹǝpu∩uʍop

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
Create strikethrough text HERE
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 720
Location: Mishawaka IN

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: 1573
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

_________________
KDpup-484 FoxyRoxyLinux Pussylinux BackUp forum
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 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.0509s ][ Queries: 11 (0.0037s) ][ GZIP on ]