2011-06-25 08:43:54 +00:00
|
|
|
make_system_dirs()
|
|
|
|
{
|
|
|
|
#
|
|
|
|
# Install FHS system directories.
|
|
|
|
#
|
|
|
|
for d in bin sbin boot etc etc/modprobe.d etc/skel \
|
|
|
|
home lib dev proc usr mnt opt sys var media run; do
|
|
|
|
[ ! -d ${d} ] && install -d ${d}
|
|
|
|
done
|
|
|
|
|
|
|
|
[ ! -d root ] && install -dm750 root
|
|
|
|
[ ! -d var/spool/mail ] && install -dm1777 var/spool/mail
|
|
|
|
|
|
|
|
for d in local local/bin local/sbin local/include local/lib \
|
|
|
|
bin include lib sbin src; do
|
|
|
|
[ ! -d usr/${d} ] && install -d usr/${d}
|
|
|
|
done
|
|
|
|
|
|
|
|
for d in locale misc terminfo zoneinfo doc info; do
|
|
|
|
[ ! -d usr/share/${d} ] && install -d usr/share/${d}
|
|
|
|
[ ! -d usr/local/share/${d} ] && install -d usr/local/share/${d}
|
|
|
|
done
|
|
|
|
|
|
|
|
for d in 1 2 3 4 5 6 7 8; do
|
|
|
|
[ ! -d usr/share/man/man${d} ] && \
|
|
|
|
install -d usr/share/man/man${d}
|
|
|
|
[ ! -d usr/local/share/man/man${d} ] && \
|
|
|
|
install -d usr/local/share/man/man${d}
|
|
|
|
done
|
|
|
|
|
|
|
|
[ ! -h usr/man ] && ln -sf /usr/share/man usr/man
|
|
|
|
[ ! -h usr/local/man ] && ln -sf /usr/share/man usr/local/man
|
|
|
|
|
|
|
|
for d in log run opt cache lib; do
|
|
|
|
[ ! -d var/${d} ] && install -d var/${d}
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$(uname -m)" = "x86_64" ]; then
|
|
|
|
[ ! -h lib64 ] && ln -sf /lib lib64
|
|
|
|
[ ! -h usr/lib64 ] && ln -sf /usr/lib usr/lib64
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ ! -d lib/rc ] && install -d lib/rc
|
|
|
|
|
|
|
|
for d in init.d udev; do
|
2011-07-10 21:55:03 +00:00
|
|
|
if [ ! -d run/${d} -a ! -h run/${d} ]; then
|
|
|
|
install -dm0755 run/${d}
|
|
|
|
fi
|
2011-06-25 08:43:54 +00:00
|
|
|
done
|
|
|
|
for d in lock tmp shm; do
|
2011-07-10 21:55:03 +00:00
|
|
|
if [ ! -d run/${d} -a ! -h run/${d} ]; then
|
|
|
|
install -dm1777 run/${d}
|
|
|
|
fi
|
2011-06-25 08:43:54 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2011-05-04 11:10:50 +00:00
|
|
|
case "${ACTION}" in
|
|
|
|
post)
|
2011-06-25 08:43:54 +00:00
|
|
|
make_system_dirs
|
|
|
|
|
2011-05-04 11:10:50 +00:00
|
|
|
# Create compat symlinks for /run.
|
2011-05-20 14:41:03 +00:00
|
|
|
mntpnts="tmp /run/tmp"
|
|
|
|
mntpnts="$mntpnts var/tmp /run/tmp"
|
|
|
|
mntpnts="$mntpnts var/run /run"
|
|
|
|
mntpnts="$mntpnts var/lock /run/lock"
|
|
|
|
mntpnts="$mntpnts lib/rc/init.d /run/init.d"
|
|
|
|
|
|
|
|
set -- ${mntpnts}
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
dir="$1"
|
|
|
|
dest="$2"
|
|
|
|
if [ -h "$dir" ]; then
|
|
|
|
if [ "$(readlink -f $dir)" != "$dest" ]; then
|
|
|
|
echo "WARNING: removing wrong symlink in /$dir..."
|
|
|
|
rm -f "$dir"
|
|
|
|
fi
|
|
|
|
elif [ -d "$dir" ]; then
|
|
|
|
echo "WARNING: removing directory /$dir..."
|
|
|
|
rm -rf "$dir"
|
2011-05-20 14:49:58 +00:00
|
|
|
fi
|
|
|
|
if [ ! -e "$dir" ]; then
|
2011-05-20 14:41:03 +00:00
|
|
|
ln -sf "$dest" "$dir"
|
|
|
|
fi
|
|
|
|
shift; shift;
|
2011-05-20 12:25:36 +00:00
|
|
|
done
|
2011-05-04 11:10:50 +00:00
|
|
|
;;
|
|
|
|
esac
|