Skip to content

Commit

Permalink
Add support for provision configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
picodotdev committed Jan 21, 2022
1 parent b9239e1 commit 6882cd6
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 80 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
1 change: 1 addition & 0 deletions alis-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions alis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 15 additions & 0 deletions alis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
44 changes: 5 additions & 39 deletions download-sid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

46 changes: 5 additions & 41 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions files/etc/X11/xorg.conf.d/99-killX.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Section "ServerFlags"
Option "DontZap" "false"
EndSection

Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
1 change: 1 addition & 0 deletions site/content/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ url: "/"
<li><b>systemd-homed</b> support</li>
<li><b>PipeWire</b> support</li>
<li><b>Multilib</b> support</li>
<li><b>Provision configuration files</b> support</li>
<li>Arch Linux custom <b>packages installation</b> and <b>repositories installation</b></li>
<li>Flatpak utility installation and <b>Flatpak packages installation</b></li>
<li>SDKMAN utility installation and <b>SDKMAN packages installation</b></li>
Expand Down

0 comments on commit 6882cd6

Please sign in to comment.