-
Notifications
You must be signed in to change notification settings - Fork 0
/
FHS
33 lines (31 loc) · 917 Bytes
/
FHS
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
#!/bin/sh
NAME="FHS"
install_package(){
(
cd $1/
mkdir -pv ./{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt,proc,sys}
mkdir -pv ./{media/{floppy,cdrom},srv,var}
install -dv -m 0750 ./root
install -dv -m 1777 ./tmp ./var/tmp
mkdir -pv ./usr/{,local/}{include,lib,src}
mkdir -pv ./usr/{,local/}share/{color,dict,doc,info,locale,man}
mkdir -v ./usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir -v ./usr/libexec
mkdir -pv ./usr/{,local/}share/man/man{1..8}
case $(uname -m) in
x86_64) mkdir -v /lib64 ;;
esac
mkdir -v ./var/{log,mail,spool,db}
ln -sv ./run /var/run
ln -sv ./run/lock /var/lock
mkdir -pv ./var/{opt,cache,lib/{color,misc,locate},local}
ln -sf bin sbin
ln -sf ../bin usr/sbin
ln -sf ../bin usr/bin
ln -sf ../../bin usr/local/bin
ln -sf ../../bin usr/local/sbin
)
}
remove_package(){
rm -rf $1/*
}