From c6f668bc713fba805a93b02c1e3734c49e1d1508 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Mon, 7 Nov 2022 10:10:38 +0100 Subject: [PATCH] cleanup(scripts, cmake): fix switch in deb and rpm postinst scripts. Cleanup cmake cpackgenerator options. Signed-off-by: Federico Di Pierro Co-authored-by: Andrea Terzolo --- cmake/cpack/CMakeCPackOptions.cmake | 11 +---------- scripts/debian/postinst.in | 6 +++--- scripts/rpm/postinstall.in | 6 +++--- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/cmake/cpack/CMakeCPackOptions.cmake b/cmake/cpack/CMakeCPackOptions.cmake index 3191d96c..aba0490b 100644 --- a/cmake/cpack/CMakeCPackOptions.cmake +++ b/cmake/cpack/CMakeCPackOptions.cmake @@ -1,13 +1,4 @@ -if(CPACK_GENERATOR MATCHES "DEB") - list(APPEND CPACK_INSTALL_COMMANDS "mkdir -p _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") - list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco@.target _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") - list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-kmod.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") - list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-kmod-inject.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") - list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-ebpf.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") - list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-plugin.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") -endif() - -if(CPACK_GENERATOR MATCHES "RPM") +if(CPACK_GENERATOR MATCHES "DEB" OR CPACK_GENERATOR MATCHES "RPM") list(APPEND CPACK_INSTALL_COMMANDS "mkdir -p _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco@.target _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") list(APPEND CPACK_INSTALL_COMMANDS "cp scripts/systemd/falco-kmod.service _CPack_Packages/${CPACK_TOPLEVEL_TAG}/${CPACK_GENERATOR}/${CPACK_PACKAGE_FILE_NAME}/usr/lib/systemd/system") diff --git a/scripts/debian/postinst.in b/scripts/debian/postinst.in index a3188692..30a92e83 100755 --- a/scripts/debian/postinst.in +++ b/scripts/debian/postinst.in @@ -31,13 +31,13 @@ case "$1" in 2>&1 >/dev/tty) clear case $CHOICE in - 1) + 2) chosen_driver="kmod" ;; - 2) + 3) chosen_driver="ebpf" ;; - 3) + 4) chosen_driver="plugin" ;; esac diff --git a/scripts/rpm/postinstall.in b/scripts/rpm/postinstall.in index ffa85b97..5f89485f 100755 --- a/scripts/rpm/postinstall.in +++ b/scripts/rpm/postinstall.in @@ -30,13 +30,13 @@ case "$1" in 2>&1 >/dev/tty) clear case $CHOICE in - 1) + 2) chosen_driver="kmod" ;; - 2) + 3) chosen_driver="ebpf" ;; - 3) + 4) chosen_driver="plugin" ;; esac