From 6882cd608793b04883cccd8420647d71dffc3417 Mon Sep 17 00:00:00 2001 From: "pico.dev" Date: Fri, 21 Jan 2022 20:42:56 +0100 Subject: [PATCH] Add support for provision configuration files --- README.md | 1 + alis-commons.sh | 1 + alis.conf | 5 +++ alis.sh | 15 ++++++++ download-sid.sh | 44 +++-------------------- download.sh | 46 +++---------------------- files/etc/X11/xorg.conf.d/99-killX.conf | 9 +++++ site/content/index.markdown | 1 + 8 files changed, 42 insertions(+), 80 deletions(-) create mode 100644 files/etc/X11/xorg.conf.d/99-killX.conf diff --git a/README.md b/README.md index 3cd35caf..833ebaf5 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ For new features, improvements and bugs fill an issue in GitHub or make a pull r * **systemd-homed** support * **PipeWire** support * **Multilib** support +* **Provision configuration files** support * Arch Linux custom **packages installation** and **repositories installation** * Flatpak utility installation and **Flatpak packages installation** * SDKMAN utility installation and **SDKMAN packages installation** diff --git a/alis-commons.sh b/alis-commons.sh index 82d4a553..7d49f642 100644 --- a/alis-commons.sh +++ b/alis-commons.sh @@ -17,6 +17,7 @@ RECOVERY_ASCIINEMA_FILE="alis-recovery.asciinema" PACKAGES_CONF_FILE="alis-packages.conf" PACKAGES_LOG_FILE="alis-packages.log" COMMONS_CONF_FILE="alis-commons.conf" +PROVISION_DIRECTORY="files/" RED='\033[0;91m' GREEN='\033[0;92m' diff --git a/alis.conf b/alis.conf index 57ace369..d053675f 100644 --- a/alis.conf +++ b/alis.conf @@ -156,6 +156,11 @@ PACKAGES_MULTILIB="false" PACKAGES_INSTALL="false" PACKAGES_PIPEWIRE="false" +# provision +## PROVISION_DIRECTORY directory files to provision, preserving directories. This is useful to copy some configuration files. +## PROVISION_IGNORE_FILES files to ignore on provision. All files are provisioned by default if not specified in the list. +PROVISION_IGNORE_FILES="/etc/X11/xorg.conf.d/99-killX.conf" + # misc ## VAGRANT for build a VirtualBox OVA with Packer VAGRANT="false" diff --git a/alis.sh b/alis.sh index 2b4d15ac..f167b76b 100755 --- a/alis.sh +++ b/alis.sh @@ -69,6 +69,7 @@ function sanitize_variables() { BOOTLOADER=$(sanitize_variable "$BOOTLOADER") CUSTOM_SHELL=$(sanitize_variable "$CUSTOM_SHELL") DESKTOP_ENVIRONMENT=$(sanitize_variable "$DESKTOP_ENVIRONMENT") + PROVISION_IGNORE_FILES=$(sanitize_variable "$PROVISION_IGNORE_FILES") SYSTEMD_UNITS=$(sanitize_variable "$SYSTEMD_UNITS") for I in "${BTRFS_SUBVOLUMES_MOUNTPOINTS[@]}"; do @@ -1566,6 +1567,19 @@ function packages() { fi } +function provision() { + print_step "provision()" + + # copy files from files/ to /mnt ignoring files to ignore and preserving directories + local FILES=".alis-ignore-file" + if [ -n "$PROVISION_IGNORE_FILES" ]; then + local FILES="$PROVISION_IGNORE_FILES" + fi + echo "$FILES" > ignore-file.txt + (cd "$PROVISION_DIRECTORY" && find . -type f -print | sed 's/^\.//g' | sort | grep --invert-match -f ../ignore-file.txt | xargs -I % bash -c 'cp -v --parents ".%" /mnt') + rm ignore-file.txt +} + function vagrant() { pacman_install "openssh" create_user "vagrant" "vagrant" @@ -1721,6 +1735,7 @@ function main() { execute_step "desktop_environment" fi execute_step "packages" + execute_step "provision" if [ "$VAGRANT" == "true" ]; then execute_step "vagrant" fi diff --git a/download-sid.sh b/download-sid.sh index 2e6d93ca..370b4eae 100755 --- a/download-sid.sh +++ b/download-sid.sh @@ -20,43 +20,9 @@ while getopts "u:" arg; do esac done -rm -f alis.conf -rm -f alis.sh -rm -f alis-asciinema.sh -rm -f alis-reboot.sh - -rm -f alis-recovery.conf -rm -f alis-recovery.sh -rm -f alis-recovery-asciinema.sh -rm -f alis-recovery-reboot.sh - -rm -f alis-packages.conf -rm -f alis-packages.sh -rm -f alis-packages-asciinema.sh - -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-commons.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis.conf -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-asciinema.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-reboot.sh - -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery.conf -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery-asciinema.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery-reboot.sh - -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-packages.conf -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-packages.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-packages-asciinema.sh - -chmod +x alis.sh -chmod +x alis-asciinema.sh -chmod +x alis-reboot.sh - -chmod +x alis-recovery.sh -chmod +x alis-recovery-asciinema.sh -chmod +x alis-recovery-reboot.sh - -chmod +x alis-packages.sh -chmod +x alis-packages-asciinema.sh +set -o xtrace +pacman -Sy --noconfirm git +git clone --depth 1 --branch "$BRANCH" "https://github.com/$GITHUB_USER/alis.git" +cp -R alis/*.sh alis/*.conf alis/files/ ./ +chmod +x *.sh diff --git a/download.sh b/download.sh index 0a294128..ecd83270 100755 --- a/download.sh +++ b/download.sh @@ -20,44 +20,8 @@ while getopts "u:" arg; do esac done -rm -f alis.conf -rm -f alis.sh -rm -f alis-asciinema.sh -rm -f alis-reboot.sh - -rm -f alis-recovery.conf -rm -f alis-recovery.sh -rm -f alis-recovery-asciinema.sh -rm -f alis-recovery-reboot.sh - -rm -f alis-packages.conf -rm -f alis-packages.sh -rm -f alis-packages-asciinema.sh - -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-commons.conf -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-commons.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis.conf -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-asciinema.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-reboot.sh - -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery.conf -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery-asciinema.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-recovery-reboot.sh - -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-packages.conf -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-packages.sh -curl -O https://raw.githubusercontent.com/$GITHUB_USER/alis/$BRANCH/alis-packages-asciinema.sh - -chmod +x alis.sh -chmod +x alis-asciinema.sh -chmod +x alis-reboot.sh - -chmod +x alis-recovery.sh -chmod +x alis-recovery-asciinema.sh -chmod +x alis-recovery-reboot.sh - -chmod +x alis-packages.sh -chmod +x alis-packages-asciinema.sh - +set -o xtrace +pacman -Sy --noconfirm git +git clone --depth 1 --branch "$BRANCH" "https://github.com/$GITHUB_USER/alis.git" +cp -R alis/*.sh alis/*.conf alis/files/ ./ +chmod +x *.sh diff --git a/files/etc/X11/xorg.conf.d/99-killX.conf b/files/etc/X11/xorg.conf.d/99-killX.conf new file mode 100644 index 00000000..4f56de01 --- /dev/null +++ b/files/etc/X11/xorg.conf.d/99-killX.conf @@ -0,0 +1,9 @@ +Section "ServerFlags" + Option "DontZap" "false" +EndSection + +Section "InputClass" + Identifier "Keyboard Defaults" + MatchIsKeyboard "yes" + Option "XkbOptions" "terminate:ctrl_alt_bksp" +EndSection diff --git a/site/content/index.markdown b/site/content/index.markdown index dd23c770..003b0895 100644 --- a/site/content/index.markdown +++ b/site/content/index.markdown @@ -133,6 +133,7 @@ url: "/"
  • systemd-homed support
  • PipeWire support
  • Multilib support
  • +
  • Provision configuration files support
  • Arch Linux custom packages installation and repositories installation
  • Flatpak utility installation and Flatpak packages installation
  • SDKMAN utility installation and SDKMAN packages installation