Accepting request 47473 from home:oertel:branches:openSUSE:Factory

OBS-URL: https://build.opensuse.org/request/show/47473
OBS-URL: https://build.opensuse.org/package/show/Base:System/aaa_base?expand=0&rev=141
This commit is contained in:
Stephan Kulow 2010-09-09 11:43:46 +00:00 committed by Git OBS Bridge
parent 8f8421123c
commit d861ada1ee
3 changed files with 101 additions and 97 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Sep 8 11:43:23 CEST 2010 - ro@suse.de
- add leading / to pre/post scripts (bnc#625763)
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Sep 3 19:43:51 UTC 2010 - trenn@novell.com Fri Sep 3 19:43:51 UTC 2010 - trenn@novell.com

View File

@ -9,29 +9,29 @@
# Run this script in C-Locale, or some tools will fail. # Run this script in C-Locale, or some tools will fail.
export LC_ALL=C export LC_ALL=C
# #
# to make shure, var/lib/YaST/bin/bootsetup runs fine, delete # to make sure, /var/lib/YaST/bin/bootsetup runs fine, delete
# usr/lib/YaST/.configured2 # /usr/lib/YaST/.configured2
test -e usr/lib/YaST/.configured2 && rm -f 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 # 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 # 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. # it, when it doesn't exist (readable). So simply delete it.
# #
test -e etc/psdevtab && rm -f etc/psdevtab test -e /etc/psdevtab && rm -f /etc/psdevtab
# #
# if the old nsswitch.conf contains dns6, replace it with dns # if the old nsswitch.conf contains dns6, replace it with dns
# #
test -f etc/nsswitch.conf.rpmnew && grep dns6 etc/nsswitch.conf >/dev/null 2>&1 && { test -f /etc/nsswitch.conf.rpmnew && grep dns6 /etc/nsswitch.conf >/dev/null 2>&1 && {
sed -i -e "s|dns6|dns|g" etc/nsswitch.conf sed -i -e "s|dns6|dns|g" /etc/nsswitch.conf
} }
# GMT might already be in sysconfig/clock # GMT might already be in sysconfig/clock
%{rename_sysconfig_variable -f etc/sysconfig/clock GMT HWCLOCK} %{rename_sysconfig_variable -f /etc/sysconfig/clock GMT HWCLOCK}
# #
# Initialize runlevel links # Initialize runlevel links
# #
%{fillup_and_insserv -y boot.proc boot.localfs boot.swap boot.clock boot.ldconfig boot.ipconfig boot.klog boot.localnet halt random reboot single} %{fillup_and_insserv -y boot.proc boot.localfs boot.swap boot.clock boot.ldconfig boot.ipconfig boot.klog boot.localnet halt random reboot single}
%{insserv_force_if_yast etc/init.d/boot.loadmodules etc/init.d/boot.cleanup etc/init.d/boot.rootfsck} %{insserv_force_if_yast /etc/init.d/boot.loadmodules /etc/init.d/boot.cleanup /etc/init.d/boot.rootfsck}
## powerfail probably needs empty header ... ## powerfail probably needs empty header ...
# add Kill-links in boot.d if needed: # add Kill-links in boot.d if needed:
@ -45,8 +45,8 @@ done
%{remove_and_set -n suseconfig CHECK_INITTAB} %{remove_and_set -n suseconfig CHECK_INITTAB}
%{remove_and_set -n suseconfig HALT_SOUND} %{remove_and_set -n suseconfig HALT_SOUND}
if ! [ -d etc/sysconfig ] ; then if ! [ -d /etc/sysconfig ] ; then
mkdir -p etc/sysconfig mkdir -p /etc/sysconfig
fi fi
for i in language backup boot kernel \ for i in language backup boot kernel \
suseconfig clock proxy windowmanager sysctl \ suseconfig clock proxy windowmanager sysctl \
@ -55,27 +55,26 @@ for i in language backup boot kernel \
done done
# migrate HALT_SOUND value if set before # migrate HALT_SOUND value if set before
if [ -n "$HALT_SOUND" -a "$HALT_SOUND" != "no" ] ; then if [ -n "$HALT_SOUND" -a "$HALT_SOUND" != "no" ] ; then
sed -i -e "s|^HALT_SOUND=.*|HALT_SOUND=\"$HALT_SOUND\"|" etc/sysconfig/shutdown sed -i -e "s|^HALT_SOUND=.*|HALT_SOUND=\"$HALT_SOUND\"|" /etc/sysconfig/shutdown
fi fi
# fix sysconfig backup dir # fix sysconfig backup dir
if grep -q RCCONFIG_BACKUP_DIR../var/adm/backup/rpmdb etc/sysconfig/backup; then if grep -q RCCONFIG_BACKUP_DIR../var/adm/backup/rpmdb /etc/sysconfig/backup; then
sed -i -e "s|^RCCONFIG_BACKUP_DIR=.*|RCCONFIG_BACKUP_DIR=\"/var/adm/backup/sysconfig\"|" \ sed -i -e "s|^RCCONFIG_BACKUP_DIR=.*|RCCONFIG_BACKUP_DIR=\"/var/adm/backup/sysconfig\"|" \
etc/sysconfig/backup /etc/sysconfig/backup
mkdir -p /var/adm/backup/sysconfig mkdir -p /var/adm/backup/sysconfig
mv /var/adm/backup/rpmdb/sysconfig[-_]* /var/adm/backup/sysconfig 2>/dev/null mv /var/adm/backup/rpmdb/sysconfig[-_]* /var/adm/backup/sysconfig 2>/dev/null
fi fi
if grep -q "SEND_OUTPUT_ON_NO_ERROR=\"yes\"" etc/sysconfig/cron ; then if grep -q "SEND_OUTPUT_ON_NO_ERROR=\"yes\"" /etc/sysconfig/cron ; then
if test ! -f var/adm/bnc_622203_fixed ; then if test ! -f /var/adm/bnc_622203_fixed ; then
sed -e "s|^SEND_OUTPUT_ON_NO_ERROR=\"yes\"|SEND_OUTPUT_ON_NO_ERROR=\"no\"|" \ sed -i -e "s|^SEND_OUTPUT_ON_NO_ERROR=\"yes\"|SEND_OUTPUT_ON_NO_ERROR=\"no\"|" \
etc/sysconfig/cron > etc/sysconfig/cron.new \ /etc/sysconfig/cron
&& mv etc/sysconfig/cron.new etc/sysconfig/cron touch /var/adm/bnc_622203_fixed
touch var/adm/bnc_622203_fixed
fi fi
fi fi
# clear old install settings of MODULES_LOADED_ON_BOOT # clear old install settings of MODULES_LOADED_ON_BOOT
eval `grep "^MODULES_LOADED_ON_BOOT" etc/sysconfig/kernel` eval `grep "^MODULES_LOADED_ON_BOOT" /etc/sysconfig/kernel`
MLOB_NEW="" MLOB_NEW=""
for i in $MODULES_LOADED_ON_BOOT ; do for i in $MODULES_LOADED_ON_BOOT ; do
case $i in case $i in
@ -85,7 +84,7 @@ for i in $MODULES_LOADED_ON_BOOT ; do
done done
if test "$MODULES_LOADED_ON_BOOT" != "$MLOB_NEW" ; then if test "$MODULES_LOADED_ON_BOOT" != "$MLOB_NEW" ; then
sed -i -e "s|^MODULES_LOADED_ON_BOOT=.*|MODULES_LOADED_ON_BOOT=\"$MLOB_NEW\"|" \ sed -i -e "s|^MODULES_LOADED_ON_BOOT=.*|MODULES_LOADED_ON_BOOT=\"$MLOB_NEW\"|" \
etc/sysconfig/kernel /etc/sysconfig/kernel
fi fi
# #
# Backup gshadow file and remove it (merge passwords into # Backup gshadow file and remove it (merge passwords into
@ -101,33 +100,33 @@ fi
# handle password files # handle password files
# #
for i in passwd group shadow ; do for i in passwd group shadow ; do
test -e var/adm/fillup-templates/$i.aaa_base || continue test -e /var/adm/fillup-templates/$i.aaa_base || continue
echo -n "Updating etc/$i..." echo -n "Updating etc/$i..."
if test -f etc/$i ; then if test -f /etc/$i ; then
cp etc/$i etc/$i.tmp cp /etc/$i /etc/$i.tmp
rm -f etc/$i.add rm -f /etc/$i.add
sort -k 1,1 -t: -u etc/$i var/adm/fillup-templates/$i.aaa_base \ sort -k 1,1 -t: -u /etc/$i /var/adm/fillup-templates/$i.aaa_base \
| sort -k 1,1 -t: etc/$i - | uniq -u > etc/$i.add | sort -k 1,1 -t: /etc/$i - | uniq -u > /etc/$i.add
cat etc/$i.add >> etc/$i cat /etc/$i.add >> /etc/$i
rm -f etc/$i.add rm -f /etc/$i.add
if cmp -s etc/$i etc/$i.tmp ; then if cmp -s /etc/$i /etc/$i.tmp ; then
echo "unchanged" echo "unchanged"
else else
echo "modified" echo "modified"
fi fi
rm -f etc/$i.tmp rm -f /etc/$i.tmp
# If we have a NIS system, we have to make sure, that "^+" is at the end # If we have a NIS system, we have to make sure, that "^+" is at the end
grep -v "^+" etc/$i > etc/$i.tmp || : grep -v "^+" /etc/$i > /etc/$i.tmp || :
grep "^+" etc/$i >> etc/$i.tmp || : grep "^+" /etc/$i >> /etc/$i.tmp || :
test -s etc/$i.tmp && cat etc/$i.tmp > etc/$i test -s /etc/$i.tmp && cat /etc/$i.tmp > /etc/$i
rm -f etc/$i.tmp rm -f /etc/$i.tmp
else else
cat var/adm/fillup-templates/$i.aaa_base > etc/$i cat /var/adm/fillup-templates/$i.aaa_base > /etc/$i
echo "new" echo "new"
fi fi
done done
# check/fix owner and permission of shadow files # check/fix owner and permission of shadow files
for i in etc/shadow ; do for i in /etc/shadow ; do
chmod 640 $i chmod 640 $i
chgrp shadow $i chgrp shadow $i
done done
@ -141,38 +140,38 @@ fi
# #
# create mtab if it does not exist # create mtab if it does not exist
# #
touch etc/mtab touch /etc/mtab
# #
# make sure that several log files exist # make sure that several log files exist
# #
if test ! -d var/log ; then if test ! -d /var/log ; then
mkdir -p var/log mkdir -p /var/log
fi fi
if test ! -e var/log/faillog ; then if test ! -e /var/log/faillog ; then
touch var/log/faillog touch /var/log/faillog
chmod 600 var/log/faillog chmod 600 /var/log/faillog
chown root:root var/log/faillog chown root:root /var/log/faillog
fi fi
if test ! -e root/.bash_history ; then if test ! -e /root/.bash_history ; then
touch root/.bash_history touch /root/.bash_history
chmod 600 root/.bash_history chmod 600 /root/.bash_history
fi fi
if test ! -e var/log/lastlog ; then if test ! -e /var/log/lastlog ; then
touch var/log/lastlog touch /var/log/lastlog
chmod 644 var/log/lastlog chmod 644 /var/log/lastlog
chown root:tty var/log/lastlog chown root:tty /var/log/lastlog
fi fi
if test ! -e var/log/wtmp ; then if test ! -e /var/log/wtmp ; then
touch var/log/wtmp touch /var/log/wtmp
chmod 664 var/log/wtmp chmod 664 /var/log/wtmp
chown root:tty var/log/wtmp chown root:tty /var/log/wtmp
fi fi
if test -e usr/sbin/usrdel.local -a ! -e usr/sbin/userdel.local ; then if test -e /usr/sbin/usrdel.local -a ! -e /usr/sbin/userdel.local ; then
cp usr/sbin/usrdel.local usr/sbin/userdel.local cp /usr/sbin/usrdel.local /usr/sbin/userdel.local
fi fi
if test ! -e usr/sbin/userdel.local ; then if test ! -e /usr/sbin/userdel.local ; then
mkdir -p usr/sbin mkdir -p /usr/sbin
cat << EOT > usr/sbin/userdel.local cat << EOT > /usr/sbin/userdel.local
#!/bin/bash #!/bin/bash
# #
# Here you can add your own stuff, that should be done for every user who # Here you can add your own stuff, that should be done for every user who
@ -183,7 +182,7 @@ if test ! -e usr/sbin/userdel.local ; then
# from /etc/passwd. # from /etc/passwd.
# #
EOT EOT
chmod 744 usr/sbin/userdel.local chmod 744 /usr/sbin/userdel.local
fi fi
# change all /media mounts (subfs) to noauto # change all /media mounts (subfs) to noauto

View File

@ -8,7 +8,7 @@ mkdir -p boot
# #
# make sure, tmp directories do exist # make sure, tmp directories do exist
# #
for i in tmp var/tmp ; do for i in /tmp /var/tmp ; do
test -d $i || { test -d $i || {
if test -L $i ; then if test -L $i ; then
echo "Error! $i is a dangling symlink." echo "Error! $i is a dangling symlink."
@ -32,9 +32,9 @@ done
# var/adm/fillup-templates/passwd.aaa_base to etc/passwd. # var/adm/fillup-templates/passwd.aaa_base to etc/passwd.
# deleted db2 groups and users were uids 46,47,48 and gids 46,47,48 # deleted db2 groups and users were uids 46,47,48 and gids 46,47,48
# #
mkdir -p etc mkdir -p /etc
touch etc/mtab touch /etc/mtab
mkdir -p var/adm/fillup-templates mkdir -p /var/adm/fillup-templates
echo "root:x:0:0:root:/root:/bin/bash echo "root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/bash bin:x:1:1:bin:/bin:/bin/bash
daemon:x:2:2:Daemon:/sbin:/bin/bash daemon:x:2:2:Daemon:/sbin:/bin/bash
@ -47,7 +47,7 @@ man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash
wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
ftp:x:40:49:FTP account:/srv/ftp:/bin/bash ftp:x:40:49:FTP account:/srv/ftp:/bin/bash
nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash" \ nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash" \
> var/adm/fillup-templates/passwd.aaa_base > /var/adm/fillup-templates/passwd.aaa_base
echo "root:x:0: echo "root:x:0:
bin:x:1:daemon bin:x:1:daemon
@ -80,35 +80,35 @@ lock:x:54:
man:x:62: man:x:62:
users:x:100: users:x:100:
nobody:x:65533: nobody:x:65533:
nogroup:x:65534:nobody" > var/adm/fillup-templates/group.aaa_base nogroup:x:65534:nobody" > /var/adm/fillup-templates/group.aaa_base
rm -f var/adm/fillup-templates/shadow.aaa_base rm -f /var/adm/fillup-templates/shadow.aaa_base
while read LINE ; do while read LINE ; do
case $LINE in case $LINE in
root*) root*)
echo "root::$(($(date '+%s')/86400))::::::" \ echo "root::$(($(date '+%s')/86400))::::::" \
>> var/adm/fillup-templates/shadow.aaa_base >> /var/adm/fillup-templates/shadow.aaa_base
;; ;;
*) *)
echo "${LINE%%%%:*}:*:$(($(date '+%s')/86400))::::::" \ echo "${LINE%%%%:*}:*:$(($(date '+%s')/86400))::::::" \
>> var/adm/fillup-templates/shadow.aaa_base >> /var/adm/fillup-templates/shadow.aaa_base
;; ;;
esac esac
done < var/adm/fillup-templates/passwd.aaa_base done < /var/adm/fillup-templates/passwd.aaa_base
for file in passwd group ; do for file in passwd group ; do
if test -f etc/$file ; then if test -f /etc/$file ; then
# like fillup, but : is the only separator # like fillup, but : is the only separator
rm -f etc/$file.add rm -f /etc/$file.add
sort -k 1,1 -t: -u etc/$file var/adm/fillup-templates/$file.aaa_base \ sort -k 1,1 -t: -u /etc/$file /var/adm/fillup-templates/$file.aaa_base \
| sort -k 1,1 -t: etc/$file - | uniq -u > etc/$file.add | sort -k 1,1 -t: /etc/$file - | uniq -u > /etc/$file.add
cat etc/$file.add >> etc/$file cat /etc/$file.add >> /etc/$file
rm -f etc/$file.add rm -f /etc/$file.add
# fix permissions if this script is called with strange umask # fix permissions if this script is called with strange umask
chmod 644 etc/$file chmod 644 /etc/$file
else else
cat var/adm/fillup-templates/$file.aaa_base > etc/$file cat /var/adm/fillup-templates/$file.aaa_base > /etc/$file
fi fi
done done
@ -116,12 +116,12 @@ done
# we have several local files, that changed over the time. Check the # we have several local files, that changed over the time. Check the
# existing one, if they contain real data. If not, delete them. # existing one, if they contain real data. If not, delete them.
# #
for LOCALFILE in root/bin/cron.daily.local \ for LOCALFILE in /root/bin/cron.daily.local \
etc/init.d/boot.local \ /etc/init.d/boot.local \
etc/init.d/halt.local \ /etc/init.d/halt.local \
usr/sbin/usradd.local \ /usr/sbin/usradd.local \
usr/sbin/usrdel.local \ /usr/sbin/usrdel.local \
usr/sbin/userdel.local ; do /usr/sbin/userdel.local ; do
test -f $LOCALFILE || continue test -f $LOCALFILE || continue
LOCALFILE_CONTAINS_DATA=false LOCALFILE_CONTAINS_DATA=false
while read LINE ; do while read LINE ; do
@ -146,7 +146,7 @@ for LOCALFILE in root/bin/cron.daily.local \
done < $LOCALFILE done < $LOCALFILE
test "$LOCALFILE_CONTAINS_DATA" = false && rm -f $LOCALFILE test "$LOCALFILE_CONTAINS_DATA" = false && rm -f $LOCALFILE
done done
mkdir -p etc/init.d mkdir -p /etc/init.d
echo "#! /bin/sh echo "#! /bin/sh
# #
# Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved. # Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved.
@ -161,10 +161,10 @@ echo "#! /bin/sh
# Here you should add things, that should happen directly after booting # Here you should add things, that should happen directly after booting
# before we're going to the first run level. # before we're going to the first run level.
# #
" > etc/init.d/boot.local.new " > /etc/init.d/boot.local.new
test -e etc/init.d/boot.local || mv etc/init.d/boot.local.new etc/init.d/boot.local test -e /etc/init.d/boot.local || mv /etc/init.d/boot.local.new /etc/init.d/boot.local
rm -f etc/init.d/boot.local.new rm -f /etc/init.d/boot.local.new
chmod 744 etc/init.d/boot.local chmod 744 /etc/init.d/boot.local
echo "#! /bin/sh echo "#! /bin/sh
# #
# Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved. # Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany. All rights reserved.
@ -179,13 +179,13 @@ echo "#! /bin/sh
# Here you should add things, that should happen directly before shuting # Here you should add things, that should happen directly before shuting
# down. # down.
# #
" > etc/init.d/halt.local.new " > /etc/init.d/halt.local.new
test -e etc/init.d/halt.local || mv etc/init.d/halt.local.new etc/init.d/halt.local test -e /etc/init.d/halt.local || mv /etc/init.d/halt.local.new /etc/init.d/halt.local
rm -f etc/init.d/halt.local.new rm -f /etc/init.d/halt.local.new
chmod 744 etc/init.d/halt.local chmod 744 /etc/init.d/halt.local
mkdir -p etc mkdir -p /etc
for LINK in usr/X11R6/lib/X11 var/X11R6/lib/fonts usr/lib/mgetty+sendfax \ for LINK in /usr/X11R6/lib/X11 /var/X11R6/lib/fonts /usr/lib/mgetty+sendfax \
usr/man/cat? usr/X11R6/man/cat? usr/openwin/man/cat? usr/lib/news ; do /usr/man/cat? /usr/X11R6/man/cat? /usr/openwin/man/cat? /usr/lib/news ; do
if test -L $LINK ; then if test -L $LINK ; then
echo "Found forbidden/oldish Link: $LINK ...deleting" echo "Found forbidden/oldish Link: $LINK ...deleting"
rm -f $LINK rm -f $LINK