From 3b054c85d1b7c19853b990cb6cb2c38e48fd8489 Mon Sep 17 00:00:00 2001 From: Bart van Oort Date: Sun, 14 Jan 2024 02:06:00 +0100 Subject: [PATCH] Make DietPi's software tools available during CI build --- dietpi/build.sh | 10 ++++++++-- dietpi/utils.sh | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dietpi/build.sh b/dietpi/build.sh index 0650d2a..0e9441d 100755 --- a/dietpi/build.sh +++ b/dietpi/build.sh @@ -6,7 +6,10 @@ HERE="$(dirname "$(realpath "$0")")" REPO_DIR=$(realpath "$HERE/..") +ls -alR /boot + source "$HERE/utils.sh" +download_dietpi_armv8_tools ## Create pi-dj user and delete default dietpi user default_username=pi-dj @@ -56,6 +59,8 @@ set_dietpi_config SOFTWARE_DISABLE_SSH_PASSWORD_LOGINS root # Disable SSH passwo # # + +### TODO: install these in post-install script. ## Install all packages needed for a usable desktop environment # 5: Alsa # 6: X.Org @@ -65,11 +70,12 @@ set_dietpi_config SOFTWARE_DISABLE_SSH_PASSWORD_LOGINS root # Disable SSH passwo # 188: Go # 67: Firefox dietpi-software install 5 6 7 170 17 188 67 + # install i3 and dependencies -apt install -y i3 polybar onboard fonts-roboto fonts-font-awesome dunst rofi +apt-get install -y i3 polybar onboard fonts-roboto fonts-font-awesome dunst rofi # install some useful CLI tools for maintenance -apt install -y kitty zsh man less +apt-get install -y kitty zsh man less sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" chsh -s "$(which zsh)" git config pull.rebase true diff --git a/dietpi/utils.sh b/dietpi/utils.sh index aa45f5c..e86159e 100644 --- a/dietpi/utils.sh +++ b/dietpi/utils.sh @@ -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 +}