Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds kiauh module for homebrewed images #184

Merged
merged 8 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/modules/kiauh/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#### KIAUH Install Module
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### Copyright 2022 - till today
#### https://github.com/mainsail-crew/MainsailOS
####
#### This File is distributed under GPLv3
####

#### All Credits to th33xitus for his great tool
#### https://github.com/th33xitus/kiauh

# shellcheck disable=all

# KIAUH repo
[[ -n "$KIAUH_REPO_SHIP" ]] || KIAUH_REPO_SHIP="https://github.com/th33xitus/kiauh.git"
[[ -n "$KIAUH_REPO_BRANCH" ]] || KIAUH_REPO_BRANCH="master"

# Add to $PATH ? (1: yes, 0: no)
[[ -n "$KIAUH_ADD_TO_PATH" ]] || KIAUH_ADD_TO_PATH="1"
45 changes: 45 additions & 0 deletions src/modules/kiauh/start_chroot_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
#### KIAUH Install Module
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### Copyright 2022 - till today
####
#### This File is distributed under GPLv3
####

#### All Credits to th33xitus for his great tool
#### https://github.com/th33xitus/kiauh

# shellcheck enable=requires-variable-braces

# Error handling
set -Ee

# shellcheck disable=SC1091
source /common.sh
install_cleanup_trap


echo_green "Installing sonar ..."

## Step 1: Force apt update
apt-get update --allow-releaseinfo-change

## Step 2: Make sure 'git' is installed!
check_install_pkgs git

## Step 3: Move to Home Dir as WorkingDirectoy
pushd "/home/${BASE_USER}" &> /dev/null || exit 1

## Step 4: clone KIAUH repo
echo_green "Clone KIAUH repository ..."
gitclone KIAUH_REPO kiauh

## Step 5: Link kiauh.sh in /usr/local/bin as kiauh
if [[ ${KIAUH_ADD_TO_PATH} = "1" ]]; then
echo_green "Add kiauh to PATH ..."
sudo ln -s "/home/${BASE_USER}/kiauh/kiauh.sh" "/usr/local/bin/kiauh"
fi

## Finish
echo_green "Installing KIAUH ... DONE!"
13 changes: 13 additions & 0 deletions src/modules/postrename/filesystem/root/postrename
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ fix_mainsailcfg_links() {
ln -sf "${src_dir}/mainsail.cfg" "${config_dir}/mainsail.cfg"
}

# Optional if kiauh module is used
fix_kiauh_links() {
local src_dir target_dir
src_dir="/home/${DEFAULT_USER}/kiauh"
target_dir="/usr/local/bin"
ln -sf "${src_dir}/kiauh.sh" "${target_dir}/kiauh"
}


fix_cn_links() {
local tools_dir
tools_dir="/home/${DEFAULT_USER}/crowsnest/tools"
Expand Down Expand Up @@ -231,6 +240,10 @@ echo -en "${WHITE}Fix broken symlinks ...${NOC}\r"
fix_broken_links
fix_timelapse_links
fix_mainsailcfg_links
# Optional if kiauh module is used
if [[ -d "/home/${DEFAULT_USER}/kiauh" ]]; then
fix_kiauh_links
fi
fix_cn_links
echo -e "${WHITE}Fix broken symlinks ...${NOC}[${GRE}OK${NOC}]"
## do a short break
Expand Down