Source-Changes-HG archive

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

[src/netbsd-1-6]: src/distrib/amiga/miniroot Pull up revision 1.19 (requested...



details:   https://anonhg.NetBSD.org/src/rev/399cd3ddeece
branches:  netbsd-1-6
changeset: 528574:399cd3ddeece
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jul 23 07:05:27 2002 +0000

description:
Pull up revision 1.19 (requested by mhitch in ticket #538):
Add support for aout to ELF conversion to install.md, copied from the sparc
miniroot install.md.  Add usr/bin/file and usr/share/misc/magic to the
miniroot - used by the install.md changes.  Upgrades will now move the
standard a.out shared libraries to /emul/aout.

diffstat:

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

diffs (134 lines):

diff -r 795453223628 -r 399cd3ddeece distrib/amiga/miniroot/install.md
--- a/distrib/amiga/miniroot/install.md Mon Jul 22 18:01:53 2002 +0000
+++ b/distrib/amiga/miniroot/install.md Tue Jul 23 07:05:27 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: install.md,v 1.18 2002/04/15 02:48:17 mhitch Exp $
+#      $NetBSD: install.md,v 1.18.2.1 2002/07/23 07:05:27 lukem Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -327,3 +327,124 @@
        done
        umount -f /mnt2 > /dev/null 2>&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