- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- %post not running
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 04:29 AM
тАО07-29-2004 04:29 AM
Basic stuff, I'm sure, but I'm very new to it all.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 11:41 AM
тАО07-29-2004 11:41 AM
Re: %post not running
A '%post' executes in the 'chroot' environment, so you don't need to redirect the root for rpm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 01:01 PM
тАО07-29-2004 01:01 PM
Re: %post not running
interactive
install
lang en_US.UTF-8
langsupport --default en_US.UTF-8 en_US.UTF-8
#Probe for Mouse
#Probe for Video Card
rootpw --iscrypted XXXXXXXXXXXX
reboot
firewall --disabled
authconfig
timezone --utc America/Chicago
#Prompt for bootloader
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --initlabel
part /boot --fstype ext3 --size=100
part pv.9 --size=4100 --grow
part swap --size=4096
volgroup Volume00 pv.9
logvol / --fstype ext3 --name=LogVol00 --vgname=Volume00 --size=4100 --grow
%packages
@ Everything
-firstboot
-kdebindings-devel
-kdebindings
-galeon
-plugger
-mozilla-devel
-mozilla
-mozilla-nspr
-mozilla-nspr-devel
-mozilla-chat
-mozilla-nss
-mozilla-nss-devel
-mozilla-psm
-mozilla-mail
-mozilla-dom-inspector
-mozilla-js-debugger
%post --nochroot
#Set up for install
#/mnt/sysimage is the hard drive
#/tmp/cdrom is the cdrom driver (if present)
#/dev/console is terminal 1
cddrv=/tmp/cdrom
# Determine cd device
if [ ! -e ${cddrv} ]
then
cddrv=`grep cdrom /proc/ide/*/media | sed -e "s/\/proc\/ide/\/dev/" | sed -e "s/\/media.*//"`
fi
echo "Post processing started" > /mnt/sysimage/tmp/rhks.log
cd /
mkdir /cdrom
#Move to terminal 1 cause that's where read looks for input
chvt 1
correctdisk=0
#Loop until they enter the correct cd
while [ ${correctdisk} -eq 0 ]
do
if [ ! -e /cdrom/ks.cfg ]
then
umount ${cddrv} > /dev/null 2>&1
echo "Message about to be delivered" >> /mnt/sysimage/tmp/rhks.log
echo "" > /dev/console
echo "" > /dev/console
echo "" > /dev/console
echo "Load the XiO boot disk into the CD drive and hit enter to continue" > /dev/console
read ans
echo "Message acknowledged" >> /mnt/sysimage/tmp/rhks.log
mount ${cddrv} /cdrom
else
correctdisk=1
fi
done
#Go to where messages will be written which is 3
chvt 3
echo "Loading additional files"
echo "Correct CD Mounted" >> /mnt/sysimage/tmp/rhks.log
#Determine if updating smp or not
smp=`rpm -qa -r /mnt/sysimage | grep kernel-smp | wc -l`
echo "smp is equal to " >> /mnt/sysimage/tmp/rhks.log
echo "${smp}" >> /mnt/sysimage/tmp/rhks.log
#rpmdb pkg expects /var/lib/rpm. Don't dissappoint them
ln -s /mnt/sysimage/var/lib/rpm /var/lib
#Load the correct set of rpm files
if [ ${smp} -ge 1 ]
then
rpm -Uvh --root /mnt/sysimage /cdrom/errata/comps.rpm /cdrom/errata/kernel-2.4.20-8.i686.rpm /cdrom/errata/initscripts-7.14-1.i386.rpm /cdrom/errata/kernel-source-2.4.20-8.i386.rpm /cdrom/errata/kernel-smp-2.4.20-8.i686.rpm /cdrom/errata/rhn-applet-2.0.9-0.9.0.1.i386.rpm /cdrom/errata/kernel-doc-2.4.20-8.i386.rpm /cdrom/errata/rpmdb-redhat-9-0.20030313.i386.rpm | tee -a /mnt/sysimage/tmp/rhks.log
else
rpm -Uvh --root /mnt/sysimage /cdrom/errata/comps.rpm /cdrom/errata/initscripts-7.14-1.i386.rpm /cdrom/errata/kernel-source-2.4.20-8.i386.rpm /cdrom/errata/kernel-2.4.20-8.i686.rpm /cdrom/errata/rhn-applet-2.0.9-0.9.0.1.i386.rpm /cdrom/errata/kernel-doc-2.4.20-8.i386.rpm /cdrom/errata/rpmdb-redhat-9-0.20030313.i386.rpm | tee -a /mnt/sysimage/tmp/rhks.log
fi
# Determine if bcm 5700 or not
bcm=`lsmod | grep bcm5700 | wc -l`
# Install bcm5700 if needed
if [ ${bcm} -ge 1 ]
then
rpm -ivh --root /mnt/sysimage /cdrom/bcm5700-6.0.2-1.i386.rpm | tee -a /mnt/sysimage/tmp/rhks.log
fi
#Clean up
echo "RPMs installed" >> /mnt/sysimage/tmp/rhks.log
umount ${cddrv}
echo "CD unmounted" >> /mnt/sysimage/tmp/rhks.log
chvt 7
BTW, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 01:22 PM
тАО07-29-2004 01:22 PM
SolutionI can't see anything out of place with it.
A few words however.
You don't need to make the symlink, as rpm has a dbpath flag:
rpm --root /mnt/sysimage --dbpath /mnt/sysimage/var/lib/rpm
Also, pretty much everything you've got here could be done in the chroot environment that usually gets set up (i.e. %post without the --chroot, thus removing the rpm's --root and --dbpath flags).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 02:19 PM
тАО07-29-2004 02:19 PM
Re: %post not running
In tinkering, I created a "post.txt" file on a floppy, mounted it, and ran "sh /floppy/post.txt". It APPEARS to have worked. I commented out lines from the ks.cfg that I didn't think I needed. It is as follows:
#Set up for install
#/tmp/cdrom is the cdrom driver (if present)
#/dev/console is terminal 1
#cddrv=/tmp/cdrom
# Determine cd device
#if [ ! -e ${cddrv} ]
#then
# cddrv=`grep cdrom /proc/ide/*/media | sed -e "s/\/proc\/ide/\/dev/" | sed -e "s/\/media.*//"`
#fi
cddrv=/dev/cdrom
echo "Post processing started" > /tmp/rhks.log
#cd /
mkdir /cdrom
mount /dev/cdrom /cdrom
#Move to terminal 1 cause that's where read looks for input
chvt 1
correctdisk=0
#Loop until they enter the correct cd
while [ ${correctdisk} -eq 0 ]
do
if [ ! -e /cdrom/ks.cfg ]
then
umount ${cddrv} > /dev/null 2>&1
echo "Message about to be delivered" >> /tmp/rhks.log
echo "" > /dev/console
echo "" > /dev/console
echo "" > /dev/console
echo "Load the XiO boot disk into the CD drive and hit enter to continue" > /dev/console
read ans
echo "Message acknowledged" >> /tmp/rhks.log
mount ${cddrv} /cdrom
else
correctdisk=1
fi
done
#Go to where messages will be written which is 3
#chvt 3
echo "Loading additional files"
echo "Correct CD Mounted" >> /tmp/rhks.log
#Determine if updating smp or not
smp=`rpm -qa | grep kernel-smp | wc -l`
echo "smp is equal to " >> /tmp/rhks.log
echo "${smp}" >> /tmp/rhks.log
#rpmdb pkg expects /var/lib/rpm. Don't dissappoint them
ln -s /var/lib/rpm /var/lib
#Load the correct set of rpm files
if [ ${smp} -ge 1 ]
then
rpm -Uvh /cdrom/errata/comps.rpm /cdrom/errata/kernel-2.4.20-8.i686.rpm /cdrom/errata/initscripts-7.14-1.i386.rpm /cdrom/errata/kernel-source-2.4.20-8.i386.rpm /cdrom/errata/kernel-smp-2.4.20-8.i686.rpm /cdrom/errata/rhn-applet-2.0.9-0.9.0.1.i386.rpm /cdrom/errata/kernel-doc-2.4.20-8.i386.rpm /cdrom/errata/rpmdb-redhat-9-0.20030313.i386.rpm | tee -a /tmp/rhks.log
else
rpm -Uvh /cdrom/errata/comps.rpm /cdrom/errata/initscripts-7.14-1.i386.rpm /cdrom/errata/kernel-source-2.4.20-8.i386.rpm /cdrom/errata/kernel-2.4.20-8.i686.rpm /cdrom/errata/rhn-applet-2.0.9-0.9.0.1.i386.rpm /cdrom/errata/kernel-doc-2.4.20-8.i386.rpm /cdrom/errata/rpmdb-redhat-9-0.20030313.i386.rpm | tee -a /tmp/rhks.log
fi
# Determine if bcm 5700 or not
bcm=`lsmod | grep bcm5700 | wc -l`
# Install bcm5700 if needed
if [ ${bcm} -ge 1 ]
then
rpm -ivh /cdrom/bcm5700-6.0.2-1.i386.rpm | tee -a /tmp/rhks.log
fi
#Clean up
echo "RPMs installed" >> /tmp/rhks.log
umount ${cddrv}
echo "CD unmounted" >> /tmp/rhks.log
chvt 7
The only error I got was the "ln -s /var/lib/rpm /var/lib", which was an error about not allowing the /var/lib/rpm to be overwritten.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2004 08:14 PM
тАО07-30-2004 08:14 PM
Re: %post not running
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2004 12:00 PM
тАО08-01-2004 12:00 PM
Re: %post not running
As for 'chvt', I've honestly not seen or used the command before, so I can't really comment on why it didn't switch from an X-session (the man page says 'The key combination (Ctrl-)LeftAlt-F
My first suggestion would be to get rid of the graphical interface by using 'text expert ks=floppy'.
As it's all automated anyway, why have a purdy-graphic-thingie *shrug*.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2004 01:06 PM
тАО08-01-2004 01:06 PM
Re: %post not running
Not being satisfied, I burned a DVD with RH9 CDs 1, 2, & 3 along with the vendor files under a directory labelled errata. I put the ks.cfg file in the top directory and the isolinux directory (that's what RH says to do in version 9). I tried running the CD ks.cfg from both the top and /isolinux directory. I was prompted for language, etc., which I shouldn't have been. I switched to VT3(?) it said it found the ks.cfg file, loaded it to /tmp/kickstart and proceeded to install. The problem is it started asking me questions that are all in the ks.cfg file, i.e. found it but did use it.
So, knowing the floppy kickstart was blowing past the prompt to change CD's or at least it never gave me the instruction to change, I decided to use the floppy again, but with the DVD (which had the vendor stuff on it). The install ran all the way through, anaconda showed "it's" "post installation" was completed and again it didn't ask for anything. After I thought it had failed again, without any warning of what was happening, without me touching any keys or showing a display of what was happening, it went to the DVD and started doing something. Well, it finished the vendor installation script. I wonder if this is an anaconda issue? I thought anaconda was supposed to track your inputs to create an anaconda-ks.cfg file. So, why did it show the "post installation" completing before it got to the ks.cfg %post processes? I guess the moral of the story is not to request a chvt and "read ans" to pause the system for a disc swap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2004 04:54 PM
тАО08-01-2004 04:54 PM
Re: %post not running
I have to admit to not asking for input in a %post. I ask for input (successfully) in a %pre in the ks stuff I do here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2004 08:31 AM
тАО08-02-2004 08:31 AM