2019-06-18 04:43:54 -06:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2019-06-18 06:06:58 -06:00
|
|
|
# Setup base directories.
|
2019-06-18 04:43:54 -06:00
|
|
|
for d in boot dev etc home mnt usr var opt run; do
|
2019-06-18 06:06:58 -06:00
|
|
|
install -dm 755 "$1/$d"
|
2019-06-18 04:43:54 -06:00
|
|
|
done
|
|
|
|
|
2019-06-18 06:06:58 -06:00
|
|
|
install -dm 555 "$1/proc"
|
|
|
|
install -dm 555 "$1/sys"
|
|
|
|
install -dm 0750 "$1/root"
|
|
|
|
install -dm 1777 "$1/tmp"
|
|
|
|
|
|
|
|
# Setup /usr hierarchy.
|
2019-06-18 04:43:54 -06:00
|
|
|
for d in bin include lib lib32 share src; do
|
|
|
|
install -d -m755 "$1"/usr/"$d"
|
|
|
|
done
|
|
|
|
|
2019-06-18 06:06:58 -06:00
|
|
|
# Setup manpages directories.
|
2019-06-18 04:43:54 -06:00
|
|
|
for d in 1 2 3 4 5 6 7 8; do
|
2019-06-18 06:06:58 -06:00
|
|
|
install -dm 755 "$1/usr/share/man/man$d"
|
2019-06-18 04:43:54 -06:00
|
|
|
done
|
|
|
|
|
2019-06-18 06:06:58 -06:00
|
|
|
# Add symlinks.
|
|
|
|
ln -s usr/bin "$1/bin"
|
|
|
|
ln -s usr/bin "$1/sbin"
|
|
|
|
ln -s bin "$1/usr/sbin"
|
|
|
|
ln -s usr/lib "$1/lib"
|
|
|
|
ln -s usr/lib "$1/lib64"
|
|
|
|
ln -s lib "$1/usr/lib64"
|
2019-06-18 04:43:54 -06:00
|
|
|
|
2019-06-18 06:06:58 -06:00
|
|
|
# Setup /var.
|
2019-06-22 09:53:17 -06:00
|
|
|
for d in cache local opt log/old lib/misc empty service; do
|
2019-06-18 06:06:58 -06:00
|
|
|
install -dm 755 "$1/var/$d"
|
2019-06-18 04:43:54 -06:00
|
|
|
done
|
|
|
|
|
2019-06-18 06:06:58 -06:00
|
|
|
install -dm 1777 "$1/var/tmp"
|
|
|
|
install -dm 1777 "$1/var/spool/mail"
|
2019-08-12 17:41:18 -06:00
|
|
|
install -dm 0777 "$1/var/cache/kiss"
|
|
|
|
install -dm 0777 "$1/var/db/kiss"
|
2019-06-18 06:06:58 -06:00
|
|
|
|
|
|
|
ln -s spool/mail "$1/var/mail"
|
|
|
|
ln -s ../run "$1/var/run"
|
|
|
|
ln -s ../run/lock "$1/var/lock"
|
|
|
|
|
|
|
|
# Setup /usr/local (usually for any programs installed outside package manager).
|
2019-06-18 04:43:54 -06:00
|
|
|
for d in bin etc games include lib man sbin share src; do
|
2019-06-18 06:06:58 -06:00
|
|
|
install -dm 755 "$1/usr/local/$d"
|
2019-06-18 04:43:54 -06:00
|
|
|
done
|
|
|
|
|
2019-06-18 06:06:58 -06:00
|
|
|
ln -s ../man "$1/usr/local/share/man"
|
|
|
|
|
|
|
|
# /etc skeleton files.
|
2019-06-23 07:54:38 -06:00
|
|
|
for f in fstab group host.conf hosts issue os-release \
|
2019-06-20 03:02:09 -06:00
|
|
|
passwd profile securetty shells; do
|
2019-06-18 06:06:58 -06:00
|
|
|
install -m 644 "$f" "$1/etc"
|
2019-06-18 04:43:54 -06:00
|
|
|
done
|
2019-06-20 12:44:32 -06:00
|
|
|
|
2019-06-20 03:02:09 -06:00
|
|
|
for f in crypttab shadow; do
|
|
|
|
install -m 600 "$f" "$1/etc"
|
|
|
|
done
|
2019-06-18 06:06:58 -06:00
|
|
|
|
|
|
|
ln -s /proc/self/mounts "$1/etc/mtab"
|