RHEL5 - copy files from DVD during %post

Gerald Waugh gwaugh at frontstreetnetworks.com
Wed Feb 11 05:02:30 UTC 2009


John Oliver wrote;
> 
> On Mon, Feb 09, 2009 at 11:03:34AM -0600, Gerald Waugh wrote:
> > Hi,
> > 
> > I have tried several things.
> > Including changing usr/lib/anaconda/kickstart.py
> > > 
> > >     * add this line into the setSteps function
> > >       dispatch.skipStep("methodcomplete")
> > 
> > and changing usr/lib/anaconda/dispatch.py
> > 
> > >     ("methodcomplete", doMethodComplete, ),
> > >     ("dopostaction", doPostAction, ),
> > >>
> > >      for
> > >>
> > >     ("dopostaction", doPostAction, ),
> > >     ("methodcomplete", doMethodComplete, ),
> > -
> > 
> > But always get "CentOS CD not found error"
> 
> I'm glad I'm not the only one who got that!
> 
> I'm not sure when CentOS 5.3 will be released, but using 
> RHEL5.3 got me past this issue.  I could put the stage2.img 
> from RHEL5.3 on an FTP server for you to try if you like.
> 

John,

I used unsquashfs for stage2, edited usr/lib/anaconda/dispatch.py
changing the following lines.
    ("methodcomplete", doMethodComplete, ),
    ("dopostaction", doPostAction, ),
     changed to;
    ("dopostaction", doPostAction, ),
    ("methodcomplete", doMethodComplete, ),
ran ksquashfs on the unsquashed stage2 and it worked fine! :)

full description below... I was using BlueOnyx-5.2-20090107.iso
==================================================================
# Do the following to fix the issue not running %post scripts:
# Note that the *.img files use the squashfs file system.
# if the tools are not on the system yum install them. 
  yum -y install squashfs-tools mkisofs cdrecord
# insert install-cd into cdrom
  mkdir /mnt/cdrom
  mount /dev/cdrom /mnt/cdrom
  mkdir /home/BlueOnyx
  mkdir /home/BlueOnyx/ISOs
  mkdir /home/BlueOnyx/BlueOnyx-5.2-20090107
  cd /mnt/cdrom
# move the iso to a rw area
  tar -c * | tar -C /home/BlueOnyx/BlueOnyx-5.2-20090107 -xf-
  cd  /home/BlueOnyx/BlueOnyx-5.2-20090107
  cp /mnt/cdrom/.discinfo .
  umount /mnt/cdrom
# remove the install cd and insert a fresh CD
  cd /home/BlueOnyx/BlueOnyx-5.2-20090107/images  
  unsquashfs stage2.img
  cd squashfs-root
  vi usr/lib/anaconda/dispatch.py
# find these lines (need to reverse them)
    ("methodcomplete", doMethodComplete, ),
    ("dopostaction", doPostAction, ),
#and change to
    ("dopostaction", doPostAction, ),
    ("methodcomplete", doMethodComplete, ),
# note with vi you will have to use :w! to write the ro file
# recreate the ram file system:
  cd ..
  mksquashfs squashfs-root ../../stage2.img
  cp  ../../stage2.img stage2.img
  rm -rf squashfs-root
  cd ../
  mkisofs -P CentOS -b isolinux/isolinux.bin -c isolinux/boot.cat\
  -no-emul-boot -boot-load-size 4 -boot-info-table -r -J -T -o
../ISOs/BlueOnyx-5.2-20090107-1.iso .
  cd ../ISOs
# note dev arguement may be different execute 'cdrecord scanbus' to find
dev= info
  cdrecord -v dev=5,0,0  BlueOnyx-5.2-20090107-1.iso

Gerald




More information about the Kickstart-list mailing list