linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* self image
@ 2003-12-10 11:09 AlessandroPPC
  2003-12-10 21:06 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: AlessandroPPC @ 2003-12-10 11:09 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 2210 bytes --]

Dear Wolfgang Denk,

I'm just looking at the SELF image and I observed that when I extract the
image and try to rebuild it
(without adding or removing any files) the dimension of result file is about
9KByte greater  than the original.
I have followed the procedure "How to increase the Size of ramdisk" to
generate an 8MByte ramdisk thus I
was expecting a small increase of the bytes amount, but never as reported.
Do you think I'm wrong somewhere?

Here enclosed is the script file.

any helps would be apreciated.
Many thanks
Alessandro.


[root@pegaso SELF]# ll
totale 1380
-rw-r--r--    1 root     root      1400262 dic 10 11:35 pRamdisk
-rwxr-xr-x    1 pegaso   pegaso       1835 dic 10 11:17 self1.sh
-rwxr-xr-x    1 pegaso   pegaso       1189 dic 10 12:01 self.sh
[root@pegaso SELF]# ./self.sh pRamdisk
entrati 21878+1 record
usciti 21878+1 record
ramdisk.gz:      66.6% -- replaced with ramdisk
entrati 8+0 record
usciti 8+0 record
mke2fs 1.27 (8-Mar-2002)
new_ramdisk is mounted; mke2fs forced anyway.  Hope /etc/mtab is incorrect.
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2048 inodes, 8192 blocks
0 blocks (0.00%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
2048 inodes per group

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
tune2fs 1.27 (8-Mar-2002)
Setting maximal mount count to -1
............................................................................
............................................................................
............................................................................
............................................................................
....................................................
630 blocks
Image Name:   DexGate SELF image
Created:      Wed Dec 10 12:01:37 2003
Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
Data Size:    1408989 Bytes = 1375.97 kB = 1.34 MB
Load Address: 0x00000000
Entry Point:  0x00000000
[root@pegaso SELF]#


[-- Attachment #2: self.sh --]
[-- Type: application/octet-stream, Size: 859 bytes --]

#!/bin/bash
SOURCE=ramdisk
OLD=tmp
NEW=new
NEWRAMDISK=new_ramdisk
RESULT=/tftpboot/ramdisk.self

if [ -z "$1" ] ; then 
  echo 'usage: self.sh ramdisk_filename'
  exit 1
fi

if [ ! -e "$1" ] ; then
  echo "file $1 does not exist."
  exit 1
fi

SELFIMAGE=$1


mkdir -p $OLD
mkdir -p $NEW
    
dd if=$SELFIMAGE bs=64 skip=1 of=$SOURCE.gz
gunzip -v $SOURCE.gz

mount -o loop $SOURCE $OLD

dd if=/dev/zero of=$NEWRAMDISK bs=1024k count=8
/sbin/mke2fs -F -m0 $NEWRAMDISK
/sbin/tune2fs  -c 0 $NEWRAMDISK


mount -o loop $NEWRAMDISK $NEW
cd $OLD
find . -depth -print | cpio -VBpdum ../$NEW
cd ..
umount $OLD
    
umount $NEW
gzip -9 $NEWRAMDISK
/opt/eldk/usr/bin/mkimage -T ramdisk -C gzip -n "DexGate SELF image" -d $NEWRAMDISK.gz $RESULT

rm -rf $NEWRAMDISK.gz
rm -rf $SOURCE.gz
rm -rf $SOURCE
rmdir $NEW
rmdir $OLD

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: self image
  2003-12-10 11:09 self image AlessandroPPC
@ 2003-12-10 21:06 ` Wolfgang Denk
  2003-12-11 17:20   ` R: " AlessandroPPC
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2003-12-10 21:06 UTC (permalink / raw)
  To: AlessandroPPC; +Cc: linuxppc-embedded


Dear Alessandro,

in message <004f01c3bf0e$1839e2c0$0400a8c0@eurostudio.local> you wrote:
>
> I'm just looking at the SELF image and I observed that when I extract the
> image and try to rebuild it
> (without adding or removing any files) the dimension of result file is about
> 9KByte greater  than the original.
> I have followed the procedure "How to increase the Size of ramdisk" to
> generate an 8MByte ramdisk thus I
> was expecting a small increase of the bytes amount, but never as reported.
> Do you think I'm wrong somewhere?

Your new filesystem is twice as big as the old one, so it  will  have
more inode blocks etc. Also, you may notice that our filesystem image
does not contain the (rather large) lost+found firectory.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
Death. Destruction. Disease. Horror. That's what war  is  all  about.
That's what makes it a thing to be avoided.
	-- Kirk, "A Taste of Armageddon", stardate 3193.0

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* R: self image
  2003-12-10 21:06 ` Wolfgang Denk
@ 2003-12-11 17:20   ` AlessandroPPC
  2003-12-11 17:36     ` Dan Kegel
  0 siblings, 1 reply; 4+ messages in thread
From: AlessandroPPC @ 2003-12-11 17:20 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-embedded


> Your new filesystem is twice as big as the old one, so it  will  have
> more inode blocks etc.

Many thanks, everything is working fine.


Just one more question: when I add the "top" program (and related library)
to the filesystem, and I try to run it, the following message appears before
exit:

top: Unknown terminal "xterm" in $TERM

Any idea how to solve it?

Thanks in advance

Alessandro


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: R: self image
  2003-12-11 17:20   ` R: " AlessandroPPC
@ 2003-12-11 17:36     ` Dan Kegel
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Kegel @ 2003-12-11 17:36 UTC (permalink / raw)
  To: AlessandroPPC; +Cc: Wolfgang Denk, linuxppc-embedded


AlessandroPPC wrote:
> Just one more question: when I add the "top" program (and related library)
> to the filesystem, and I try to run it, the following message appears before
> exit:
>
> top: Unknown terminal "xterm" in $TERM
>
> Any idea how to solve it?

You need /usr/share/terminfo/x/xterm, I think.
- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-11 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-10 11:09 self image AlessandroPPC
2003-12-10 21:06 ` Wolfgang Denk
2003-12-11 17:20   ` R: " AlessandroPPC
2003-12-11 17:36     ` Dan Kegel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).