[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
RE: Kickstart Woes Revisited
- From: Patty OReilly <oreilly qualcomm com>
- To: "Parker, Robert" <Robert Parker compaq com>
- Cc: redhat-install-list redhat com
- Subject: RE: Kickstart Woes Revisited
- Date: Fri, 29 Jun 2001 10:35:56 -0700 (PDT)
Yes, I got it to work. I used the tlan.o module from the stage2.img
(described below). I also modified module-info and pcitable (under the
modules directory based on what I found in stage2). I made changes to the
syslinux.cfg file and encorporated that too so the boot process can grab
the ks.cfg via NFS.
Here is the script I use to unpack and then repack the image. You will
have to make some changes to it and provide the tlan.o module for it to
copy into place. It works ok but is not pretty ;)
#!/bin/sh
# Used to make the script interactive...
yes_or_no ( )
{
ANSWER= # Answer read from user
if [ $# -eq 0 ]; then
echo "Usage: yes_or_no message" 1>&2
exit 1
fi
while :
do
echo -n "$@"
read ANSWER
case "$ANSWER" in
[yY] | yes | YES | Yes) return 0 ;;
[nN] | no | NO | No ) return 1 ;;
* ) echo "Please enter y or n." ;;
esac
done
}
# location of RH 7.1 bootnet.img
IMAGE_DIR=/prj/redhat/7.1/RH7.1/images
# location of tlan.o and other misc files
DEV_DIR=/prj/redhat/7.1/kickstart/image
#Your boot image will be named custom.img.
cp $IMAGE_DIR/bootnet.img /tmp/custom.img
# mount the image
mount -o loop /tmp/custom.img /mnt/image
# copy customized syslinux.cfg and dhcpboot.msg to image area
cp $DEV_DIR/syslinux.cfg /mnt/image
cp $DEV_DIR/dhcpboot.msg /mnt/image
cp /mnt/image/initrd.img /tmp
# uncompress initrd.img (it is an ext2 fs)
gzip -dc /tmp/initrd.img > /tmp/myinitrd.ext2
if [ ! -d /mnt/myinitrd ]; then
mkdir /mnt/myinitrd
fi
# mount the initrd image
mount -o loop /tmp/myinitrd.ext2 /mnt/myinitrd
# Remove/Modify the dep file if need be
# edit modules.dep and/or modules-info
# modules-info is read by the RH gui installer, don't forget pcitable.
# The info can be found in drivers.img under images.
#
http://www.ibiblio.org/pub/Linux/distributions/redhat/7.1/en/os/i386/images/
# Uncompress the modules archive on the mounted expanded ramdisk image
gzip -dc /mnt/myinitrd/modules/modules.cgz > /tmp/modules.cpio
# Extract the cpio archive to print a table of contents: not needed
# cpio -itv < /tmp/modules.cpio > /tmp/modules.listing
if [ ! -d /tmp/modules ]; then
mkdir /tmp/modules
fi
cd /tmp/modules
# Extract, make necessary dirs, unconditionally, verbose
# This dumps the modules into the /tmp/modules/<kernel-rev> directory
# where you can add or delete them (to make space).
cpio -idumv < /tmp/modules.cpio
parent_dir=`ls`
echo "parent_dir = $parent_dir"
rev=`echo $parent_dir|sed 's/BOOT//'`
echo "rev = $rev"
# Need a module from the same rev of the kernel
cp $DEV_DIR/$rev/tlan.o $parent_dir
# Make the necessary changes to module-info and modules.dep in
# /mnt/myimage/modules.
if yes_or_no "Do you want me to copy the pcitable modes to
/mnt/myinitrd/modules?"; then
echo "... continuing ..."
cat $DEV_DIR/$rev/pcitable >> /mnt/myinitrd/modules/pcitable
cat $DEV_DIR/$rev/module-info >> /mnt/myinitrd/modules/module-info
else
exit
fi
# Put it all back together
cd /tmp/modules
find $parent_dir | cpio -ov -H crc | gzip >
/mnt/myinitrd/modules/modules.cgz
# unmount and gzip the initial ramdisk.
umount /mnt/myinitrd
stat=$?
while [ $stat -ne 0 ]; do
echo 'please cd out of /mnt/myinitrd'
sleep 2;
umount /mnt/myinitrd
stat=$?
done
# Your original file was /tmp/myinitrd.ext2
# Compress the new initrd.img (/tmp/myinitrd.ext2) using gzip and copy the
# resulting archive onto the boot disk image,
gzip -9 /tmp/myinitrd.ext2
stat=$?
echo "Stat of gzip is $stat"
cp /tmp/myinitrd.ext2.gz /mnt/image/initrd.img
# Unmount the boot disk images, /mnt/image
umount /mnt/image
stat=$?
while [ $stat -ne 0 ]; do
echo 'please cd out of /mnt/image'
sleep 2;
umount /mnt/image
stat=$?
done
# Create a new boot floppy
# Save the new image to your dev dir
if yes_or_no "Are you ready to write to the floppy?"; then
cat /tmp/custom.img > /dev/fd0
cp /tmp/custom.img $DEV_DIR
else
exit
fi
On Fri, 29 Jun 2001, Parker, Robert wrote:
> Date: Fri, 29 Jun 2001 10:19:55 -0700
> From: "Parker, Robert" <Robert Parker compaq com>
> To: "'oreilly qualcomm com'" <oreilly qualcomm com>
> Subject: RE: Kickstart Woes Revisited
>
>
> Have you had any luck at all with this? I cant seem to get the module to
> load either.
>
> Robert
>
> -----Original Message-----
> From: Patty OReilly [mailto:oreilly qualcomm com]
> Sent: Wednesday, June 27, 2001 5:27 PM
> To: redhat-install-list redhat com
> Subject: Re: Kickstart Woes Revisited
>
>
> Hey, thanks for the tips. I had tried inserting the tlan.o into the
> bootnet.img via the method you descibed but it still didn't work. I was
> wondering if there are some dependencies that need to be added to the
> other files that live under the modules directory after mounting
> initrd.img via loopback like modules.dep, modinfo, and pcitable. I had
> used a tlan.o file from a kernel I installed on my box which was the same
> version as that on the RH 7.1 install floppy. Perhaps I should grab the
> one from RedHat/base/stage2.img as you suggested. That will be my next
> tact.
>
> Many thanks.
>
> --patty
>
>
> On Wed, 27 Jun 2001, Seth Alford wrote:
>
> > Date: Wed, 27 Jun 2001 13:34:52 -0700 (PDT)
> > From: Seth Alford <sethal yahoo com>
> > Reply-To: redhat-install-list redhat com
> > To: redhat-install-list redhat com
> > Subject: Re: Kickstart Woes Revisited
> >
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=us-ascii
> >
> > Earlier, Robert Parker wrote:
> > >Im having two issues:
> > >
> > > Problem #1:
> > >
> > > Im installing RH7.1 onto a Compaq Proliant 1850R
> > > server with three disks (raid-1 /, raid-5 /usr). I
> > > want to simply have a single netboot.img floppy
> > > that has a modified SYSLINUX.CFG such that it
> > > immediately kicks off the ks.cfg on the floppy and
> > > performs an NFS install. That much is simple, but
> > > here's the kicker: these Proliant 1850Rs have an
> > > integrated TI ThunderLAN (TLAN) interface and these
> > > interfaces are not supported by the default kernel
> > > in the netboot.img. I don't want to have to pop in
> > > another driver disk when doing what I expect to be
> > > a completely handsfree (well, apart from popping in
> > > and out the floppy) installation, nor do I want to
> > > go the silly route of booting from cdrom then
> > > popping in the floppy and typing in "linux
> > > ks=floppy" in order to get the richer kernel used
> > > on the cdrom (I realize I could also use DHCP for
> > > this, but for various reasons which I wont go into,
> > > DHCP is absolutely verboten in this environment).
> > > I wouldnt mind a non-network install, with the
> > > ks.cfg and install RPMs on a CD-RW, but unhappily
> > > enough RH7.1 is on two cds now and as I mentioned,
> > > changing media during install is too inelegant for
> > > my purposes here.
> >
> > Are you talking about the bootnet.img that's in
> > /images on the RH 7.1 cd1? As nearly as I can
> > tell, there is a module in there for tlan. Assume
> > you have cd1 mounted on /mnt/cdrom. Try looking at
> > (WARNING: this script is untested:)
> >
> > cd /mnt/cdrom/RedHat/base
> > ls stage2.img
> > mkidr /tmp/stage2
> > # Requires the loopback driver
> > mount stage2.img /tmp/stage2 -o loop
> > cd /tmp/stage2/modules
> > gunzip < modules.cgz | cpio -it *tlan*
> >
> > For me, it says:
> >
> > 2.4.2-2BOOT/tlan.o
> >
> > I've put my ks.cfg onto the initrd.img file, within
> > bootnet.img. To do that, you need to do something
> > like (WARNING: again, this is an untested script
> > and incomplete script:)
> >
> > cp /mnt/cdrom/images/bootnet.img /tmp
> > cd /tmp
> > mkdir bootnet initrd
> > # Again, you need the loopback driver
> > mount bootnet.img bootnet -o loop
> > gunzip < bootnet/initrd.img > initrd.img
> > mount initrd.img initrd -o loop
> > cp ks.cfg initrd/
> > umount initrd
> > gzip < initrd.img > bootnet.img/initrd.img
> > # Edit bootnet/syslinux.cfg. Modify
> > # the stanza which loads the system to
> > # have an append which includes:
> > # "ks=file:/ks.cfg initrd=initrd.img"
> > umount bootnet
> > # Then dd the /tmp/bootnet.img to floppy
> >
> > Yes, I know, you can just put ks.cfg onto the floppy,
> > but for various reasons this works better for me.
> >
> > >
> > > So, Ive tried recompiling another kernel that only
> > > supports TLAN and other very basic stuff and
> > > slapping it on the floppy, but no dice, half the
> > > time the kernel wont boot. Anyone have any ideas
> > > on how I can get TLAN support on a netboot.img
> > > floppy kernel (yes, Ive tried the kernels avalable
> > > at http://jpprime.free.fr/proliant/, and no, none
> > > of them have TLAN support)? Perhaps someone who
> > > has a tried and true kernel config file that
> > > supports TLAN and yet is bootable from a
> > > netboot.img floppy? Any other methods Im
> > > overlooking?
> >
> > Yet another method that might work is to unpack
> > kernel source rpm from the RH 7.1 source cd. That
> > rpm puts its cnofig files into
> > /usr/src/redhat/SOURCES. There's one for the BOOT
> > kernel. Modify that cnofig file. Then build the
> > BOOT kernel using:
> >
> > cd /usr/src/redhat/SPECS
> > rpm -bb --target=i386 kernel-2.4.spec
> >
> > After a while, this will create a set of i386
> > kernels, including the BOOT kernel, under
> > /usr/src/redhat/RPMS/i386. Then, create a
> > new installation CD. Follow Erik Troan's
> > (ewt redhat com) instructions as posted in:
> >
> > http://www.redhat.com/mailing-lists/kickstart-list/msg00487.html
> >
> > Erik's comments appear in the anaconda source.
> > anaconda interprets your kickstart file.
> >
> > >
> > > Problem #2:
> > >
> > > Sor some odd reason, all the commands I place in
> > > the %post section which are directed to add a file
> > > or directory to the filesystem, always end up
> > > appending a "?" character to the end of the
> > > filename (regardless of whether its done chrooted
> > > or with --nochroot). Heres an example:
> > >
> > > |
> > > | %post
> > > |
> > > | # Add another nameserver
> > > | echo "nameserver 10.10.0.2" >>
> > /etc/resolv.conf
> > > |
> > >
> > > This will, after reboot, give me a file called
> > > "/etc/resolv.conf?" containing "nameserver
> > > 10.10.0.2". This also happens, as I mention, when
> > > I use the "%post --nochroot" directive with the
> > > /mnt/sysimage appended to the pathnames.
> > > Obviously, this also screws up any RPMs I might be
> > > installing in the %post section, no matter what
> > > their "--root" directive is set to. So, uh, what
> > > gives here? What am I doing wrong? This didnt
> > > seem to happen the last time I mucked around with
> > > kickstart in the 6.1 days.
> >
> > I haven't seen this, and I am copying files during
> > a non-chrooted %post install for use during a
> > chrooted %post install.
> >
> > >
> > > Essentially, Ive got this pipedream that a Linux
> > > kickstart should be as easy or easier than a
> > > handsfree Solaris Jumpstart. Crazy me.
> > >
> > > Thanks in advance for any help you can provide.
> > >
> > > Robert Parker
> >
> > RedHat also has a kickstart-list, where topics
> > like this are discussed. Maybe try posting
> > something there and see if someone responds?
> >
> > --Seth
> > sethal yahoo com
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
> >
> >
> >
> > _______________________________________________
> > Redhat-install-list mailing list
> > Redhat-install-list redhat com
> > https://listman.redhat.com/mailman/listinfo/redhat-install-list
> >
>
>
>
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list redhat com
> https://listman.redhat.com/mailman/listinfo/redhat-install-list
>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]