2011-06-25 10:43:54 +02:00
|
|
|
make_system_dirs()
|
|
|
|
{
|
|
|
|
#
|
|
|
|
# Install FHS system directories.
|
|
|
|
#
|
2012-07-09 20:28:26 +02:00
|
|
|
for d in boot etc etc/modprobe.d etc/skel \
|
2014-08-29 17:22:55 +02:00
|
|
|
home dev proc usr mnt opt sys media var run/lock; do
|
2011-06-25 10:43:54 +02:00
|
|
|
[ ! -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
|
|
|
|
|
2012-07-09 20:28:26 +02:00
|
|
|
# Create /bin, /sbin and /lib symlinks to /usr.
|
|
|
|
for d in bin sbin lib; do
|
2012-07-10 18:09:38 +02:00
|
|
|
if [ ! -h "$d" -a -d "$d" ]; then
|
2012-07-09 20:28:26 +02:00
|
|
|
echo "/${d} must not be a directory, exiting!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
ln -sf usr/${d} .
|
|
|
|
done
|
2011-06-25 10:43:54 +02:00
|
|
|
|
2012-07-09 20:28:26 +02:00
|
|
|
for d in log opt cache lib; do
|
2011-06-25 10:43:54 +02:00
|
|
|
[ ! -d var/${d} ] && install -d var/${d}
|
|
|
|
done
|
|
|
|
|
2014-04-22 15:32:11 +02:00
|
|
|
if [ "${ARCH}" = "x86_64" ]; then
|
2012-08-30 09:08:35 +02:00
|
|
|
ln -sf usr/lib lib64
|
|
|
|
cd usr && ln -sf lib lib64 && cd ..
|
2012-08-20 10:04:25 +02:00
|
|
|
install -d usr/lib32
|
2012-08-30 09:08:35 +02:00
|
|
|
ln -sf usr/lib32 lib32
|
2011-06-25 10:43:54 +02:00
|
|
|
fi
|
2014-04-22 15:32:11 +02:00
|
|
|
if [ "${ARCH}" = "i686" ]; then
|
2014-03-06 18:11:37 +01:00
|
|
|
ln -sf lib lib32
|
|
|
|
ln -sf lib usr/lib32
|
|
|
|
fi
|
2011-06-25 10:43:54 +02:00
|
|
|
|
2014-03-16 09:39:30 +01:00
|
|
|
# Create /var/run and /var/lock symlinks.
|
|
|
|
for d in run lock; do
|
|
|
|
if [ ! -h "var/$d" -a -d var/${d} ]; then
|
|
|
|
echo "/${d} must not be a directory, exiting!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
2014-08-03 18:55:50 +02:00
|
|
|
|
|
|
|
cd var
|
|
|
|
ln -sf ../run .
|
|
|
|
ln -sf ../run/lock .
|
|
|
|
ln -sf spool/mail mail
|
|
|
|
cd ..
|
2014-03-16 09:39:30 +01:00
|
|
|
|
2011-10-11 06:01:11 +02:00
|
|
|
install -dm1777 tmp
|
|
|
|
install -dm1777 var/tmp
|
2014-08-03 18:55:50 +02:00
|
|
|
|
2011-06-25 10:43:54 +02:00
|
|
|
}
|
|
|
|
|
2011-05-04 13:10:50 +02:00
|
|
|
case "${ACTION}" in
|
2014-04-21 15:53:30 +02:00
|
|
|
pre|post)
|
2014-03-16 09:39:30 +01:00
|
|
|
echo "Creating system directories/symlinks..."
|
2011-06-25 10:43:54 +02:00
|
|
|
make_system_dirs
|
2011-05-04 13:10:50 +02:00
|
|
|
;;
|
|
|
|
esac
|