Merge branch 'ChrisTitusTech:main' into patch-1

This commit is contained in:
Kassin Dornelles 2022-04-15 01:20:08 -03:00 committed by GitHub
commit cd87e25839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 174 additions and 13 deletions

View File

@ -6,7 +6,7 @@ jobs:
combine-prs: combine-prs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2.3.3 - uses: actions/checkout@v3.0.0
- uses: maadhattah/combine-dependabot-prs@main - uses: maadhattah/combine-dependabot-prs@main
with: with:
branchPrefix: "dependabot" branchPrefix: "dependabot"

View File

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3.0.0
- name: Github Action genshdoc - name: Github Action genshdoc
id: action-genshdoc id: action-genshdoc
uses: vargiuscuola/genshdoc@master uses: vargiuscuola/genshdoc@master

View File

@ -39,7 +39,7 @@ jobs:
# Checkout the code base # # Checkout the code base #
########################## ##########################
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v2 uses: actions/checkout@v3.0.0
with: with:
# Full git history is needed to get a proper list of changed files within `super-linter` # Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0 fetch-depth: 0

View File

@ -1,4 +1,23 @@
# Preinstall
Contains the steps necessary to configure and pacstrap the install to selected drive.
# Overview
Creates the btrfs subvolumes.
# Functions # Functions
* [mountallsubvol()](#mountallsubvol)
* [subvolumesetup()](#subvolumesetup)
## mountallsubvol()
Mount all btrfs subvolumes after root has been mounted.
## subvolumesetup()
BTRFS subvolulme creation and mounting.

View File

@ -1,3 +1,7 @@
# Setup
Configures installed system, installs base packages, and creates user.
# Functions # Functions

View File

@ -1,3 +1,7 @@
# User
User customizations and AUR package installation.
# Functions # Functions

View File

@ -1,3 +1,7 @@
# Post-Setup
Finalizing installation configurations and cleaning up after script.
# Functions # Functions

View File

@ -1,3 +1,7 @@
# ArchTitus
Entrance script that launches children scripts for each phase of installation.
# Functions # Functions

View File

@ -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 # 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.

View File

@ -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

View File

@ -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

View File

@ -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 "
------------------------------------------------------------------------- -------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗

View File

@ -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 "
------------------------------------------------------------------------- -------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗

View File

@ -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 "
------------------------------------------------------------------------- -------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗

View File

@ -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