mirror of
https://codeberg.org/kiss-community/repo
synced 2024-12-22 07:10:16 -07:00
baselayout: remove usage of install
This commit is contained in:
parent
6acdef2ff0
commit
63695d0140
@ -1,60 +1,78 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
# Setup base directories.
|
mkdir -m 755 \
|
||||||
for d in boot dev etc home mnt usr var opt run; do
|
"$1/boot" \
|
||||||
install -dm 755 "$1/$d"
|
"$1/dev" \
|
||||||
done
|
"$1/etc" \
|
||||||
|
"$1/home" \
|
||||||
|
"$1/mnt" \
|
||||||
|
"$1/opt" \
|
||||||
|
"$1/run" \
|
||||||
|
"$1/usr" \
|
||||||
|
"$1/usr/bin" \
|
||||||
|
"$1/usr/include" \
|
||||||
|
"$1/usr/lib" \
|
||||||
|
"$1/usr/share" \
|
||||||
|
"$1/usr/share/man" \
|
||||||
|
"$1/usr/share/man/man1" \
|
||||||
|
"$1/usr/share/man/man2" \
|
||||||
|
"$1/usr/share/man/man3" \
|
||||||
|
"$1/usr/share/man/man4" \
|
||||||
|
"$1/usr/share/man/man5" \
|
||||||
|
"$1/usr/share/man/man6" \
|
||||||
|
"$1/usr/share/man/man7" \
|
||||||
|
"$1/usr/share/man/man8" \
|
||||||
|
"$1/var/cache" \
|
||||||
|
"$1/var/local" \
|
||||||
|
"$1/var/opt" \
|
||||||
|
"$1/var/log" \
|
||||||
|
"$1/var/log/old" \
|
||||||
|
"$1/var/lib" \
|
||||||
|
"$1/var/lib/misc" \
|
||||||
|
"$1/var/empty" \
|
||||||
|
"$1/var/service" \
|
||||||
|
"$1/var/spool"
|
||||||
|
|
||||||
install -dm 555 "$1/proc"
|
mkdir -m 555 \
|
||||||
install -dm 555 "$1/sys"
|
"$1/proc" \
|
||||||
install -dm 0750 "$1/root"
|
"$1/sys"
|
||||||
install -dm 1777 "$1/tmp"
|
|
||||||
|
|
||||||
# Setup /usr hierarchy.
|
mkdir -m 0750 \
|
||||||
for d in bin include lib share src; do
|
"$1/root"
|
||||||
install -dm 755 "$1/usr/$d"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Setup manpages directories.
|
mkdir -m 1777 \
|
||||||
for d in 1 2 3 4 5 6 7 8; do
|
"$1/tmp" \
|
||||||
install -dm 755 "$1/usr/share/man/man$d"
|
"$1/var/tmp" \
|
||||||
done
|
"$1/var/spool/mail"
|
||||||
|
|
||||||
# Add symlinks.
|
ln -sf usr/bin "$1/bin"
|
||||||
ln -s usr/bin "$1/bin"
|
ln -sf usr/bin "$1/sbin"
|
||||||
ln -s usr/bin "$1/sbin"
|
ln -sf bin "$1/usr/sbin"
|
||||||
ln -s bin "$1/usr/sbin"
|
ln -sf usr/lib "$1/lib"
|
||||||
ln -s usr/lib "$1/lib"
|
ln -sf usr/lib "$1/lib64"
|
||||||
ln -s usr/lib "$1/lib64"
|
|
||||||
ln -s lib "$1/usr/lib64"
|
|
||||||
|
|
||||||
# Setup /var.
|
ln -sf lib "$1/usr/lib64"
|
||||||
for d in cache local opt log/old lib/misc empty service; do
|
ln -sf spool/mail "$1/var/mail"
|
||||||
install -dm 755 "$1/var/$d"
|
ln -sf ../run "$1/var/run"
|
||||||
done
|
ln -sf ../run/lock "$1/var/lock"
|
||||||
|
ln -sf /proc/self/mounts "$1/etc/mtab"
|
||||||
|
|
||||||
install -dm 1777 "$1/var/tmp"
|
cp -f \
|
||||||
install -dm 1777 "$1/var/spool/mail"
|
fstab \
|
||||||
|
group \
|
||||||
|
host.conf \
|
||||||
|
hosts \
|
||||||
|
issue \
|
||||||
|
os-release \
|
||||||
|
passwd \
|
||||||
|
profile \
|
||||||
|
securetty \
|
||||||
|
shells \
|
||||||
|
mime.types \
|
||||||
|
crypttab \
|
||||||
|
shadow \
|
||||||
|
"$1/etc"
|
||||||
|
|
||||||
ln -s spool/mail "$1/var/mail"
|
chmod 600 \
|
||||||
ln -s ../run "$1/var/run"
|
"$1/etc/crypttab" \
|
||||||
ln -s ../run/lock "$1/var/lock"
|
"$1/etc/shadow"
|
||||||
|
|
||||||
# Setup /usr/local (usually for any programs installed outside package manager).
|
|
||||||
for d in bin etc games include lib man sbin share src; do
|
|
||||||
install -dm 755 "$1/usr/local/$d"
|
|
||||||
done
|
|
||||||
|
|
||||||
ln -s ../man "$1/usr/local/share/man"
|
|
||||||
|
|
||||||
# /etc skeleton files.
|
|
||||||
for f in fstab group host.conf hosts issue os-release \
|
|
||||||
passwd profile securetty shells mime.types; do
|
|
||||||
install -m 644 "$f" "$1/etc"
|
|
||||||
done
|
|
||||||
|
|
||||||
for f in crypttab shadow; do
|
|
||||||
install -m 600 "$f" "$1/etc"
|
|
||||||
done
|
|
||||||
|
|
||||||
ln -s /proc/self/mounts "$1/etc/mtab"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user