diff --git a/.github/workflows/combine.yml b/.github/workflows/combine.yml index 938011e..435f74e 100644 --- a/.github/workflows/combine.yml +++ b/.github/workflows/combine.yml @@ -6,7 +6,7 @@ jobs: combine-prs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.3 + - uses: actions/checkout@v3.0.0 - uses: maadhattah/combine-dependabot-prs@main with: branchPrefix: "dependabot" diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-documentation.yml index 1f28199..658483c 100644 --- a/.github/workflows/generate-documentation.yml +++ b/.github/workflows/generate-documentation.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3.0.0 - name: Github Action genshdoc id: action-genshdoc uses: vargiuscuola/genshdoc@master diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0149ccb..5df60a8 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -39,7 +39,7 @@ jobs: # Checkout the code base # ########################## - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v3.0.0 with: # Full git history is needed to get a proper list of changed files within `super-linter` fetch-depth: 0 diff --git a/REFERENCE-0-preinstall.md b/REFERENCE-0-preinstall.md index 62746e0..c19244f 100644 --- a/REFERENCE-0-preinstall.md +++ b/REFERENCE-0-preinstall.md @@ -1,4 +1,23 @@ +# Preinstall + +Contains the steps necessary to configure and pacstrap the install to selected drive. + +# Overview + +Creates the btrfs subvolumes. + + # Functions +* [mountallsubvol()](#mountallsubvol) +* [subvolumesetup()](#subvolumesetup) +## mountallsubvol() + +Mount all btrfs subvolumes after root has been mounted. + +## subvolumesetup() + +BTRFS subvolulme creation and mounting. + diff --git a/REFERENCE-1-setup.md b/REFERENCE-1-setup.md index 62746e0..1f18ef8 100644 --- a/REFERENCE-1-setup.md +++ b/REFERENCE-1-setup.md @@ -1,3 +1,7 @@ +# Setup + +Configures installed system, installs base packages, and creates user. + # Functions diff --git a/REFERENCE-2-user.md b/REFERENCE-2-user.md index 62746e0..a64d508 100644 --- a/REFERENCE-2-user.md +++ b/REFERENCE-2-user.md @@ -1,3 +1,7 @@ +# User + +User customizations and AUR package installation. + # Functions diff --git a/REFERENCE-3-post-setup.md b/REFERENCE-3-post-setup.md index 62746e0..623e2e0 100644 --- a/REFERENCE-3-post-setup.md +++ b/REFERENCE-3-post-setup.md @@ -1,3 +1,7 @@ +# Post-Setup + +Finalizing installation configurations and cleaning up after script. + # Functions diff --git a/REFERENCE-archtitus.md b/REFERENCE-archtitus.md index 62746e0..ecd766e 100644 --- a/REFERENCE-archtitus.md +++ b/REFERENCE-archtitus.md @@ -1,3 +1,7 @@ +# ArchTitus + +Entrance script that launches children scripts for each phase of installation. + # Functions diff --git a/REFERENCE-startup.md b/REFERENCE-startup.md index 62746e0..221d4bf 100644 --- a/REFERENCE-startup.md +++ b/REFERENCE-startup.md @@ -1,4 +1,98 @@ +# Startup + +This script will ask users about their prefrences like disk, file system, timezone, keyboard layout, user name, password, etc. + +# Settings + +## General Settings +* **CONFIG_FILE** (string)[default: **$CONFIGS_DIR/setup.conf**]: Location of setup.conf to be used by set_option and all subsequent scripts. + + # Functions +* [set_option()](#set_option) +* [select_option()](#select_option) +* [logo()](#logo) +* [filesystem()](#filesystem) +* [timezone()](#timezone) +* [keymap()](#keymap) +* [drivessd()](#drivessd) +* [diskpart()](#diskpart) +* [userinfo()](#userinfo) +* [aurhelper()](#aurhelper) +* [desktopenv()](#desktopenv) +* [installtype()](#installtype) +## set_option() + +set options in setup.conf + +### Output on stdout + +* Output routed to startup.log + +### Output on stderr + +* # @stderror Output routed to startup.log + +### Arguments + +* **$1** (string): Configuration variable. + +### Arguments + +* **$2** (string): Configuration value. + +## select_option() + +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 + "opt1" "opt2" ... + Return value: selected index (0 for opt1, 1 for opt2 ...) + +## logo() + +Displays ArchTitus logo + +_Function has no arguments._ + +## filesystem() + +This function will handle file systems. At this movement we are handling only +btrfs and ext4. Others will be added in future. + +## timezone() + +Detects and sets timezone. + +## keymap() + +Set user's keyboard mapping. + +## drivessd() + +Choose whether drive is SSD or not. + +## diskpart() + +Disk selection for drive to be used with installation. + +## userinfo() + +Gather username and password to be used for installation. + +## aurhelper() + +Choose AUR helper. + +## desktopenv() + +Choose Desktop Environment + +## installtype() + +Choose whether to do full or minimal installation. + 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