From 57d40f949cc96873e5e100370e124d40e53a522c Mon Sep 17 00:00:00 2001 From: islander Date: Wed, 16 Oct 2019 07:35:58 +1100 Subject: [PATCH] Add Puppy Linux support --- base/PUPPY/before.sh | 12 ++++++++++++ postinstall.sh | 31 ++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100755 base/PUPPY/before.sh diff --git a/base/PUPPY/before.sh b/base/PUPPY/before.sh new file mode 100755 index 0000000..e4fac15 --- /dev/null +++ b/base/PUPPY/before.sh @@ -0,0 +1,12 @@ +# +# before.sh for DEBIAN and TYPE=workstation +# + +# Add user's .ssh directory +echo_step " Make user's .ssh" +mkdir -p "$(getent passwd "$MY_USERNAME" | cut -d: -f6)/.ssh" +if [ "$?" -ne 0 ]; then + echo_warning "Failed to create, will attempt to continue" +else + echo_success +fi diff --git a/postinstall.sh b/postinstall.sh index d18515f..954a57d 100755 --- a/postinstall.sh +++ b/postinstall.sh @@ -337,9 +337,13 @@ function detect_operating_system() { echo_step_info "Alpine Linux" OPERATING_SYSTEM="ALPINE" elif grep -lqs ^Mageia$ /etc/release; then - echo -e "\ntest -f /etc/release " >>"$INSTALL_LOG" - echo_step_info "Mageia" + echo -e "\ntest -f /etc/release " >>"$INSTALL_LOG" + echo_step_info "Mageia" OPERATING_SYSTEM="MAGEIA" + elif grep -lqs Puppy /etc/os-release; then + echo -e "\ntest -f /etc/os-release " >>"$INSTALL_LOG" + echo_step_info "Puppy" + OPERATING_SYSTEM="PUPPY" else { echo -e "\ntest -f /etc/debian_version" @@ -551,6 +555,16 @@ function detect_installer() { exit_with_failure "Command 'urpmi' not found" fi ;; + PUPPY) + # https://gitlab.com/sc0ttj/Pkg + if command_exists pkg; then + echo -e "\npkg found" >>"$INSTALL_LOG" + export MY_INSTALLER="pkg" + export MY_INSTALL="-f add" + else + exit_with_failure "Command 'pkg' not found" + fi + ;; esac echo_success } @@ -614,9 +628,16 @@ function resync_installer() { fi ;; pkg) - $MY_INSTALLER upgrade >>"$INSTALL_LOG" 2>&1 - if [ "$?" -ne 0 ]; then - exit_with_failure "Failed to do $MY_INSTALLER upgrade" + if [ "$OPERATING_SYSTEM" = "PUPPY" ]; then + $MY_INSTALLER update-sources >>"$INSTALL_LOG" 2>&1 + if [ "$?" -ne 0 ]; then + exit_with_failure "Failed to do $MY_INSTALLER repo-update" + fi + else + $MY_INSTALLER upgrade >>"$INSTALL_LOG" 2>&1 + if [ "$?" -ne 0 ]; then + exit_with_failure "Failed to do $MY_INSTALLER upgrade" + fi fi ;; pkgman)