This Blog is for my ARM and linux work

Sunday, February 22, 2009

Work has not been started on LPC2129 Dev Board

I have Dev board having LPC2129, ha but the work has not been started, I m clueless that what should I do. Need a little assistance..
Work Hard Good Luck..

Thursday, February 19, 2009

The Command which wrote the ISO image


mkisofs -J -v -T -o /media/IFREEAGENT/i386-dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -m TRANS.TBL /root/mkrhdvd

*
-o /media/IFREEAGENT/i386-dvd.iso = -o is the output file name switch, we provide the output filename here


/root/mkrhdvd = is the path where we have copy and merged all the CDs, this is the out put of script in my previous posts, in next post i will give the edited version of that script, the exact you need to run from the cmd prompt.

ARM projects

link to ARM projects
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/

Sunday, February 8, 2009

Ahhaaa !!! At last I got RH9 in DVD...

This was not an easy job, There was series of Hits and Trails..
And at last I was able to combine all three CDs of RedHat 9, and make its DVD version..
My this Tute about this problem, is not copy and paste, it is just hybrid of the earlier tutorials and
my fix to it, As in my earlier post you got a complete fix, two method on is complete manual ans another is complete automatic by script.
But both has their own limitation, the automatic need some extra package install on your system, which is usually not there in your system.
And in the manual, obvious higher level of knowledge...

My way in the the mid way of both. It does not ask you to install some package, means No dependency
I use some certain part of script to get copied as one single folder somewhere in the file system.
But before using the following script, you need make some arrangement as following
  • Have ISO image for all the CDs you need to include in Distro
  • Have 3x Space free on the current Filesystem.
  • Keep the script and all ISO images in the same directory
  • Size of Distro+500 MB space free, where your Home Directory resides, as it creates the single folder Named mkrhdvd in the Home Directry.
here is the script copy and save as .sh, give executable permission then run.

#############################################################
#!/bin/bash

# Originally by Chris Kloiber
# Modified by Alok Choudhary
#
# A quick hack that will create a bootable DVD iso of a Red Hat Linux
# Distribution. Feed it either a directory containing the downloaded
# iso files of a distribution, or point it at a directory containing
# the "RedHat", "isolinux", and "images" directories.

# This version only works with "isolinux" based Red Hat Linux versions.

# Lots of disk space required to work, 3X the distribution size at least.

# GPL version 2 applies. No warranties, yadda, yadda. Have fun.


if [ $# -lt 2 ]; then
echo "Usage: `basename $0` source /destination/DVD.iso"
echo ""
echo " The 'source' can be either a directory containing a single"
echo " set of isos, or an exploded tree like an ftp site."
exit 1
fi

cleanup() {
[ ${LOOP:=/tmp/loop} = "/" ] && echo "LOOP mount point = \/, dying!" && exit
[ -d $LOOP ] && rm -rf $LOOP
[ ${DVD:=~/mkrhdvd} = "/" ] && echo "DVD data location is \/, dying!" && exit
[ -d $DVD ] && rm -rf $DVD
}

cleanup
mkdir -p $LOOP
mkdir -p $DVD

if [ !`ls $1/*.iso 2>&1>/dev/null ; echo $?` ]; then
echo "Found ISO CD images..."
CDS=`expr 0`
DISKS="1"

for f in `ls $1/*.iso`; do
mount -o loop $f $LOOP
cp -av $LOOP/* $DVD
if [ -f $LOOP/.discinfo ]; then
cp -av $LOOP/.discinfo $DVD
CDS=`expr $CDS + 1`
if [ $CDS != 1 ] ; then
DISKS=`echo ${DISKS},${CDS}`
fi
fi
umount $LOOP
done
if [ -e $DVD/.discinfo ]; then
awk '{ if ( NR == 4 ) { print disks } else { print ; } }' disks="$DISKS" $DVD/.discinfo > $DVD/.discinfo.new
mv $DVD/.discinfo.new $DVD/.discinfo
fi
else
echo "Found FTP-like tree..."
cp -av $1/* $DVD
[ -e $1/.discinfo ] && cp -av $1/.discinfo $DVD
fi

rm -rf $DVD/isolinux/boot.cat
find $DVD -name TRANS.TBL | xargs rm -f

cd $DVD
mkisofs -J -R -v -T -o $2 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
/usr/lib/anaconda-runtime/implantisomd5 --force $2

cleanup
echo ""
echo "Process Complete!"
echo ""
########################SCRIPTS ENDS HERE######################

My struggle to make ISO dvd

past two hours I m struggling with the this point to create the DVD from the 3 install disk

everything is fine i m able to understand the last the far most thing is to mkisofs (cmd which makes the iso format )
as form my previous post you can get the script, but in the straight away it will work for you, I m not sure(still i have not installed anaconda-runtime, may be that is the reason)

in the script it looks for the boot catalog in isolinux dir, I am seeing the directory right now but now able to find, I think should be script flaw..


I study and made my own cmd on cmd prompt, but i dont know that it is not able to see the isolinux.bin (the boot image) ..


Edited the script, I have given the source, in previous post..
it is running dont know what will happen...
DAMN !!!!!!!!!!!!!!!!!!

My struggle to make ISO dvd

past two hours I m struggling with the this point to create the DVD from the 3 install disk

everything is fine i m able to understand the last the far most thing is to mkisofs (cmd which makes the iso format )
as form my previous post you can get the script, but in the straight away it will work for you, I m not sure(still i have not installed anaconda-runtime, may be that is the reason)

in the script it looks for the boot catalog in isolinux dir, I am seeing the directory right now but now able to find, I think should be script flaw..


I study and made my own cmd on cmd prompt, but i dont know that it is not able to see the isolinux.bin (the boot image) ..

AND the HELL..
not about write the DVD ISO from the linux..
came back on linux ..
and try to use my own mind generated way..
as I have studied 2nd and 3rd CD, there are having not much info, except that there are 2nd and 3rd CD and the pack of RPM...
I have downloaded the magicISO, which is able to make bootable CD/DVD even when we are able to pass the bott image from external side..
still there are 50-50 chances, but I have some hope, now either it will work or not, that will be decided after I m able to complete this process
still extracting the data from all the CDs..
Say me Good Luck... :)

Creating a RHEL bootable DVD ISO with script code at the last...

Creating a RHEL bootable DVD ISO
As of this writing, the current RHEL release (4) is only available on CDs, not DVD. It is possible to create a bootable DVD ISO from these CDs using Chris Kloiber's mkdvdiso.sh script.

1. Download mkdvdiso.sh.
http://mirror.centos.org/centos/build/mkdvdiso.sh

2. Install the anaconda-runtime prerequisite package and its dependencies.
# rpm -q anaconda-runtime || yum -y install anaconda-runtime

3. Place the CD ISO files and mkdvdiso.sh in a directory, and run the mkdvdiso.sh script.
# ls -1
mkdvdiso.sh
RHEL4-U4-i386-AS-disc1.iso
RHEL4-U4-i386-AS-disc2.iso
RHEL4-U4-i386-AS-disc3.iso
RHEL4-U4-i386-AS-disc4.iso
RHEL4-U4-i386-AS-disc5.iso

The following command creates a RHEL bootable DVD ISO named RHEL-U4-i386-AS-dvd.iso.
# ./mkdvdiso.sh . $(pwd)/RHEL-U4-i386-AS-dvd.iso

______________________________________________
### Many many thanks to Chris Kloiber
##source of mkdvdiso.sh
###
#!/bin/bash

# by Chris Kloiber

# A quick hack that will create a bootable DVD iso of a Red Hat Linux
# Distribution. Feed it either a directory containing the downloaded
# iso files of a distribution, or point it at a directory containing
# the "RedHat", "isolinux", and "images" directories.

# This version only works with "isolinux" based Red Hat Linux versions.

# Lots of disk space required to work, 3X the distribution size at least.

# GPL version 2 applies. No warranties, yadda, yadda. Have fun.


if [ $# -lt 2 ]; then
echo "Usage: `basename $0` source /destination/DVD.iso"
echo ""
echo " The 'source' can be either a directory containing a single"
echo " set of isos, or an exploded tree like an ftp site."
exit 1
fi

cleanup() {
[ ${LOOP:=/tmp/loop} = "/" ] && echo "LOOP mount point = \/, dying!" && exit
[ -d $LOOP ] && rm -rf $LOOP
[ ${DVD:=~/mkrhdvd} = "/" ] && echo "DVD data location is \/, dying!" && exit
[ -d $DVD ] && rm -rf $DVD
}

cleanup
mkdir -p $LOOP
mkdir -p $DVD

if [ !`ls $1/*.iso 2>&1>/dev/null ; echo $?` ]; then
echo "Found ISO CD images..."
CDS=`expr 0`
DISKS="1"

for f in `ls $1/*.iso`; do
mount -o loop $f $LOOP
cp -av $LOOP/* $DVD
if [ -f $LOOP/.discinfo ]; then
cp -av $LOOP/.discinfo $DVD
CDS=`expr $CDS + 1`
if [ $CDS != 1 ] ; then
DISKS=`echo ${DISKS},${CDS}`
fi
fi
umount $LOOP
done
if [ -e $DVD/.discinfo ]; then
awk '{ if ( NR == 4 ) { print disks } else { print ; } }' disks="$DISKS" $DVD/.discinfo > $DVD/.discinfo.new
mv $DVD/.discinfo.new $DVD/.discinfo
fi
else
echo "Found FTP-like tree..."
cp -av $1/* $DVD
[ -e $1/.discinfo ] && cp -av $1/.discinfo $DVD
fi

rm -rf $DVD/isolinux/boot.cat
find $DVD -name TRANS.TBL | xargs rm -f

cd $DVD
mkisofs -J -R -v -T -o $2 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
/usr/lib/anaconda-runtime/implantisomd5 --force $2

cleanup
echo ""
echo "Process Complete!"
echo ""

Saturday, February 7, 2009

How to make your own RedHat 8.0 DVD from the CD ISO images

Red Hat has finally created a DVD version of their distribution for US
consumers. (They've had one in Europe for a while, I understand.)
For 8.0, though, it seems that you have to buy RedHat 8.0 Professional
to get the DVD, and RedHat is not presently offering an ISO image of
the DVD for download.

After reading some of the anaconda source code, I have figured out how
you can make your own DVD from the CD ISO images. I've done this,
written it to a DVD+RW disc, had it pass its Media check, and
successfully installed from it.

The idea is simple, which is a testament to the flexibility of Red
Hat's installation system. There's a file on the root of each CD
called .discinfo that contains information including which discs'
contents are represented. The CDs each contain only a single number
here, but the installation software will accept a comma-separated list
of numbers. The sequence of commands below will create an ISO image
that consists of the combined contents of the five discs + the
documentation disc (in a docs subdirectory) and is bootable and
suitable for being installed from. If you don't care about docs, omit
the docs/=Psyche-docs argument, and don't bother with the docs ISO.
If you don't care about sources, omit the SRPMS/= arguments and
dispense with discs 4 and 5.

These instructions require you to have enough disk space for the
resulting ISO image, but if you have a DVD burner and don't care about
installing the media checksum so that you can test the media from
install (not really that important if you have verified the checksums
of the original images, unless you're concerned about errors resulting
from the actual DVD creation process itself), you can pipe the output
of mkisofs directly to your burning software and not worry about the
intermediate disk space.

So here are the steps. These steps create a DVD image that is usable
from a Unix system. Add the -J and -T flags to the mkisofs command if
you want something that you can read from Windows as well. Add
-V "Label" if you want to create a volume label.

1. Go to a place on your drive with about 3.5 GB free. This is
needed for the final ISO image only. You'll need a 2.4 kernel to
create a file > 2 GB. If you're running Red Hat, This works on a
7.1 system or newer.

2. Create directories on which to mount the ISO images using loop
device mounts:

mkdir Psyche-i386-disc{1,2,3,4,5} Psyche-docs

3. Mount the ISO images using a loop device mount:

mount -o ro,loop .../Psyche-i386-disc1.iso Psyche-i386-disc1
mount -o ro,loop .../Psyche-i386-disc2.iso Psyche-i386-disc2
# etc. -- repeat for the remaining discs that you want
# Replace ... with the path to your ISO images.

4. Copy the isolinux directory and the .discinfo from disc1 to the
current directory:

cp -a Psyche-i386-disc1/isolinux Psyche-i386-disc1/.discinfo .

5. Edit the .discinfo file, replacing the fourth line with 1,2,3,4,5
if you are creating an image with all five discs or with 1,2,3 if
you are just using the three install discs.

6. Create the iso image. I'm separating this mkisofs command into
multiple lines ending with \ for clarity. You can type it that
way or as a long command. I explain this command at the end.

mkisofs -o Psyche-i386-dvd.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-R -m TRANS.TBL \
-x Psyche-i386-disc1/.discinfo -x Psyche-i386-disc1/isolinux \
-graft-points Psyche-i386-disc1 .discinfo=.discinfo isolinux/=isolinux \
RedHat/=Psyche-i386-disc2/RedHat RedHat/=Psyche-i386-disc3/RedHat \
SRPMS/=Psyche-i386-disc3/SRPMS SRPMS/=Psyche-i386-disc4/SRPMS \
SRPMS/=Psyche-i386-disc5/SRPMS docs/=Psyche-docs

7. (Optional) If you want to create a media checksum for the
installation software to look at when you do a media test during
install, then following these additional steps:

a. Install the anaconda source rpm located on disc5 and cd /usr/src/redhat

b. Comment out the BuildPreReq line in SPECS/anaconda.spec

c. Run rpmbuild -bp SPECS/anaconda.spec

d. Go to BUILD/anaconda-8.0/isomd5sum

e. Run "make"

f. Run ./implantisomd5 .../Psyche-i386-dvd.iso (where ... is
replaced with the path to your new ISO image). This step
will take several minutes and not provide any feedback while
it runs.

Now burn the resulting ISO image to a DVD.

Here's the mkisofs command explained:

# Write the output to Psyche-i386-dvd.iso
mkisofs -o Psyche-i386-dvd.iso \

# Set up the DVD to be bootable using an El Torito boot image.
# This comes from the RELEASE_NOTES file on disc 1.
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \

# Use Rock ridge extensions (to support long file names, etc.).
# Exclude all TRANS.TBL files on the original disc. If you want
# to access this disc from Windows, add -J to create Joliet
# extensions and -T to create new TRANS.TBL files in place of
# the ones you're omitting.
-R -m TRANS.TBL \

# Omit the .discinfo and isolinux files from disc1
-x Psyche-i386-disc1/.discinfo -x Psyche-i386-disc1/isolinux \

# Use Psyche-i386-disc1 (minus above exclusions) as the root.
# Graft the .discinfo and isolinux directories from the current
# directory to .discinfo and isolinux on the new disc. Also
# graft in the RedHat and SRPMS directories from the remaining
# discs. Include the entire contents of the docs disc in the
# docs subdirectory.
-graft-points Psyche-i386-disc1 .discinfo=.discinfo isolinux/=isolinux \
RedHat/=Psyche-i386-disc2/RedHat RedHat/=Psyche-i386-disc3/RedHat \
SRPMS/=Psyche-i386-disc3/SRPMS SRPMS/=Psyche-i386-disc4/SRPMS \
SRPMS/=Psyche-i386-disc5/SRPMS docs/=Psyche-docs

Compiling Kernel 2.4.x

This whole day i was on the compiling the kernel 2.4.x
but still the moment, i m not successed
i m not able to make the initial RAM disk,
If i m able to make it, i m done with the the compilation..
i have have done, i have screwed the half setting let see if next time i m able to run the system or not ???

Friday, February 6, 2009

Idiots Guide to 2.6.x kernel compiles

Idiots Guide to 2.6.x kernel compiles
--------------------------------------

I am writting this to give a general walkthrough of how
to compile and install the new 2.6 series kernel. Below are
three major selling points of why to upgrade from 2.4
- Bootup time is so much faster
- Alsa support built right into the kernel (sound)
- Your system almost feels like it has a faster CPU in it

Ok enough with the good points. Lets get down to the install.
All the shell commands will start with a #. These should be
run in either the console or a console window (xterm)

1) Change directories to the standard place for kernel installs. Since
a lot of 3rd party applications look for the kernel source in
/usr/src lets compile in that directory.
# cd /usr/src

2) Now lets download the newest kernel. At the time of writting this
2.6.0-test11 is the lastest. This seems to change every 2-3 weeks.
I like to use ncftp but you are free to use any ftp client.
# ncftp ftp.kernel.org
At the ftp prompt send the following commands
ftp> cd pub/linux/kernel/v2.6
ftp> get linux-2.6.0-test11.tar.bz2
wait.. wait.. and wair

3) Once it is down downloading. Exit out of the ftp client and lets
un package our new kernel
# tar jxfv linux-2.6.0-test11.tar.bz2

4) You will notice it gets un-packaged in /usr/src/linux-2.6.
We want to also put it in /usr/src/linux. So lets create a
symlink
# ln -sf linux-2.6.0-test11 linux

5) Now that we have a symlink created Go into that directory and lets
configure our new kernel
# cd linux
There are two options to config the kernel. Open a ncurses window,
which you can do in a console window or if you are using X you can
open a nice GUI window.
# make menuconfig (for the ncurses based)
or
# make xconfig (for the X based)

6) This is the part where you have to know something about your system.
Most system, this default config will work just fine. Chances are
You will need to install your network driver and sound driver. I am
going to show you where those are, the rest is up to you to figure
out

7) Follow this path to your network driver.
Device Drivers->Networking Support->Ethernet (10 or 100Mbit)
In there you will see a list of chipsets. Select the one that meets
your needs.
* = means compiled into the kernel
M = means as a module
I'd reocmmend compiling them into the kernel

8) Lets do the same for your soundcard. From the root menu
Device Drivers->Sound->Advanced Linux Sound Architecture->PCI devices

9) Save your kernel. In the xconfig hit the disk icon of file->save.
In the menuconfig just keep selecting exit until you are prompted to
save.

10) Lets compile your kernel!
# make

11) If you don't see any errors, lets install it
# make install

12) Your kernel is installed, but we have to do some moving around
of the kernel files first and then edit the boot loader. So lets
get the files in the right place. make install copies the files
to your root partition (/) so lets move them out of there into the
/boot directory
# cd /
# mv vmlinux /boot/vmlinuz-2.6.0-test11
# mv System.map /boot/System.map-2.6.0-test11
I like to change the name so I can keep my old kernels labeled. Its
always a good idea to keep older kernels, just in case a compile
doesn't load for you. That way you can always go back to the old
kernel and get into your OS.

13) We need to change the symlink for the old System.map to point
to the new one.
# ln -sf /boot/System.map-2.6.0-test11 /boot/System.map

14) Now we need to make a kernel image. This is because Redhat (Fedora)
used partition labels. If you do now use a kernel ramdisk image
then your kernel will not load. You can get around this by replacing
all occurances of parition labels with their partition, but that is a
pain so lets make a ramdisk image Also the ext3 is built as a module
so your OS will not load if you do not make an ramdisk image
# mkinitrd /boot/initrd-2.6.0-test11.img 2.6.0-test11

15) Now lets edit our bootloader.
I like vi, but feel free to use any text editor you like
# vi /etc/lilo.conf
that is for lilo
# vi /boot/grub/grub/conf
that is grub.
Now in there your last line will be something like this


LILO
-----
image=/boot/vmlinuz-2.4.22-1.2115.nptl
label=2.4.22-1.2115.n
initrd=/boot/initrd-2.4.22-1.2115.nptl.img
read-only
append="root=LABEL=/"
Grub
----
title Fedora Core (2.4.22-1.2115.nptl)
root (hd0,0)
kernel /vmlinuz-2.4.22-1.2115.nptl ro root=LABEL=/
initrd /initrd-2.4.22-1.2115.nptl.img


That is the standard kernel for fedora core1. So what we do is copy
that whole section and then paste it right below it. Now that we
have two copies of it we need to edit it to look like this

LILO
------
image=/boot/vmlinuz-2.6.0-test11
label=2.4.0-test11
initrd=/boot/initrd-2.6.0-test11.img
read-only
append="root=LABEL=/"

Grub
------
title 2.6.0-test11
root (hd0,0)
kernel /vmlinuz-2.6.0-test11 ro root=LABEL=/
initrd /initrd-2.6.0-test11.img


16) If you run grub you can just reboot and you just see the new
kernel in your grub menu. If you use lilo then run the following
command
# lilo
You should see the 2.6.0-test11 listed and then you are good
to go ahead and reboot.