Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/sparc Add functions to move a.out shared libraries t...
details: https://anonhg.NetBSD.org/src/rev/53ba07a96aa1
branches: trunk
changeset: 499340:53ba07a96aa1
user: pk <pk%NetBSD.org@localhost>
date: Fri Nov 17 17:53:53 2000 +0000
description:
Add functions to move a.out shared libraries to /emul/aout, and call
them from md_prepare_upgrade().
diffstat:
distrib/sparc/install.md | 118 ++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 117 insertions(+), 1 deletions(-)
diffs (129 lines):
diff -r 4b57f9b710cd -r 53ba07a96aa1 distrib/sparc/install.md
--- a/distrib/sparc/install.md Fri Nov 17 17:36:39 2000 +0000
+++ b/distrib/sparc/install.md Fri Nov 17 17:53:53 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: install.md,v 1.15 2000/10/31 21:11:20 pk Exp $
+# $NetBSD: install.md,v 1.16 2000/11/17 17:53:53 pk Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -267,3 +267,119 @@
__congratulations_1
}
+
+md_lib_is_aout() {
+ local r
+ test -h $f && return 1
+ test -f $f || 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 || 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 $xlibdir || return 1
+ fi
+}
+
+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
+}
Home |
Main Index |
Thread Index |
Old Index