From 99f8b79a1c4f897ef2c30c213f39ba4b7b7f9fe1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 9 Mar 2021 14:42:26 +0100 Subject: [SSUS] Get ready for changed static_files struct, support new dnbd3 --- satellit_upgrader/pack-update.sh | 65 +++++++--------------------------------- 1 file changed, 10 insertions(+), 55 deletions(-) (limited to 'satellit_upgrader/pack-update.sh') diff --git a/satellit_upgrader/pack-update.sh b/satellit_upgrader/pack-update.sh index fb25efb..b23aaa7 100755 --- a/satellit_upgrader/pack-update.sh +++ b/satellit_upgrader/pack-update.sh @@ -20,6 +20,9 @@ patchtgz () { declare -rg UPDATER="updater.sh" +# Declare all the archives we need with a couple of expected contents, +# so we can detect goof-ups right when packing the update + declare -rg TGZ_SLXADMIN="files/slx-admin.tar.gz" declare -rg FILES_SLXADMIN=" modules-available/ @@ -105,12 +108,8 @@ cp "updater.template.sh" "$UPDATER" || perror "could not copy template" chmod +x "$UPDATER" VERSION= -LEAN= while true; do case "$1" in - --lean|-l) - LEAN=true - ;; --version) shift VERSION="$1" @@ -166,24 +165,6 @@ addpayload () { fi } -addinstallfile () { - echo -n "Includes $1: " - local file=$1 - local path=$(dirname "$file") - if [ ! -d "../satellit_installer" ]; then - echo "${RED}NO!${RESET} (satellit_installer not found)" - elif [ ! -e "../satellit_installer/static_files/$file" ]; then - echo "${RED}NO!${RESET} (file not found in satellit_installer/static_files)" - else - mkdir -p "files/$path" || echo -n "(mkdir failed) " - if cp "../satellit_installer/static_files/$file" "files/$file"; then - echo "${GREEN}yes${RESET}" - else - echo "...${RED}no!${RESET} (copy failed)" - fi - fi -} - # Replace variables # slxadmin version echo -n "Includes SLX-Admin: " @@ -207,39 +188,13 @@ addpayload "IPXE" "iPXE source code" addpayload "LDADP" "ldap/ad proxy source code" addpayload "DNBD3" "dnbd3-server source code" -addinstallfile "taskmanager/config" -addinstallfile "taskmanager/environment" -addinstallfile "taskmanager/taskmanager.service" - -if [ -z "$LEAN" ]; then - addinstallfile "lighttpd.conf" - addinstallfile "lighttpd-auto-ssl.sh" - addinstallfile "lighttpd-include-conf-d.sh" - addinstallfile "slxadmin-config.php" - addinstallfile "slxadmin-cronscript" - addinstallfile "slxadmin-crontab" - addinstallfile "slxadmin-bootscript" - addinstallfile "slxadmin-boot.service" - addinstallfile "patch_lighttpd_phpchildren" - addinstallfile "slx-cert" - - addinstallfile "dnbd3/dnbd3-server.service" - addinstallfile "dnbd3/server.conf" - addinstallfile "dnbd3/rpc.acl" - addinstallfile "dnbd3/alt-servers" - addinstallfile "dnbd3/dnbd3-master-proxy.service" - - addinstallfile "tftpd/tftpd-hpa.service" - addinstallfile "tftpd/tftpd-hpa" - addinstallfile "tftpd/tftpd-remap" - addinstallfile "slxadmin-init/gpg-key.asc" - addinstallfile "slxadmin-init/slxadmin-init.php" - addinstallfile "slxadmin-init/init.sh" - - # TODO: Unify more - source ../satellit_installer/includes/10-sudo_config.inc - sudo_config files/tm-sudo-config -fi +# Add complete static_files directory structure +find ../satellit_installer/static_files -mindepth 1 -maxdepth 1 -type d \ + -exec cp -a {} files/ \; \ + || perror "Could not copy static_files dir structure" + +# Add simple dnbd3-server Makefile we need for older Debian 9 sats +cp dnbd3-Makefile files/ || perror "Could not include dnbd3 Makefile" # Last patch: Payload offset # Calc payload offset, which is tricky as the size changes as we patch -- cgit v1.2.3-55-g7522