45 lines
1.1 KiB
Bash
Executable File
45 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
dir="$(pwd)"
|
|
wrksrc="${dir}/tmp"
|
|
functions="${dir}/functions"
|
|
modules="${dir}/modules"
|
|
config_mods="${modules}/config"
|
|
install_mods="${modules}/install"
|
|
chroot_mods="${modules}/chroot"
|
|
vars="${wrksrc}/vars"
|
|
dest="${wrksrc}/dest"
|
|
rm -rf "${vars}"
|
|
mkdir -p "${wrksrc}" "${vars}" "${dest}"
|
|
declare -A cfg=()
|
|
declare -A users=()
|
|
#set -x
|
|
#remote="https://alpha.de.repo.voidlinux.org/current"
|
|
remote="https://void.cijber.net/current/"
|
|
|
|
source "${functions}"/functions
|
|
umounter "${dest}"
|
|
|
|
export run="pre"
|
|
for i in $(find "${modules}" -mindepth 1 -maxdepth 1 -type d | sort -n ); do
|
|
test -f "${i}"/pre && source "${i}"/pre
|
|
done
|
|
|
|
export run="install"
|
|
for i in $(find "${modules}" -mindepth 1 -maxdepth 1 -type d | sort -n ); do
|
|
test -f "${i}"/install && source "${i}"/install
|
|
done
|
|
|
|
mkdir -p "${dest}"/tmp/installer/tmp
|
|
cp -rf "${vars}" "${dest}"/tmp/installer/tmp
|
|
rm -rf "${vars}"
|
|
cp -rf "${modules}" "${dest}"/tmp/installer
|
|
cp -rf "${functions}" "${dest}"/tmp/installer
|
|
cp -rf ./run_in_chroot.sh "${dest}"/tmp/installer
|
|
|
|
cp -rf /var/db/xbps/ "${dest}"/var/db/
|
|
|
|
chroot "${dest}" "/tmp/installer/run_in_chroot.sh"
|
|
|
|
umounter "${dest}"
|