-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·39 lines (38 loc) · 1.29 KB
/
install.sh
File metadata and controls
executable file
·39 lines (38 loc) · 1.29 KB
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
34
35
36
37
38
39
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# written by Tobias Powalowski <tpowa@archlinux.org>
_dir="../lib/archboot/run"
_comp_dir="${1}/usr/share/bash-completion/completions"
_dest="${1}/usr/bin"
_completion=(
archboot-{aarch,riscv,x86_}64-create-container.sh
archboot-{aarch,riscv,x86_}64-iso.sh
archboot-{aarch,x86_}64-uki.sh
)
if [[ -z "${1}" ]]; then
echo "Error: No directory given!"
exit 1
fi
if ! [[ -d "${1}" ]]; then
echo "Error: Directory does not exist!"
exit 1
fi
echo "Installing files and symlinks to ${1}"
cp -r etc usr "${1}"/
for i in aarch64 riscv64 x86_64; do
ln -s "${_dir}"/container.sh "${_dest}"/archboot-${i}-create-container.sh
ln -s "${_dir}"/repository.sh "${_dest}"/archboot-${i}-create-repository.sh
ln -s "${_dir}"/iso.sh "${_dest}"/archboot-${i}-iso.sh
ln -s "${_dir}"/release.sh "${_dest}"/archboot-${i}-release.sh
ln -s "${_dir}"/server-release.sh "${_dest}"/archboot-${i}-server-release.sh
done
for i in aarch64 riscv64; do
ln -s "${_dir}"/container-tarball.sh "${_dest}"/archboot-${i}-pacman-container-tarball.sh
done
for i in aarch64 x86_64; do
ln -s "${_dir}"/uki.sh "${_dest}"/archboot-${i}-uki.sh
done
mkdir -p "${_comp_dir}"
for i in ${_completion[@]}; do
ln -s archboot "${_comp_dir}/${i}"
done