forked from openSUSE/aaa_base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aaa_base.post
48 lines (43 loc) · 1.16 KB
/
aaa_base.post
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#
#
# post.sh - to be done after extraction
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
#
# Run this script in C-Locale, or some tools will fail.
export LC_ALL=C
if [ "$1" -gt 1 ]; then
# clock variables dropped after 13.1
%{remove_and_set -n clock SYSTOHC FORCE_SYSTOHC BADYEAR HCTOSYS_DEVICE USE_HWCLOCK USE_ADJUST}
fi
#XXX Fix /etc/nsswitch.conf to include usrfiles [bsc#1162916]
if [ -e /etc/nsswitch.conf ]; then
for key in services protocols rpc ; do
grep -q ^${key}.*usrfiles /etc/nsswitch.conf
if [ $? -eq 1 ]; then
cp /etc/nsswitch.conf /etc/nsswitch.conf.pre-usrfiles.${key}
sed -i -e "s|^\(${key}:.*[[:space:]]\)files\([[:space:]].*\)*$|\1files usrfiles\2|" /etc/nsswitch.conf
fi
done
fi
for i in language proxy windowmanager ; do
%{fillup_only -n $i}
done
#
# create mtab if it does not exist
#
if test ! -e /etc/mtab; then
ln -sf /proc/self/mounts /etc/mtab
fi
while read file owner mode; do
test -h "$file" && continue
test -e "$file" || touch "$file"
chmod "$mode" "$file"
chown "$owner" "$file"
done <<EOT
/root/.bash_history root:root 600
/var/log/lastlog root:root 644
EOT
exit 0