Hi, I’m currently embroiled in a project to upgrade a RHEL3 installation to RHEL4 unattended via kickstart.
I need to do some cleanup work in the %pre section on the existing installation. (installation state is known and fixed) More specifically, I need to remove some rpms. I have tried this two ways. First, I tried using rpm –r to reset the root of the effective filesystem to /mnt/sysimage (I mount the filesystem manually) but that didn’t seem to work for some reason. What I’m doing now is mounting the partition, writing a script (removerpms.sh) into /mnt/sysimage/tmp, then running chroot /mnt/sysimage /tmp/removerpms.sh. Afterwards I umount the partition. The rpms are successfully removed, however anaconda subsequently errors out because the umount has failed. I found that /proc was getting mounted as a side effect of the script running, so I added a umount for that. Here’s the weird part: If I deliver the kickstart file over the network, and use an HTTP-based install source, it works. However, if I change the kickstart file to use CD installation, and put it on the CD, it errors out because umount doesn’t work. /etc/mtab reveals nothing mounted other than /mnt/sysimage,
Any thoughts on how to resolve this? I’m about to compile a static version of lsof to check on this, but if anyone has successfully solved this problem before (removing rpms in %pre via kickstart) I’d appreciate some pointers. Google has not been good to me.
-Sean. |