ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] 3 ways to get uncompressed image size(s)..


From: Stephens, Peter A.
Subject: [Ltib] 3 ways to get uncompressed image size(s)..
Date: Mon, 17 Mar 2008 11:55:25 -0400

I built an image pretty close to the minimal, default, setup.  I used 3
methods to get the
uncompressed sizes.

    Using "df" after mounting the new file system               32 Mb
reported
    Using "du . -ck" after mounting the new file system 32 Mb reported
    Using the build output
47 Mb reported

The build output says, "including padding".  What does that mean?  What
is the padding for? 
Is the padding enough that it makes up the difference between 47.5Mb and
the 32Mb reported 
using the other methods? Can the padding be adjusted or removed?

Pete

================================= Numbers for Minimal image
================================

-------------------------------- Compressed image file size
--------------------------------

~/ltib> ls -l rootfs.*
-rw-rw-r-- 1 hzqmrk hzqmrk  8776723 2008-03-14 15:48 rootfs.ext2.gz

Approximately 8.8Mb.  Pretty good.

-- Method 1 ----------- Using "df" after mounting the new file system
-----------------------

~/ltib/tmp2> gunzip rootfs.ext2.gz
~/ltib/tmp2> sudo mount -o loop rootfs.ext2 /mnt/iso/
~/ltib/tmp2> cd /mnt/iso/
/mnt/iso> df -l .
Filesystem 1K-blocks Used  Available Use% Mounted on
/home/hzqmrk/proj/ltib/tmp2/rootfs.ext2
           43429     31749 9305  78% /mnt/iso

OK, so this reports ~ 32 Mb after mounting the image.

-- Method 2 --------- Using "du . -ck" after mounting the new file
system --------------------

~/ltib/tmp2> gunzip rootfs.ext2.gz
~/ltib/tmp2> sudo mount -o loop rootfs.ext2 /mnt/iso/
~/ltib/tmp2> cd /mnt/iso/
/mnt/iso> du . -ck | sort -rn | head -n 10
du: cannot read directory `./lost+found': Permission denied
du: cannot read directory `./var/run/usb': Permission denied
31749   total
31749   .
20817   ./usr
13834   ./usr/share
9133    ./usr/share/gtk-doc
9132    ./usr/share/gtk-doc/html
5033    ./usr/lib
5028    ./lib
3785    ./usr/share/gtk-doc/html/glib
3245    ./usr/share/doc

I also created a file that contained all the file sizes from the iso
using 

        /mnt/iso> find . -type f -name "*" -exec ls -l {} \; > ~/tmp.txt

and the total size for the files was 29MB.  The difference may be
"blocks used" versus 
"actual" file sizes, but it is so close to the 32MB reported with this
method that I 
think this immaterial.  What is of interest is that I found a lot of
documentation in 
"/usr/share/doc", "/usr/share/gtk-doc", and "/usr/man".  After deleting
those, the 
uncompressed file total was 16.9Mb implying a compressed file of
(possibly) less than 
5Mb for this minimal setup.

-- Method 3 ----------------------- Using build output
--------------------------------------

Filesystem stats, including padding:
    Total size            = 47504k
    Total number of files = 1102
Your ramdisk exceeds the old default size of 4096k, you may need to
set the command line argument for ramdisk_size in your bootloader
allowing 10% free this gives 52254k .  For instance, for u-boot:

setenv bootargs root=/dev/ram rw ramdisk_size=52254

creating an ext2 compressed filesystem image: rootfs.ext2.gz

Started: Fri Mar 14 15:43:44 2008
Ended:   Fri Mar 14 15:48:18 2008
Elapsed: 274 seconds

Build Succeeded



Peter A. Stephens
Advanced Engineering
address@hidden
www.delphi.com
765-451-7074

-----Original Message-----
From: Erik Peterson [mailto:address@hidden 
Sent: Friday, March 14, 2008 3:08 PM
To: Stephens, Peter A.
Cc: address@hidden; address@hidden
Subject: Re: [Ltib] Way to calculate uncompressed image size..

You could always use your cross-compile-"size"
for example :
address@hidden bin]$ ./powerpc-linux-size /auto/freescale/ltib/ltib-
mpc8544ds-20071122/rootfs/boot/vmlinux
    text           data     bss     dec     hex filename
4004373  198408  191484 4394265  430d19 /auto/freescale/ltib/ltib- 
mpc8544ds-20071122/rootfs/boot/vmlinux


On Mar 14, 2008, at 11:17 AM, Stephens, Peter A. wrote:

>
> If I want to calculate the uncompressed size of an image can I just  
> add
> the packages I want.  Build it.  Change directories to "rootfs" and  
> run
> "du . -ckS"?  Here is an example...
>
> address@hidden rootfs]$ du . -ckS | sort -rn | head -n 20
> 118524  total
> 33896   ./usr/lib
> 26076   ./usr/lib/gstreamer-0.10
> 15520   ./usr/bin
> 6804    ./boot
> 4904    ./lib
> 3984    ./usr/share/gtk-doc/html/glib
> 2676    ./usr/share/gtk-doc/html/libxml2
> 2660    ./usr/info
> 2540    ./usr/share/doc/libxml2-2.6.28/html/html
> 1980    ./usr/share/gtk-doc/html/gobject
> 1772    ./sbin
> 1600    ./bin
> 1252    ./usr/share/sounds/alsa
> 976     ./usr/share/gtk-doc/html/liboil
> 808     ./usr/share/man/man3
> 692     ./usr/share/man/man1
> 580     ./usr/sbin
> 528     ./usr/share/doc/libxml2-2.6.28/html
> 508     ./usr/include/gstreamer-0.10/gst
>
> Peter A. Stephens
> address@hidden <mailto:address@hidden>
> 765-451-7074
>
>
>
************************************************************************
****************
>
> Note:  If the reader of this message is not the intended recipient,  
> or an employee or agent responsible for delivering this message to  
> the intended recipient, you are hereby notified that any  
> dissemination, distribution or copying of this communication is  
> strictly prohibited. If you have received this communication in  
> error, please notify us immediately by replying to the message and  
> deleting it from your computer. Thank you.
>
>
************************************************************************
****************
>
>
> _______________________________________________
> LTIB home page: http://bitshrine.org
>
> Ltib mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/ltib


****************************************************************************************

Note:  If the reader of this message is not the intended recipient, or an 
employee or agent responsible for delivering this message to the intended 
recipient, you are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please notify us immediately by replying to the message 
and deleting it from your computer. Thank you. 

****************************************************************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]