From 665bb3af6f6a9efe444d0bc0602d4937d77620f8 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Thu, 13 May 2021 11:08:44 +0100 Subject: [PATCH] Delete duplicate files and move to consistent naming location --- build.sh | 4 +- .../includes.installer/kali-finish-install | 74 ------------------- .../common/post-install}/kali-finish-install | 0 simple-cdd/profiles/kali.postinst | 74 ------------------- 4 files changed, 2 insertions(+), 150 deletions(-) delete mode 100755 kali-config/common/includes.installer/kali-finish-install rename {bin => kali-config/common/post-install}/kali-finish-install (100%) delete mode 100755 simple-cdd/profiles/kali.postinst diff --git a/build.sh b/build.sh index bea0b9c..2f4e554 100755 --- a/build.sh +++ b/build.sh @@ -276,7 +276,7 @@ set +e case "$IMAGE_TYPE" in live) debug "Stage 1/3 - File(s)" - run_and_log cp bin/kali-finish-install kali-config/common/includes.installer/ + run_and_log cp kali-config/common/post-install/kali-finish-install kali-config/common/includes.installer/ [ $? -eq 0 ] || failure debug "Stage 2/3 - Config" @@ -329,7 +329,7 @@ case "$IMAGE_TYPE" in [ $? -eq 0 ] || failure # Update the post-install script - run_and_log cp bin/kali-finish-install simple-cdd/profiles/kali.postinst + run_and_log cp kali-config/common/post-install/kali-finish-install simple-cdd/profiles/kali.postinst [ $? -eq 0 ] || failure # Configure the kali profile with the packages we want diff --git a/kali-config/common/includes.installer/kali-finish-install b/kali-config/common/includes.installer/kali-finish-install deleted file mode 100755 index 1aaac7a..0000000 --- a/kali-config/common/includes.installer/kali-finish-install +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh - -# The reference version of this script is maintained in -# live-build-config/bin/kali-finish-install. -# -# It is used in multiple places to finish configuring the target system -# and build.sh copies it where required (in the simple-cdd configuration -# and in the live-build configuration). - -configure_sources_list() { - if grep -q '^deb ' /etc/apt/sources.list; then - echo "INFO: sources.list is configured, everything is fine" - return - fi - - echo "INFO: sources.list is empty, setting up a default one for Kali" - - cat >/etc/apt/sources.list </dev/null; then - echo "WARNING: user '$user' is invalid but /home/$user exists" - continue - fi - echo "$user" - done - echo "root" -} - -configure_zsh() { - if grep -q 'nozsh' /proc/cmdline; then - echo "INFO: user opted out of zsh by default" - return - fi - if [ ! -x /usr/bin/zsh ]; then - echo "INFO: /usr/bin/zsh is not available" - return - fi - for user in $(get_user_list); do - echo "INFO: changing default shell of user '$user' to zsh" - chsh --shell /usr/bin/zsh $user - done -} - -# This is generically named in case we want to add other groups in the future. -configure_usergroups() { - # Create the kaboxer group if needed - addgroup --system kaboxer || true - # Create the wireshark group if needed - addgroup --system wireshark || true - - # kaboxer - for kaboxer - # dialout - for serial access - # wireshark - capture sessions in wireshark - kali_groups="kaboxer,dialout,wireshark" - - for user in $(get_user_list); do - echo "INFO: adding user '$user' to groups '$kali_groups'" - usermod -a -G "$kali_groups" $user || true - done -} - -configure_sources_list -configure_zsh -configure_usergroups diff --git a/bin/kali-finish-install b/kali-config/common/post-install/kali-finish-install similarity index 100% rename from bin/kali-finish-install rename to kali-config/common/post-install/kali-finish-install diff --git a/simple-cdd/profiles/kali.postinst b/simple-cdd/profiles/kali.postinst deleted file mode 100755 index 1aaac7a..0000000 --- a/simple-cdd/profiles/kali.postinst +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh - -# The reference version of this script is maintained in -# live-build-config/bin/kali-finish-install. -# -# It is used in multiple places to finish configuring the target system -# and build.sh copies it where required (in the simple-cdd configuration -# and in the live-build configuration). - -configure_sources_list() { - if grep -q '^deb ' /etc/apt/sources.list; then - echo "INFO: sources.list is configured, everything is fine" - return - fi - - echo "INFO: sources.list is empty, setting up a default one for Kali" - - cat >/etc/apt/sources.list </dev/null; then - echo "WARNING: user '$user' is invalid but /home/$user exists" - continue - fi - echo "$user" - done - echo "root" -} - -configure_zsh() { - if grep -q 'nozsh' /proc/cmdline; then - echo "INFO: user opted out of zsh by default" - return - fi - if [ ! -x /usr/bin/zsh ]; then - echo "INFO: /usr/bin/zsh is not available" - return - fi - for user in $(get_user_list); do - echo "INFO: changing default shell of user '$user' to zsh" - chsh --shell /usr/bin/zsh $user - done -} - -# This is generically named in case we want to add other groups in the future. -configure_usergroups() { - # Create the kaboxer group if needed - addgroup --system kaboxer || true - # Create the wireshark group if needed - addgroup --system wireshark || true - - # kaboxer - for kaboxer - # dialout - for serial access - # wireshark - capture sessions in wireshark - kali_groups="kaboxer,dialout,wireshark" - - for user in $(get_user_list); do - echo "INFO: adding user '$user' to groups '$kali_groups'" - usermod -a -G "$kali_groups" $user || true - done -} - -configure_sources_list -configure_zsh -configure_usergroups