Author Topic: Well, I'm stupid..  (Read 1225 times)

LunchboX

  • Member
  • **
  • Posts: 21
  • Kudos: 0
Well, I'm stupid..
« on: 1 March 2002, 08:42 »


[ November 09, 2002: Message edited by: LunchboX ]

Where did my signature go?

dbl221

  • Member
  • **
  • Posts: 253
  • Kudos: 0
Well, I'm stupid..
« Reply #1 on: 1 March 2002, 21:09 »
An ISO is an image file.
In Windows this is a valid file extension for an image.  Unix doesn't actually care about file extentions.

An image file in this context is a compressed data-structure that contains ALL the binary data from a CD.

Here is an example to help clarify.  I downloaded Mandrake 8.1 in ISO ......3 iso images, on efor each CD.
Then I burned each of the three Mandrake CS's on to a separate cd in Windows using a program called CDRWIN.

ISO is one image type, but Nero uses NRI and others.

check out this site for more info http://www.cdfreaks.com/

Norton Ghost is a popular image creation software that creates a copy of ALL the data on a partition or Hard drive and allows for the transfer of the image to CD of another partition or even over the LAN to another computer......Ghost uses "gho" as its image extension......but its the same as an ISO.

Good luck
dbl221***Comp-Sys walking wounded

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Well, I'm stupid..
« Reply #2 on: 1 March 2002, 12:42 »
One small correction. ISO images are *not* compressed images.  They are an exact image of the filesystem (iso9660 in the case of a CD).  In fact, in UNIX if you want to create an ISO from a CD you don't need any special software or hardware.  

e.g.
dd if=/dev/cdrom of=/tmp/mycd1.iso

This will create an ISO image of the CD that can be written using either your windows software or "cdrecord" in UNIX (among other ways).

I'm sure you knew this but just like to keep things straight.
Someone please remove this account. Thanks...

dbl221

  • Member
  • **
  • Posts: 253
  • Kudos: 0
Well, I'm stupid..
« Reply #3 on: 2 March 2002, 01:52 »
My mistake......I was thinking about the conpressed Linux image used to boot as set forth in /etc/lilo.conf.

  :eek:
dbl221***Comp-Sys walking wounded

LunchboX

  • Member
  • **
  • Posts: 21
  • Kudos: 0
Well, I'm stupid..
« Reply #4 on: 2 March 2002, 05:06 »
So basiclly if I want to install, for example, Red Hat, I download an ISO for every CD, then I burn each ISO onto a seperate CD, and I can install it?
Where did my signature go?

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Well, I'm stupid..
« Reply #5 on: 2 March 2002, 05:11 »
The initrd.img?  I love Linux for these sorts of cool filesystem tricks, along with mounting ISO files directly without having to burn them.  I don't know if you've played with mounting images on loop devices but it's extremely cool. I have several ISO images of CDs on my server and I mount them on a loop device and then Samba share them. It's like having 30 CD-ROM drives on my machine.

# mount /iso/win2000.iso /loop/win2000 -o loop

or the entry in /etc/fstab would be something like:
/iso/win2000.iso    /loop/win2000   iso9660    user,exec,ro,loop 0 0

And of course you can copy or change anything in that mounted filesystem before writing it to CD. Whenever someone wants a CD I just cdrecord one of the images to a blank disk and hand it over.

And I like manipulating the initrd.img in a similar matter but like you say that file *is* compressed so:

# zcat /boot/initrd.img > /images/initrd.dat
# mount /images/initrd.dat /mnt/initrd -o loop

add kernel modules etc under /mnt/initrd and/or change the boot scripts then:

# umount /mnt/initrd
# gzip -cd < /images/initrd.dat > /boot/initrd.img

Fun stuff...

[ March 01, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Well, I'm stupid..
« Reply #6 on: 25 November 2002, 19:52 »
is there some tutorial that can explain more initrd.img stuff to me please?
also, i hadn't heard of zcat before, i'll have to find out what that is...
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Well, I'm stupid..
« Reply #7 on: 25 November 2002, 20:19 »
zcat is just a link to gzip but when it is executed as zcat it uncompresses a gzipped file to STDOUT (to your screen if you don't redirect or pipe the output). It's exactly the same as doing a "gunzip -c". gunzip, gzip, and zcat are actually all the same file (do an "ls -i /bin/zcat", an "ls -i /bin/gzip" and an "ls -i /bin/gunzip" and you will see they all are the same inode).

The "initrd" man page has a good overview of the purpose of it (man initrd).

[ November 25, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Well, I'm stupid..
« Reply #8 on: 25 November 2002, 21:27 »
thank you!

you raise a point i have just recently found out about and am still perplexed by! if you link to an application, how does it know what parameters to invoke? i mean this zcat link, how does bzip know?

another example is joe. you can invoke joe with jmacs, jpico or jword, and it will emulate the three different editors accordingly, but if they are all just links, how does it know?
Another example is BusyBox, how does it know which of about 60 links to it wants it to do what?

i know i am asking a lot of dumb newbie questions today, so sorry!
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Well, I'm stupid..
« Reply #9 on: 25 November 2002, 22:37 »
[edit]ignore this[/edit]

[ November 25, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Well, I'm stupid..
« Reply #10 on: 25 November 2002, 22:38 »
quote:
Originally posted by Calum:
you raise a point i have just recently found out about and am still perplexed by! if you link to an application, how does it know what parameters to invoke? i mean this zcat link, how does bzip know?



This is a very cool feature of UNIX and C. In a program written in C any command line parameters that are passed to the program come in the form of an array called "argv[]". The number of command line parameters is stored in the integer variable "argc" (argument count). The first element of the argv[] array is the name of the program, the second element of the argv[] array is the first parameter passed to the program. So by checking "argv[0]" you can execute different code based on differing names of the program. Example:

Code: [Select]

Copy that code into a file called "myname.c" and then compile it:

$ make myname

Run it by:

$ ./myname

Create a hard link:

$ ln myname yourname

Run the link:

$ ./yourname

As you can see, the program can figure out what it's name is easily and then branch off and execute different things based on what it's name is if you were to put some conditional statements in there (if, switch, etc).
Someone please remove this account. Thanks...