(sorry about the repost - pan messed the first one)
Klaus,
just a minor change in your kickstart script - it adds a possibility to
'retry' the rpm upgrade (post-installation) if the command was
unsuccessful.
I'm using it in one of my LPARs, since I was having problems determining
if the package to be upgraded should be ppc or ppc64 - and any error while
doing the upgrade was rendering the installation useless.
Signed-off-by: Klaus Heinrich Kiwi <[EMAIL PROTECTED]>
---
lspp-config/kickstart/src/common-post.cfg | 149 ++++++++++++++++-------------
1 files changed, 80 insertions(+), 69 deletions(-)
diff --git a/lspp-config/kickstart/src/common-post.cfg
b/lspp-config/kickstart/src/common-post.cfg
index fa2e8e3..c849fd0 100644
--- a/lspp-config/kickstart/src/common-post.cfg
+++ b/lspp-config/kickstart/src/common-post.cfg
@@ -39,6 +39,81 @@ cmdline_val () {
fi
}
+get_rpms() {
+ # *** FIXME: alternative package locations, ie CD-R or USB storage
+ BASE="ftp://partners.redhat.com/EAL4_RHEL5/IBM/"
+ while true
+ do
+ echo
+ echo "Need to install the certification RPM and updated RPM
packages:"
+ echo "$RPMS_NEEDED"
+ echo
+ echo "[FIXME] Currently you should also upgrade the following
packages:"
+ echo "[FIXME] "
+ echo "[FIXME]
http://download.fedora.redhat.com/pub/fedora/linux/core/development/"
+ echo "[FIXME] selinux-policy"
+ echo "[FIXME] selinux-policy-targeted"
+ echo "[FIXME] selinux-policy-strict"
+ echo "[FIXME] selinux-policy-mls"
+ echo "[FIXME] selinux-policy-devel"
+ echo "[FIXME] "
+ echo "[FIXME] http://people.redhat.com/dwalsh/SELinux/RHEL5/"
+ echo "[FIXME] pam"
+ echo "[FIXME] pam-devel"
+ echo "[FIXME] "
+ echo "[FIXME] http://people.redhat.com/sgrubb/files/lspp/"
+ echo "[FIXME] kernel"
+ echo "[FIXME] kernel-headers"
+ echo "[FIXME] kernel-devel"
+ echo "[FIXME] "
+ echo "[FIXME] Use a ! escape to put them in the current dir
before continuing."
+ echo
+ echo "Supply a web URL or a local (absolute) directory name."
+ echo
+ echo "If you need to mount a device containing the files,"
+ echo "enter '!' and RETURN to get a shell prompt."
+
+ BASE="$(ask "Location" "$BASE")"
+
+ for RPM in $RPMS_NEEDED
+ do
+ if expr "$BASE" : / >/dev/null
+ then
+ cp -v "$BASE/$RPM" .
+ else
+ wget -c "$BASE/$RPM"
+ fi
+ done
+
+ Missing=
+ for RPM in $RPMS_NEEDED
+ do
+ [ ! -f "$RPM" ] && Missing="$Missing
+$RPM"
+ done
+ [ -z "$Missing" ] && break
+ RPMS_NEEDED="$Missing"
+ done
+
+ Bad=
+ for RPM in *.rpm
+ do
+ if ! rpm --checksig $RPM | grep -q 'gpg OK'
+ then
+ echo "WARNING: no valid signature: $RPM"
+ Bad=y
+ fi
+ done
+
+ [ ! -z "$Bad" ] && {
+ confirm "Install RPMs without valid signatures (not
recommended)" "n" || {
+ die "Installation aborted."
+
+ }
+ }
+}
+
+
die () {
echo >&2 "FATAL: $*"
echo >&2
@@ -66,81 +141,17 @@ cd $RPMTMP
rpm --import /usr/share/rhn/RPM-GPG-KEY
-# *** FIXME: alternative package locations, ie CD-R or USB storage
-
-BASE="ftp://partners.redhat.com/EAL4_RHEL5/IBM/"
while true
do
- echo
- echo "Need to install the certification RPM and updated RPM packages:"
- echo "$RPMS_NEEDED"
- echo
- echo "[FIXME] Currently you should also upgrade the following packages:"
- echo "[FIXME] "
- echo "[FIXME]
http://download.fedora.redhat.com/pub/fedora/linux/core/development/"
- echo "[FIXME] selinux-policy"
- echo "[FIXME] selinux-policy-targeted"
- echo "[FIXME] selinux-policy-strict"
- echo "[FIXME] selinux-policy-mls"
- echo "[FIXME] selinux-policy-devel"
- echo "[FIXME] "
- echo "[FIXME] http://people.redhat.com/dwalsh/SELinux/RHEL5/"
- echo "[FIXME] pam"
- echo "[FIXME] pam-devel"
- echo "[FIXME] "
- echo "[FIXME] http://people.redhat.com/sgrubb/files/lspp/"
- echo "[FIXME] kernel"
- echo "[FIXME] kernel-headers"
- echo "[FIXME] kernel-devel"
- echo "[FIXME] "
- echo "[FIXME] Use a ! escape to put them in the current dir before
continuing."
- echo
- echo "Supply a web URL or a local (absolute) directory name."
- echo
- echo "If you need to mount a device containing the files,"
- echo "enter '!' and RETURN to get a shell prompt."
-
- BASE="$(ask "Location" "$BASE")"
-
- for RPM in $RPMS_NEEDED
- do
- if expr "$BASE" : / >/dev/null
- then
- cp -v "$BASE/$RPM" .
- else
- wget -c "$BASE/$RPM"
- fi
- done
-
- Missing=
- for RPM in $RPMS_NEEDED
- do
- [ ! -f "$RPM" ] && Missing="$Missing
-$RPM"
- done
- [ -z "$Missing" ] && break
- RPMS_NEEDED="$Missing"
-done
-
-Bad=
-for RPM in *.rpm
-do
- if ! rpm --checksig $RPM | grep -q 'gpg OK'
+ get_rpms
+ if [ "$(ls *.rpm)" ] && rpm -Uvh *.rpm
then
- echo "WARNING: no valid signature: $RPM"
- Bad=y
+ break
+ else
+ confirm "RPM upgrade failed - try again?" "y" || die
"Installation aborted."
fi
done
-[ ! -z "$Bad" ] && {
- confirm "Install RPMs without valid signatures (not recommended)" "n"
|| {
- die "Installation aborted."
-
- }
-}
-
-rpm -Uvh *.rpm || die "RPM upgrade failed."
-
echo "Switching SELinux to MLS mode..."
lokkit -q -n --selinuxtype=mls
setenforce 0
--
1.4.1
--
redhat-lspp mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/redhat-lspp