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 new file mode 100755 index 00000000..b1770010 --- /dev/null +++ b/airootfs/root/endeavouros-skel-liveuser/src/etc/skel/user-commands-before.bash @@ -0,0 +1,44 @@ +#!/bin/bash +# +# This file can contain commands that will be executed (as root) before +# calamares is started. So here you may configure various settings of calamares. +# +# NOTE! This is an advanced feature, so you need to know *exactly* what +# you are doing. Otherwise bad things can happen... +# Sound knowledge of calamares, bash language, and linux commands is required +# for a meaningful customization. +# +# If you add commands to this file, start the whole install process fresh +# with terminal command 'eos-welcome' after saving this file. +# +# Tip: save your customized commands into a file on an internet server +# and fetch that file with command: +# +# wget -O ~/user-commands-before.bash "URL-referring-the-file" +# +# Note: this file is supported in ISOs *after* Galileo Neo! +# +#---------------------------------------------------------------------------------- +# +# Now *you* can add your commands into function _IsoConfig below. +# +#---------------------------------------------------------------------------------- + +_IsoConfig() { + ## Add your ISO configurations here. + ## This is executed as root before calamares is started. + + local -r install_mode="$1" # 'online' or 'offline' + + ## Now your commands. Some examples: + # + # Set KDE-Desktop as default: + # printf "\ndefault: KDE-Desktop\n" >> /etc/calamares/modules/packagechooser.conf + # ... +} + +## Execute the commands if the parameter list is valid: + +case "$1" in + offline | online) _IsoConfig "$1" ;; +esac 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 b18d70b3..86462071 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 @@ -1,19 +1,23 @@ #!/bin/bash # -# This file can contain commands that will be executed at the end of -# EndeavourOS install (online mode only) on the target system. -# The commands will be executed as root. +# This file can contain commands that will be executed (as root) at the end of +# EndeavourOS install (in online mode only) on the target system. # -# This allows you to customize the installed system in several ways! +# NOTE! This is an advanced feature, so you need to know exactly +# what you are doing. Otherwise bad things can happen... +# Sound knowledge of bash language and linux commands is required +# for a meaningful customization. # -# If you add commands to this file, start the install process after -# saving this file. +# If you add commands to this file, start the whole install process fresh +# with terminal command 'eos-welcome' after saving this file. # # Tip: save your customized commands into a file on an internet server # and fetch that file with command: # # wget -O ~/user_commands.bash "URL-referring-the-file" # +# Here you may customize the installed system in several ways. +# # Ideas for customization: # - install packages # - remove packages @@ -35,40 +39,36 @@ # The 'makepkg' command suffers from the same limitation. # This essentially blocks installing AUR packages here. # -# Advanced tip (for ISOs since year 2022): -# To write files directly into $HOME, you can find the new username -# as the first parameter given to user_commands.bash, e.g. -# username="$1" -# Then you may write files under folder -# /home/$username +# Tip: if you write new files into the home directory of the new user, +# make sure to properly set the file permissions too. # #---------------------------------------------------------------------------------- # -# Now *you* can add your commands into the two functions below. +# Now *you* can add your commands into function _PostInstallCommands 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. + ## Add your "late-install" commands here. + ## This is executed as root near the end of calamares execution. local -r username="$1" # new user you created for the target - # ... - # echo "# Hello world!" >> /home/$username/.bashrc + + ## Now your commands. Some examples: + # + # echo "## Hello world!" >> /home/$username/.bashrc + # echo "export FUNCNEST=100" >> /home/$username/.bashrc + # echo "alias pacdiff=eos-pacdiff" >> /home/$username/.bashrc + # chmod $username:$username /home/$username/.bashrc + # # pacman -S --noconfirm --needed geany chromium libreoffice-fresh + # ... } +## Execute the commands if the parameter list is valid: + case "$1" in - --iso-config) _IsoConfig "$2" ;; - offline | online) _IsoConfig "$1" ;; # after Galileo neo! + --iso-config) ;; # not supported here! + offline | online) :: # not supported here! *) _PostInstallCommands "$1" ;; esac