diff --git a/archtitus.sh b/archtitus.sh index dedd6c4..afed5fa 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -1,5 +1,8 @@ #!/bin/bash #github-action genshdoc +# +# @file ArchTitus +# @brief Entrance script that launches children scripts for each phase of installation. # Find the name of the folder the scripts are in set -a diff --git a/scripts/0-preinstall.sh b/scripts/0-preinstall.sh index 3741b6d..63af03a 100755 --- a/scripts/0-preinstall.sh +++ b/scripts/0-preinstall.sh @@ -8,7 +8,9 @@ # ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ #------------------------------------------------------------------------- #github-action genshdoc - +# +# @file Preinstall +# @brief Contains the steps necessary to configure and pacstrap the install to selected drive. echo -ne " ------------------------------------------------------------------------- █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ @@ -70,6 +72,7 @@ echo -ne " Creating Filesystems ------------------------------------------------------------------------- " +# @description Creates the btrfs subvolumes. createsubvolumes () { btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@home @@ -78,6 +81,7 @@ createsubvolumes () { btrfs subvolume create /mnt/@.snapshots } +# @description Mount all btrfs subvolumes after root has been mounted. mountallsubvol () { mount -o ${MOUNT_OPTIONS},subvol=@home ${partition3} /mnt/home mount -o ${MOUNT_OPTIONS},subvol=@tmp ${partition3} /mnt/tmp @@ -85,6 +89,7 @@ mountallsubvol () { mount -o ${MOUNT_OPTIONS},subvol=@.snapshots ${partition3} /mnt/.snapshots } +# @description BTRFS subvolulme creation and mounting. subvolumesetup () { # create nonroot subvolumes createsubvolumes diff --git a/scripts/1-setup.sh b/scripts/1-setup.sh index 22860c6..6ad2f93 100755 --- a/scripts/1-setup.sh +++ b/scripts/1-setup.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash #github-action genshdoc +# +# @file Setup +# @brief Configures installed system, installs base packages, and creates user. echo -ne " ------------------------------------------------------------------------- █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ diff --git a/scripts/2-user.sh b/scripts/2-user.sh index 2bb9646..8e60e6f 100755 --- a/scripts/2-user.sh +++ b/scripts/2-user.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash #github-action genshdoc +# +# @file User +# @brief User customizations and AUR package installation. echo -ne " ------------------------------------------------------------------------- █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ diff --git a/scripts/3-post-setup.sh b/scripts/3-post-setup.sh index 0e94c72..c31cdab 100755 --- a/scripts/3-post-setup.sh +++ b/scripts/3-post-setup.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash #github-action genshdoc +# +# @file Post-Setup +# @brief Finalizing installation configurations and cleaning up after script. echo -ne " ------------------------------------------------------------------------- █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ diff --git a/scripts/startup.sh b/scripts/startup.sh index 8406227..98bba69 100755 --- a/scripts/startup.sh +++ b/scripts/startup.sh @@ -1,23 +1,28 @@ #!/usr/bin/env bash #github-action genshdoc -# This script will ask users about their prefrences -# like disk, file system, timezone, keyboard layout, -# user name, password, etc. +# +# @file Startup +# @brief This script will ask users about their prefrences like disk, file system, timezone, keyboard layout, user name, password, etc. +# @stdout Output routed to startup.log +# @stderror Output routed to startup.log -# set up a config file +# @setting-header General Settings +# @setting CONFIG_FILE string[$CONFIGS_DIR/setup.conf] Location of setup.conf to be used by set_option and all subsequent scripts. CONFIG_FILE=$CONFIGS_DIR/setup.conf if [ ! -f $CONFIG_FILE ]; then # check if file exists touch -f $CONFIG_FILE # create file if not exists fi -# set options in setup.conf +# @description set options in setup.conf +# @arg $1 string Configuration variable. +# @arg $2 string Configuration value. set_option() { if grep -Eq "^${1}.*" $CONFIG_FILE; then # check if option exists sed -i -e "/^${1}.*/d" $CONFIG_FILE # delete option if exists fi echo "${1}=${2}" >>$CONFIG_FILE # add option } -# Renders a text based list of options that can be selected by the +# @description Renders a text based list of options that can be selected by the # user using up, down and enter keys and returns the chosen option. # # Arguments : list of options, maximum of 256 @@ -126,6 +131,8 @@ select_option() { return $(( $active_col + $active_row * $colmax )) } +# @description Displays ArchTitus logo +# @noargs logo () { # This will be shown on every set as user is progressing echo -ne " @@ -141,9 +148,9 @@ echo -ne " ------------------------------------------------------------------------ " } -filesystem () { -# This function will handle file systems. At this movement we are handling only +# @description This function will handle file systems. At this movement we are handling only # btrfs and ext4. Others will be added in future. +filesystem () { echo -ne " Please Select your file system for both boot and root " @@ -174,6 +181,7 @@ done *) echo "Wrong option please select again"; filesystem;; esac } +# @description Detects and sets timezone. timezone () { # Added this from arch wiki https://wiki.archlinux.org/title/System_time time_zone="$(curl --fail https://ipapi.co/timezone)" @@ -196,6 +204,7 @@ case ${options[$?]} in *) echo "Wrong option. Try again";timezone;; esac } +# @description Set user's keyboard mapping. keymap () { echo -ne " Please select key board layout from this list" @@ -209,6 +218,7 @@ echo -ne "Your key boards layout: ${keymap} \n" set_option KEYMAP $keymap } +# @description Choose whether drive is SSD or not. drivessd () { echo -ne " Is this an ssd? yes/no: @@ -226,7 +236,7 @@ case ${options[$?]} in esac } -# selection for disk type +# @description Disk selection for drive to be used with installation. diskpart () { echo -ne " ------------------------------------------------------------------------ @@ -249,6 +259,8 @@ echo -e "\n${disk%|*} selected \n" drivessd } + +# @description Gather username and password to be used for installation. userinfo () { read -p "Please enter your username: " username set_option USERNAME ${username,,} # convert to lower case as in issue #109 @@ -270,6 +282,7 @@ read -rep "Please enter your hostname: " nameofmachine set_option NAME_OF_MACHINE $nameofmachine } +# @description Choose AUR helper. aurhelper () { # Let the user choose AUR helper from predefined list echo -ne "Please enter your desired AUR helper:\n" @@ -279,6 +292,7 @@ aurhelper () { set_option AUR_HELPER $aur_helper } +# @description Choose Desktop Environment desktopenv () { # Let the user choose Desktop Enviroment from predefined list echo -ne "Please select your desired Desktop Enviroment:\n" @@ -288,6 +302,7 @@ desktopenv () { set_option DESKTOP_ENV $desktop_env } +# @description Choose whether to do full or minimal installation. installtype () { echo -ne "Please select type of installation:\n\n Full install: Installs full featured desktop enviroment, with added apps and themes needed for everyday use\n