Skip to content

Commit

Permalink
Make DietPi's software tools available during CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
bvobart committed Jan 14, 2024
1 parent c3898e3 commit 64e7060
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dietpi/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ HERE="$(dirname "$(realpath "$0")")"
REPO_DIR=$(realpath "$HERE/..")

source "$HERE/utils.sh"
download_dietpi_armv8_tools

## Create pi-dj user and delete default dietpi user
default_username=pi-dj
Expand Down Expand Up @@ -56,6 +57,9 @@ set_dietpi_config SOFTWARE_DISABLE_SSH_PASSWORD_LOGINS root # Disable SSH passwo
#
#

# list all executables on PATH, just for debugging
echo "$PATH" | tr ':' '\n' | xargs -I{} find {} -maxdepth 1 -executable -type f

## Install all packages needed for a usable desktop environment
# 5: Alsa
# 6: X.Org
Expand Down
17 changes: 17 additions & 0 deletions dietpi/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,20 @@ function copy_dotfiles() {
chown -R $default_username:$default_username "/home/$default_username/.config/$config_dir"
cp -r "$REPO_DIR/desktop/$config_dir" /home/$default_username/.config/
}

# Downloads the DietPi ARMv8 image and mount the boot partition, so we can use DietPi's software tools
function download_dietpi_armv8_tools() {
tmpdir=$(mktemp -d)
cd "$tmpdir" || return

# download with curl: https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bullseye.7z
curl -L -o DietPi_RPi-ARMv8-Bullseye.7z https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bullseye.7z
7zr e DietPi_RPi-ARMv8-Bullseye.7z
rm DietPi_RPi-ARMv8-Bullseye.7z
mount -t vfat "0.fat" /boot

# if PATH does not contain /boot, add it
if [[ ! "$PATH" =~ "/boot" ]]; then
export PATH="$PATH:/boot"
fi
}

0 comments on commit 64e7060

Please sign in to comment.