Subject: | |
From: | |
Reply To: | |
Date: | Mon, 9 Jun 2008 17:30:37 +0100 |
Content-Type: | TEXT/PLAIN |
Parts/Attachments: |
|
|
On Mon, 9 Jun 2008, Jan Iven wrote:
> On 06/06/08 19:03, Ken Teh wrote:
> [..]
>> %post
>> ...
>> [ -d /mnt/SL ] || mkdir -p /mnt/SL
>> mount -rvt nfs server.anl.gov:/SL /mnt/SL
>> if [ $? = 0 ]; then
>> echo "server.anl.gov:/SL mounted"
>> else
>> echo "failed to mount server.anl.gov:/SL
>> exit 0
>> fi
>
> The error message from mount, as well as the saved syslog file might have
> some clues, but perhaps you haven't installed portmap (or haven't started
> it)? You will also need nfs-utils, and I've seen recommendations to use the
> "-o nolock" mount option in %post.
>
> If this all still fails, I'd suggest to break out into a shell in the "fail"
> tree of your %post, to allow you to do some debugging. Something like
>
> chvt 6
> /bin/bash -i </dev/tty6 >&/dev/tty6
Well vt 6 is where the installer X server seems to run but yes. I'm
afraid I copy openvt onto the box during %pre so things in %post (etc) can
use it - it is a cleaner tool. (note that the sl5 busybox includes an
'openvt' but that doesn't have the useful options).
In the %post remember that the startup scripts havn't been run so files
like resolv.conf may not have sane contents.
We use "%post --nochroot" so we can first copy bits of state (stuff we
saved from any previous install, the ks files and logs from the install)
into the newly installed tree, and then mount a directory from which we
run various scripts in the chrooted tree:
...
# location of new root
NR=/mnt/sysimage
...
## Get dns lookups working enough to do the first mount (sigh...)
cat > $NR/etc/resolv.conf <<EOF
..... <put your contents here> .....
EOF
## Fix up nsswitch.conf so host name lookups use DNS not try to use NIS
cp $NR/etc/nsswitch.conf $NR/etc/nsswitch.conf.SL_orig
printf "/^hosts:/\ns;:.*;: files dns;\nw\nq\n" | ed $NR/etc/nsswitch.conf
# Since we want to do NFS we need to start portmap and nfslocking (in
# case it is needed), but portmapper needs loopback starting up first!
#
/usr/bin/ifconfig lo 127.0.0.1 up
#
chroot $NR /etc/rc.d/init.d/portmap start
chroot $NR /etc/rc.d/init.d/nfslock start
# Name lookups etc should be ok by now
chroot $NR mount -o ro,nolock $SERV $CFDIR
... code to run the scripts in the chroot environment ...
chroot $NR /etc/rc.d/init.d/nfslock stop
chroot $NR /etc/rc.d/init.d/portmap stop
cd /
chroot $NR umount $CFDIR
--
Jon Peatfield, Computer Officer, DAMTP, University of Cambridge
Mail: [log in to unmask] Web: http://www.damtp.cam.ac.uk/
|
|
|