Files
filesystem/source.sh
T

64 lines
2.8 KiB
Bash

# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
install -dm755 "$BPM_OUTPUT"/etc
install -dm755 "$BPM_OUTPUT"/var
install -dm755 "$BPM_OUTPUT"/usr
install -dm755 "$BPM_OUTPUT"/dev
install -dm755 "$BPM_OUTPUT"/proc
install -dm755 "$BPM_OUTPUT"/sys
install -dm755 "$BPM_OUTPUT"/run
install -dm755 "$BPM_OUTPUT"/tmp
install -dm755 "$BPM_OUTPUT"/boot
install -dm755 "$BPM_OUTPUT"/opt
install -dm755 "$BPM_OUTPUT"/srv
install -dm755 "$BPM_OUTPUT"/mnt
install -dm755 "$BPM_OUTPUT"/home
install -dm755 "$BPM_OUTPUT"/usr/lib/firmware
install -dm755 "$BPM_OUTPUT"/usr/{,local/}{include,src}
install -dm755 "$BPM_OUTPUT"/usr/{,local/}{bin,lib,sbin}
install -dm755 "$BPM_OUTPUT"/lib64
install -dm755 "$BPM_OUTPUT"/usr/{,local/}share/{color,dict,doc,info,locale,man}
install -dm755 "$BPM_OUTPUT"/usr/{,local/}share/{misc,terminfo,zoneinfo}
install -dm755 "$BPM_OUTPUT"/usr/{,local/}share/man/man{1..8}
install -dm755 "$BPM_OUTPUT"/var/{cache,local,log,mail,opt,spool}
install -dm755 "$BPM_OUTPUT"/var/lib/{color,misc,locate}
install -dm750 "$BPM_OUTPUT"/root
install -dm1777 /tmp "$BPM_OUTPUT"/var/tmp
ln -s usr/bin "$BPM_OUTPUT"/bin
ln -s usr/sbin "$BPM_OUTPUT"/sbin
ln -s usr/lib "$BPM_OUTPUT"/lib
ln -s /proc/self/mounts "$BPM_OUTPUT"/etc/mtab
ln -s /run "$BPM_OUTPUT"/var/run
ln -s /run/lock "$BPM_OUTPUT"/var/lock
ln -s bash "$BPM_OUTPUT"/bin/sh
touch "$BPM_OUTPUT"/var/log/{btmp,lastlog,faillog,wtmp}
chgrp utmp "$BPM_OUTPUT"/var/log/lastlog
chmod 664 "$BPM_OUTPUT"/var/log/lastlog
chmod 600 "$BPM_OUTPUT"/var/log/btmp
install -Dm644 "$BPM_WORKDIR"/hosts "$BPM_OUTPUT"/etc/hosts
install -Dm644 "$BPM_WORKDIR"/group "$BPM_OUTPUT"/etc/group
install -Dm644 "$BPM_WORKDIR"/passwd "$BPM_OUTPUT"/etc/passwd
install -Dm644 "$BPM_WORKDIR"/gshadow "$BPM_OUTPUT"/etc/gshadow
install -Dm644 "$BPM_WORKDIR"/shadow "$BPM_OUTPUT"/etc/shadow
install -Dm644 "$BPM_WORKDIR"/nsswitch.conf "$BPM_OUTPUT"/etc/nsswitch.conf
install -Dm644 "$BPM_WORKDIR"/os-release "$BPM_OUTPUT"/etc/os-release
install -Dm644 "$BPM_WORKDIR"/lsb-release "$BPM_OUTPUT"/etc/lsb-release
install -Dm644 "$BPM_WORKDIR"/shells "$BPM_OUTPUT"/etc/shells
install -Dm644 "$BPM_WORKDIR"/tide_linux_logo.png "$BPM_OUTPUT"/usr/share/pixmaps/tide_linux_logo.png
touch "$BPM_OUTPUT"/etc/subuid
touch "$BPM_OUTPUT"/etc/subgid
echo "tidelinux" > "$BPM_OUTPUT"/etc/hostname
}