From 2e38348f9bec4d483d410cb0e26f9a4cb162be38 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 17 Jan 2024 00:08:12 +0200 Subject: [PATCH] removed user-commands-before.bash, changed user_commands.bash --- .../src/etc/skel/user-commands-before.bash | 20 ------------ .../src/etc/skel/user_commands.bash | 31 ++++++++++++++++--- 2 files changed, 27 insertions(+), 24 deletions(-) delete mode 100755 airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user-commands-before.bash diff --git a/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user-commands-before.bash b/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user-commands-before.bash deleted file mode 100755 index 9c21a03e..00000000 --- a/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user-commands-before.bash +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# A template file for configuring the calamares installer. -# This will be called before starting calamares. -# The chosen install mode (offline or online) is the only parameter. -# -# To use this, add your required commands below. -# You may also "uncomment" any of the examples below, if needed. - -install_mode="$1" # value: 'offline' or 'online' - -## Example 1: set KDE-Desktop as default. -# printf "\ndefault: KDE-Desktop\n" >> /etc/calamares/modules/packagechooser.conf - -## Example 2: change the default filesystem from ext4 to btrfs in virtualbox VM. -# if [ "$(device-info --virtualbox)" = "yes" ] ; then -# sed -i /etc/calamares/modules/partition.conf -E \ -# -e 's|^defaultFileSystemType:.*|defaultFileSystemType: "btrfs"|' \ -# -e 's|^(availableFileSystemTypes:.*)"ext4","btrfs"|\1"btrfs","ext4"|' -# fi diff --git a/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user_commands.bash b/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user_commands.bash index 7f081c0c..b18d70b3 100755 --- a/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user_commands.bash +++ b/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user_commands.bash @@ -43,9 +43,32 @@ # /home/$username # #---------------------------------------------------------------------------------- -# Full but artificial example (to try it, remove the first '#' from the lines below): # -# username="$1" -# echo "# Hello world!" >> /home/$username/.bashrc -# pacman -S --noconfirm --needed geany chromium libreoffice-fresh +# Now *you* can add your commands into the two functions below. +# +#---------------------------------------------------------------------------------- + +_IsoConfig() { + # ISO configurations here. + # This runs before calamares is started. + + local -r install_mode="$1" # 'online' or 'offline' + # ... + # ls /home/liveuser +} + +_PostInstallCommands() { + # Post-install commands here. + # This runs near the end of calamares execution. + + local -r username="$1" # new user you created for the target + # ... + # echo "# Hello world!" >> /home/$username/.bashrc + # pacman -S --noconfirm --needed geany chromium libreoffice-fresh +} +case "$1" in + --iso-config) _IsoConfig "$2" ;; + offline | online) _IsoConfig "$1" ;; # after Galileo neo! + *) _PostInstallCommands "$1" ;; +esac