If you will have access to the network before and during the
upgrade, you could probably gather the partition/LVM information before the
upgrade, post it somewhere, wget it in the %pre and use it to mount your drives.
I haven’t tried any of this, but common sense tells me it should be
From: kickstart-list-bounces redhat com
[mailto:kickstart-list-bounces redhat com] On Behalf Of Matt Rose
Sent: Tuesday, August 25, 2009 11:27 AM
To: Discussion list about Kickstart
Subject: Re: CentOS upgrade - access to chroot in %pre?
non-tested sample code to give you an idea, the following *WILL NOT* work on
your machine, unless you're really lucky and have your root partition as
the second partition on the first hard drive.
Even if it does work, it won't really do anything.
%pre --interpreter /usr/bin/python --erroronfail --log=/tmp/kspre.log
### This finds the first hard drive
drive = isys.hardDriveDict().keys()
### The following will mount the second partition on the first harddrive as
rootloc = "/tmp/sysimage"
rootdrive = "/dev/%s2" % drive
###The following does some work to set up a somewhat sane chroot environment
os.system("chmod 644 /dev/null")
###The following function lets you open up subprocesses in the chroot
###The following runs an rpm command to check the release in the chroot
Matt Rose wrote:
on upgrade, but it's not easy. You have to detect and mount the partitions
by hand. If you know some python, you can include the anaconda libs and
helper functions, but if you're just using sh, you'd have one hell of a %pre
Moray Henderson (ICT) wrote:
Is it possible to make the /mnt/sysimage/... chroot available to the %pre script of a CentOS 5.3 upgrade?
"To err is human. To purr, feline"
Kickstart-list mailing list
Kickstart-list redhat com