Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/distrib/sparc Pullup 1.16 and 1.17 [pk]:



details:   https://anonhg.NetBSD.org/src/rev/09dc02b03888
branches:  netbsd-1-5
changeset: 490275:09dc02b03888
user:      tv <tv%NetBSD.org@localhost>
date:      Tue Nov 28 18:44:49 2000 +0000

description:
Pullup 1.16 and 1.17 [pk]:
Set the md_upgrade_prep_needed flag.
Add functions to move a.out shared libraries to /emul/aout, and call
them from md_prepare_upgrade().

diffstat:

 distrib/sparc/install.md |  123 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 122 insertions(+), 1 deletions(-)

diffs (134 lines):

diff -r 32d5770c3a95 -r 09dc02b03888 distrib/sparc/install.md
--- a/distrib/sparc/install.md  Tue Nov 28 18:38:28 2000 +0000
+++ b/distrib/sparc/install.md  Tue Nov 28 18:44:49 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: install.md,v 1.12.8.2 2000/11/01 03:16:45 tv Exp $
+#      $NetBSD: install.md,v 1.12.8.3 2000/11/28 18:44:49 tv Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -267,3 +267,124 @@
 
 __congratulations_1
 }
+
+md_lib_is_aout() {
+       local r
+       test -h $1 && return 1
+       test -f $1 || return 1
+
+       r=`file $1 | sed -n -e '/ELF/p'`
+       test -z "$r" || return 1
+       return 0
+}
+
+
+md_mv_usr_lib() {
+       local root
+       root=$1
+       for f in $root/usr/lib/lib*.so.[0-9]*.[0-9]* ; do
+               md_lib_is_aout $f || continue
+               mv -f $f $root/emul/aout/usr/lib || return 1
+       done
+       return 0
+}
+
+md_x_shlib_set_14=" \
+       libICE.so.6.3 \
+       libPEX5.so.6.0 \
+       libSM.so.6.0 \
+       libX11.so.6.1 \
+       libXIE.so.6.0 \
+       libXaw.so.6.1 \
+       libXext.so.6.3 \
+       libXi.so.6.0 \
+       libXmu.so.6.0 \
+       libXp.so.6.2 \
+       libXt.so.6.0 \
+       libXtst.so.6.1 \
+       liboldX.so.6.0"
+
+md_mv_x_lib() {
+       local root xlibdir
+       root=$1
+       xlibdir=$2
+       for f in $md_x_shlib_set_14; do
+               md_lib_is_aout $root/$xlibdir/$f || continue
+               mv -f $root/$xlibdir/$f $root/emul/aout/$xlibdir || return 1
+       done
+       return 0
+}
+
+md_mv_aout_libs()
+{
+       local root xlibdir
+
+       root=/mnt       # XXX - should be global
+
+       if [ -d $root/emul/aout/. ]; then
+               echo "Using existing /emul/aout directory"
+       else
+               echo "Creating /emul/aout hierachy"
+               mkdir -p $root/usr/aout || return 1
+
+               if [ ! -d $root/emul ]; then
+                       mkdir $root/emul || return 1
+               fi
+
+               if [ -h $root/emul/aout ]; then
+                       echo "Preserving existing symbolic link from /emul/aout"
+                       mv -f $root/emul/aout $root/emul/aout.old || return 1
+               fi
+
+               ln -s ../usr/aout $root/emul/aout || return 1
+       fi
+
+       # Create /emul/aout/etc and /emul/aout/usr/lib
+       if [ ! -d $root/emul/aout/etc ]; then
+               mkdir $root/emul/aout/etc || return 1
+       fi
+       if [ ! -d $root/emul/aout/usr/lib ]; then
+               mkdir -p $root/emul/aout/usr/lib || return 1
+       fi
+
+       # Move ld.so.conf
+       if [ -f $root/etc/ld.so.conf ]; then
+               mv -f $root/etc/ld.so.conf $root/emul/aout/etc || return 1
+       fi
+
+       # Finally, move the aout shared libraries from /usr/lib
+       md_mv_usr_lib $root || return 1
+
+       # If X11 is installed, move the those libraries as well
+       xlibdir="/usr/X11R6/lib"
+       if [ -d $root/$xlibdir/. ]; then
+               mkdir -p $root/emul/aout/$xlibdir || return 1
+               md_mv_x_lib $root $xlibdir || return 1
+       fi
+
+       echo "a.out emulation environment setup completed."
+}
+
+md_prepare_upgrade()  
+{
+cat << 'EOF'
+This release uses the ELF binary object format. Existing (a.out) binaries
+can still be used on your system after it has been upgraded, provided
+that the shared libraries needed by those binaries are made available
+in the filesystem hierarchy rooted at /emul/aout.
+
+This upgrade procedure will now establish this hierarchy by moving all
+shared libraries in a.out format found in /usr/lib to /emul/aout/usr/lib.
+It will also move the X11 shared libraries in a.out format from previous
+NetBSD/sparc X11 installation sets, if they are installed.
+
+EOF
+       md_mv_aout_libs || {
+               echo "Failed to setup a.out emulation environment"
+               return 1
+       }
+       return 0
+}
+
+# Flag to notify upgrade.sh of the existence of md_prepare_upgrade()
+md_upgrade_prep_needed=1



Home | Main Index | Thread Index | Old Index