Discussion:
[OpenTom] extraction of files from standard ttsystem file
Paul M
2006-01-06 01:22:36 UTC
Permalink
http://opentom.org/index.php/Ttsystem_images

I was wondering if someone had a simple tool for extracting the file
systems from the ttsystem file, so I could peek at the internals and see
what's there...

I would presume once I've gotten the files split, I can just loopback
mount them?

BTW, I note that there's a broken link on
http://opentom.org/index.php/Proof-of-concept_media_player_image

Thanks in advance,
Paul
Paul M
2006-01-06 04:06:01 UTC
Permalink
Post by Paul M
http://opentom.org/index.php/Ttsystem_images
I was wondering if someone had a simple tool for extracting the file
systems from the ttsystem file, so I could peek at the internals and see
what's there...
http://svn.opentom.org/opentom/trunk/ttimgextract/ttimgextract.c
thanks very much for that... I did the extract, realised I needed to
gunzip the ttsystem.0 file, but it won't loopback mount:

gunzip < ttsystem.0 > ttsystem.initrd
mount /tmp/ttsystem.initrd /mnt/tomtom -t ext2 -o loop

results in the error:
VFS: Can't find an ext2 filesystem on dev loop0.


hmmm.


sorry again for being a total n00b!

Paul
Thomas Kleffel
2006-01-06 05:09:25 UTC
Permalink
Hi Paul,

what you've extracted is not a ext2 filesystem, but a cpio archive which
is copied onto the initramfs on boot.

You can't loop mount cpio archives, but you can extract them using "cpio
-i", make your changes and build a new one with "cpio -o".

cpio is a rather complicated tool with lots of options, so it might help
to read the manpage.

Have Fun,

Thomas
Paul M
2006-01-06 15:38:11 UTC
Permalink
Post by Thomas Kleffel
Hi Paul,
what you've extracted is not a ext2 filesystem, but a cpio archive which
is copied onto the initramfs on boot.
You can't loop mount cpio archives, but you can extract them using "cpio
-i", make your changes and build a new one with "cpio -o".
cpio is a rather complicated tool with lots of options, so it might help
to read the manpage.
thanks very much for that... I was misled by the comments in the wiki
which said it was an initrd file.

I have now successfully extracted the files, and it's quite
interesting... that there's just one kernel module (the GPL sd driver),
and the startup scripts are quite funky too.

thanks again for your time
Paul
Paul M
2006-01-06 23:05:58 UTC
Permalink
Post by Paul M
I was misled by the comments in the wiki
which said it was an initrd file.
... I always thought initrd was ext filesys (and my initial google
results confirmed it.
Post by Paul M
I have now successfully extracted the files, and it's quite
interesting... that there's just one kernel module (the GPL sd driver),
and the startup scripts are quite funky too.
I registered and updated the wiki with info about extracting files etc,
hope this is to all your satisfaction.

Paul
Werner Almesberger
2006-01-07 01:46:05 UTC
Permalink
Post by Paul M
... I always thought initrd was ext filesys (and my initial google
results confirmed it.
Traditionally, an initrd contained any file system the kernel could
use (or, you could also put something the kernel couldn't use, and
access it from user space, but that's of little practical relevance).
Nowadays, you can also put a gzip'ed cpio archive, which is then
extracted into a ramfs through the initramfs mechanism.

The latter is generally more flexible, but the former is probably
still more common. Also, there are some subtleties regarding what
type of cpio archive you can use with initramfs.

- Werner
--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina ***@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
Paul M
2006-01-07 17:15:33 UTC
Permalink
Post by Werner Almesberger
Traditionally, an initrd contained any file system the kernel could
use (or, you could also put something the kernel couldn't use, and
access it from user space, but that's of little practical relevance).
Nowadays, you can also put a gzip'ed cpio archive, which is then
extracted into a ramfs through the initramfs mechanism.
The latter is generally more flexible, but the former is probably
still more common. Also, there are some subtleties regarding what
type of cpio archive you can use with initramfs.
thanks for that clarification, very useful to know.

I intend to try rolling my own ttsystem, like the mediaplayer one, so
this is all vital knowledge!

regards
Paul
Paul
2006-01-08 16:25:47 UTC
Permalink
Post by Werner Almesberger
Traditionally, an initrd contained any file system the kernel could
use (or, you could also put something the kernel couldn't use, and
access it from user space, but that's of little practical relevance).
Nowadays, you can also put a gzip'ed cpio archive, which is then
extracted into a ramfs through the initramfs mechanism.
The latter is generally more flexible, but the former is probably
still more common. Also, there are some subtleties regarding what
type of cpio archive you can use with initramfs.
thanks for that clarification, very useful to know.

I intend to try rolling my own ttsystem, like the mediaplayer one, so
this is all vital knowledge!

regards
Paul

Thomas Kleffel
2006-01-06 05:09:25 UTC
Permalink
Hi Paul,

http://svn.opentom.org/opentom/trunk/ttimgextract/ttimgextract.c

will help you

Thomas
Post by Paul M
http://opentom.org/index.php/Ttsystem_images
I was wondering if someone had a simple tool for extracting the file
systems from the ttsystem file, so I could peek at the internals and see
what's there...
I would presume once I've gotten the files split, I can just loopback
mount them?
BTW, I note that there's a broken link on
http://opentom.org/index.php/Proof-of-concept_media_player_image
Thanks in advance,
Paul
Loading...