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