parch-iso-template/build.sh

60 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2023-10-11 19:30:24 +03:30
#!/usr/bin/bash
main() {
set -e
local Black DarkGray Red LightRed Green LightGreen Brown Yellow Blue LightBlue Purple Light Purple Cyan LightCyan LightGray White reset
2024-04-04 00:16:57 +03:30
## Save colors
2023-10-11 19:30:24 +03:30
Black="\e[0;30m"
DarkGray="\e[1;30m"
Red="\e[0;31m"
LightRed="\e[1;31m"
Green="\e[0;32m"
LightGreen="\e[1;32m"
Brown="\e[0;33m"
Yellow="\e[1;33m"
Blue="\e[0;34m"
LightBlue="\e[1;34m"
Purple="\e[0;35m"
Light=Purple="\e[1;35m"
Cyan="\e[0;36m"
LightCyan="\e[1;36m"
LightGray="\e[0;37m"
White="\e[1;37m"
reset="\e[0m"
local reponame
reponame=${PWD##*/}
2024-04-04 00:16:57 +03:30
echo -e "$Green### Start install packages for build $reponame ###$reset"
echo -e "$Brown### Checking your OS ###$reset"
2023-10-11 19:30:24 +03:30
if type pacman >/dev/null 2>&1;then
if [ "$(id -u)" != "0" ]; then
2024-04-04 00:16:57 +03:30
echo -e "$Red### You are not in root$reset"
2023-10-11 19:30:24 +03:30
exit 1
else
install
2024-04-04 00:16:57 +03:30
echo -e "$Blue### Install complete ###$reset"
echo -e "$Green### Start build $reponame with archiso ###$reset"
2025-02-12 13:23:06 +03:30
build
2023-10-11 19:30:24 +03:30
fi
else
2024-04-04 00:16:57 +03:30
echo -e "$Red###OS can't supported###$reset"
2023-10-11 19:30:24 +03:30
exit 1
fi
}
2025-02-12 13:23:06 +03:30
2023-10-11 19:30:24 +03:30
install() {
2023-10-11 19:55:10 +03:30
set -e
2025-02-12 13:23:06 +03:30
pacman -Sy; pacman --noconfirm -S --needed git wget github-cli p7zip reflector rsync
2025-02-12 14:09:26 +03:30
wget https://git.parchlinux.com/repos/ppr/raw/branch/main/x86_64/archiso-99-1-any.pkg.tar.zst
2025-02-12 13:23:06 +03:30
sudo pacman -U archiso-99-1-any.pkg.tar.zst --noconfirm
2023-10-11 19:30:24 +03:30
}
2025-02-12 13:23:06 +03:30
2023-10-11 19:30:24 +03:30
build() {
2023-10-11 19:55:10 +03:30
set -e
2023-10-11 19:30:24 +03:30
mkarchiso -v iso/
}
main