Script d'installation du paquetage "aaa_base"


#
#
# post.sh - to be done after extraction
#
# Copyright (c) 1996 SuSE GmbH Nuernberg, Germany.
#
#
#
# to make shure, var/lib/YaST/bin/bootsetup runs fine, delete
# usr/lib/YaST/.configured2
test -e usr/lib/YaST/.configured2 && rm -f usr/lib/YaST/.configured2
#
# there are some installation with an etc/psdevtab, which is only readable
# for root - this slows ps for any other user. starting ps as root, creates
# it, when it doesn't exist (readable). So simply delete it.
#
test -e etc/psdevtab && rm -f etc/psdevtab
#
# in former releases we had "FONT" in rc.config.  This is called CONSOLE_FONT
# now.  So change it...
#
if test -s etc/rc.config ; then
    if grep "^FONT=" etc/rc.config > /dev/null ; then
        cat etc/rc.config | sed -e"s/^FONT=/CONSOLE_FONT=/" > etc/rc.config.t && \
            mv etc/rc.config.t etc/rc.config
        rm -f etc/rc.config.t
    fi
fi
#
# in former releases we had "TRANSLATION" in rc.config.  This is called
# CONSOLE_UNICODEMAP now.  So change it...
#
if test -s etc/rc.config ; then
    if grep "^TRANSLATION=" etc/rc.config > /dev/null ; then
        cat etc/rc.config | sed -e"s/^TRANSLATION=/CONSOLE_UNICODEMAP=/" > etc/rc.config.t && \
            mv etc/rc.config.t etc/rc.config
        rm -f etc/rc.config.t
    fi
fi
if [ ! -e etc/rc.config ]; then
 echo "#
# /etc/rc.config
#
# Copyright (c) 1996,98 SuSE GmbH Nuernberg, Germany.  All rights reserved.
#
# Author: Florian La Roche , 1996
#         Werner Fink , 1996
#         Burchard Steinbild , 1996
#
# Configuration database for shell scripts in /sbin/init.d, /sbin/SuSEconfig
# and /etc/cron.daily/aaa_base
#
# Please edit this file and execute /sbin/SuSEconfig to configure everything.
# Also don't forget to edit the following files:
#       - /etc/lilo.conf
#       - /etc/fstab
#       - /etc/profile
#       - /etc/hosts
#
" > etc/rc.config
 cat var/adm/fillup-templates/rc.config.aaa_base >> etc/rc.config
 chmod 644 etc/rc.config
else
 echo "Updating etc/rc.config..."
 if [ -x bin/fillup ] ; then
  bin/fillup -q -d = etc/rc.config var/adm/fillup-templates/rc.config.aaa_base
 else
  echo "ERROR: fillup not found. This should not happen. Please compare"
  echo "etc/rc.config and var/adm/fillup-templates/rc.config.aaa_base "
  echo "and update by hand."
 fi
fi
if [ -x bin/fillup ] ; then
    for i in passwd group shadow gshadow ; do
        test -e var/adm/fillup-templates/$i.aaa_base || continue
        if [ -e etc/$i ] ; then
            cp etc/$i etc/$i.t
            cat etc/$i | grep -v "^+" > etc/$i.tt
            test -s etc/$i.tt && mv etc/$i.tt etc/$i
        else
            touch etc/$i
        fi
        if [ -e var/adm/fillup-templates/$i.aaa_base ] ; then
            echo -n "Updating etc/$i..."
            cp etc/$i etc/$i.aaa_tmp
            bin/fillup -q -d ":" etc/$i var/adm/fillup-templates/$i.aaa_base
            if cmp -s etc/$i etc/$i.aaa_tmp ; then
                echo "unchanged"
            else
                echo "modified"
            fi
            rm -f etc/$i.aaa_tmp
        else
            echo "Cannot find var/adm/fillup-templates/$i.aaa_base. strange..."
        fi
        if [ -e etc/$i.t ] ; then
            grep "^+" etc/$i.t >> etc/$i
            rm -f etc/$i.t etc/$i.tt
        fi
        case $i in
          *shadow)
            chmod 600 etc/$i
          ;;
        esac
    done
else
 echo "ERROR: fillup not found. This should not happen."
fi
#
# If we have a NIS system, we have to make sure, that "^+" is at the end
# of passwd.
#
grep -v "^+" etc/passwd > etc/passwd.tmp
grep "^+" etc/passwd >> etc/passwd.tmp
test -s etc/passwd.tmp && cat etc/passwd.tmp > etc/passwd
rm -f etc/passwd.tmp
#
# make sure that nobody and nogroup are set to 65534 (we had -2 in former times)#
for i in etc/passwd etc/group ; do
    cat $i | sed -e"s/:-2:/:65534:/g" -e"s/:-2:/:65534:/g" > $i.t
    test -s $i.t && {
        cat $i.t > $i
    }
    rm -f $i.t
done
#
# create mtab if it does not exist
#
touch etc/mtab
#
# make sure that several log files exist
#
if test ! -d var/log ; then
    mkdir -p var/log
fi
touch var/log/faillog
chmod 600 var/log/faillog
chown root.root var/log/faillog
touch var/log/lastlog
chmod 644 var/log/lastlog
chown root.root var/log/lastlog
touch var/log/wtmp
chmod 664 var/log/wtmp
chown root.tty var/log/wtmp
if test -e usr/sbin/usradd.local -a ! -e usr/sbin/useradd.local ; then
    cp usr/sbin/usradd.local usr/sbin/useradd.local
fi
if test ! -e usr/sbin/useradd.local ; then
    mkdir -p usr/sbin
    cat << EOT > usr/sbin/useradd.local
#!/bin/bash
#
# Here you can add your own stuff, that should be done for every new user.
#
# When you create a new user with YaST, this script will be called
# with the new login name as parameter.  The rest of data can be taken
# from /etc/passwd.
#
EOT
    chmod 744 usr/sbin/useradd.local
fi
if test -e usr/sbin/usrdel.local -a ! -e usr/sbin/userdel.local ; then
    cp usr/sbin/usrdel.local usr/sbin/userdel.local
fi
if test ! -e usr/sbin/userdel.local ; then
    mkdir -p usr/sbin
    cat << EOT > usr/sbin/userdel.local
#!/bin/bash
#
# Here you can add your own stuff, that should be done for every user who
# will be deleted.
#
# When you delete a user with YaST, this script will be called
# with the login name as parameter.  The rest of data can be taken
# from /etc/passwd.
#
EOT
    chmod 744 usr/sbin/userdel.local
fi
XSUSE_FOUND=""
for i in XSuSE_AT3D XSuSE_Matrox XSuSE_NVidia \
         XSuSE_Trident XSuSE_Tseng XSuSE_Mach64 \
         XSuSE_Elsa_GLoria XSuSE_SiS ; do
    test -f usr/X11R6/bin/$i -a ! -L usr/X11R6/bin/$i && XSUSE_FOUND="$XSUSE_FOUND $i"
done
if test -n "$XSUSE_FOUND" ; then
    mkdir -p var/adm/notify/messages
    cat << EOT > var/adm/notify/messages/XSuSE-Server
Hallo,  (english text below)
Ihr System enthaelt die/den aelteren SuSE Server $XSUSE_FOUND.
Diese Server sind mittlerweile in die XFree86 Version eingeflossen.
Wenn Sie die neue Version installiert haben, koennen Sie mittels XF86Setup
auf die neue Version umsteigen.
Hello,
your system contains the old SuSE Server $XSUSE_FOUND.
These servers are now part of the XFree86 servers.  If you have installed
the new version, you can switch to it using XF86Setup.
Have a lot of fun...
                          Your SuSE Team
EOT
fi
XSERVER_FOUND=false
for i in usr/X11R6/bin/XF86_* ; do
    test -f $i && XSERVER_FOUND=true
    # no need for this message if we have the Xwrapper already
    test -x usr/X11R6/bin/Xwrapper && XSERVER_FOUND=false
done
if test $XSERVER_FOUND = true ; then
    mkdir -p var/adm/notify/messages
    cat << EOT > var/adm/notify/messages/Xwrapper
Hallo,  (english text below)
Seit der Version 3.3.2 von XFree86 werden bei den XServern keine
suid root Bits mehr gesetzt.  Stattdessen werden diese Server mittels
Xwrapper gestartet.  Wenn Sie das Paket aaa_base updaten ohne auch
die neue Version des XFree86 zu installieren, koennen Sie nicht ohne
weiteres mittels startx das X11 System starten (Starten mittels xdm
geht weiterhin).
Moegliche Loesungen sind:
1.  Neues XFree86 verwenden.
oder
2.  Aendern sie in der Datein /etc/permissions in der Zeile mit Ihrem
    Server (/usr/X11R6/bin/XF86_*) 755 auf 4755 und rufen Sie SuSEconfig auf.
Eine weitere "Fehlermoeglichkeit" ist die Existenz einer .xserverrc im Home-
Verzeichnis des Benutzers.  Wenn Sie dort den Xwrapper statt des X-Servers
starten, sollte auch dieses Skript wieder funktionieren.
Hi,
Since version 3.3.2 of XFree86 the servers are not set suid root anymore.
startx does now use Xwrapper to start the server.  If you have updated
aaa_base without updating the XFree86, startx will not work (xdm does
still work).
Solutions:
1.  Install new XFree86.
or
2.  Change the entry for your Server in /etc/permissions
    (/usr/X11R6/bin/XF86_*) from 755 to 4755 and run SuSEconfig.
A existing ~/.xserverrc also can make trouble.  Start Xwrapper instead
of the X-Server and it should work again.
Have a lot of fun...
                          Your SuSE Team
EOT
fi
OLD_FW_FOUND=false
test -x usr/sbin/rcmasquerade && OLD_FW_FOUND=true
if test $OLD_FW_FOUND = true ; then
    mkdir -p var/adm/notify/messages
    cat << EOT > var/adm/notify/messages/Old_Firewall
Hallo,  (english text below)
anscheinend ist in Ihrem System das alte SuSE-Firewall Paket installiert.
Aufgrund diverser Probleme mit diesen Skripten wurde dieses Paket nicht
mehr weitergeführt. Sie finden auf den CDs das Paket firewals, und dessen
Doku (nach Installation) unter /usr/doc/packages/firewals.
Um bestehende Systeme nicht zu zerstören, lassen wir diese Konfiguration
unverändert, empfehlen aber, das alte firewall-Paket nicht mehr zu verwenden.
Hi,
obviously you have installed the old SuSE-firewall package in your system.
Due to various problems with this package it has been discontinued. You
can find the package firewals on the CDs and (after installation) its
documentation in /usr/doc/packages/firewals.
To avoid destroying working installations, we will leave this configuration
unchanged, but we strongly discourage further use of the old firewall-package.
Have a lot of fun...
                          Your SuSE Team
EOT
fi
#
# Now do the ugly part.  Delete mess from former times...
#
if test -L usr/i486-linux-libc6/lib/libqimgio.so ; then
    rm -f usr/i486-linux-libc6/lib/libqimgio.so
fi
OLDMODCONF=""
if [ -f etc/conf.modules.rpmsave ] ; then
   OLDMODCONF="etc/conf.modules.rpmsave"
fi
if [ -f etc/modules.conf.rpmsave ] ; then
   OLDMODCONF="etc/modules.conf.rpmsave"
fi
if [ -n "$OLDMODCONF" ] ; then
echo -n "Checking old modules.conf..."
    cat $OLDMODCONF | grep "^alias" | \
    while read dummy orig target ; do
      case $orig in
	eth0|eth1|tr0|scsi_hostadapter)
          if [ "$target" != "off" ] ; then
            echo -n "$orig..."
	    sed -e "s@^alias $orig .*@alias $orig $target@" etc/modules.conf \
            > etc/modules.conf.aa.tmp
            if [ -f etc/modules.conf.aa.tmp ] ; then
              mv etc/modules.conf.aa.tmp etc/modules.conf
            fi
          fi
	  ;;
	*)
	  ;;
      esac
    done
echo "done"
fi
exit 0


(c) SuSE - Dernière mise à jour: 31.03.2000 12:55;