diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..583decf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..de40377 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,23 @@ +repo: +- '*' + +GitHub-Action: +- .github/workflows/* + +Configs: +- configs/**/* + +Package-Files: +- pkg-files/**/* + +scripts: +- scripts/**/* + +debug: +- scripts/debug/**/* + +helpers: +- scripts/helpers/**/* + +installers: +- scripts/installers/**/* \ No newline at end of file diff --git a/.github/workflows/combine.yml b/.github/workflows/combine.yml new file mode 100644 index 0000000..a6b2534 --- /dev/null +++ b/.github/workflows/combine.yml @@ -0,0 +1,18 @@ +name: "Combine Dependabot PRs" +on: + workflow_dispatch: + +jobs: + combine-prs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.0.2 + - uses: maadhattah/combine-dependabot-prs@main + with: + branchPrefix: "dependabot" + mustBeGreen: true + combineBranchName: "combined-prs" + ignoreLabel: "nocombine" + baseBranch: "main" + openPR: true + allowSkipped: false \ No newline at end of file diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-documentation.yml new file mode 100644 index 0000000..25a0135 --- /dev/null +++ b/.github/workflows/generate-documentation.yml @@ -0,0 +1,27 @@ +name: Generate Documentation + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.0.2 + - name: Github Action genshdoc + id: action-genshdoc + uses: vargiuscuola/genshdoc@master + - name: genshdoc result + run: echo "The result of genshdoc Action was ${{ steps.action-genshdoc.outputs.result }}" + - name: Commit files + run: | + echo ${{ github.ref }} + git add . + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -m "CI: Automated build push" -a | exit 0 + - name: Push changes + if: github.ref == 'refs/heads/main' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..ef3d7d5 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,22 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: [pull_request] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..6ea7790 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,55 @@ +--- +################################# +################################# +## Super Linter GitHub Actions ## +################################# +################################# +name: Lint Code Base + +# +# Documentation: +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions +# + +############################# +# Start the job on all push # +############################# +on: + push: + branches-ignore: [master, main] + # Remove the line above to run when pushing to master + pull_request: + branches: [master, main] + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Lint Code Base + # Set the agent to run on + runs-on: ubuntu-latest + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v3.0.2 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Run Linter against code base # + ################################ + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index a20aba1..5ed5a40 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ install.conf installlog.txt archnikus.code-workspace -setup.conf \ No newline at end of file +configs/setup.conf +# keep logs out +configs/*.log \ No newline at end of file diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..0af880c --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,6 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. +# Order is important. The last matching pattern has the most precedence. + +# These owners will be the default owners for everything in the repo. +* @ChrisTitusTech \ No newline at end of file diff --git a/README.md b/README.md index ecba172..afec16e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # ArchTitus Installer Script +[![GitHub Super-Linter](https://github.com/ChrisTitusTech/ArchTitus/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) @@ -23,12 +24,15 @@ cd ArchTitus ``` ### System Description -This is completely automated arch install of the KDE desktop environment on arch using all the packages I use on a daily basis. +This is completely automated arch install. It includes prompts to select your desired desktop environment, window manager, AUR helper, and whether to do a full or minimal install. The KDE desktop environment on arch includes all the packages I use on a daily basis, as well as some customizations. ## Troubleshooting -__[Arch Linux Installation Guide](https://github.com/rickellis/Arch-Linux-Install-Guide)__ +__[Arch Linux RickEllis Installation Guide](https://github.com/rickellis/Arch-Linux-Install-Guide)__ +__[Arch Linux Wiki Installation Guide](https://wiki.archlinux.org/title/Installation_guide)__ + +The main script will generate .log files for every script that is run as part of the installation process. These log files contain the terminal output so you can review any warnings or errors that occurred during installation and aid in troubleshooting. ### No Wifi You can check if the WiFi is blocked by running `rfkill list`. @@ -46,6 +50,14 @@ After unblocking the WiFi, you can connect to it. Go through these 5 steps: #5: Find your network, and run `station [device name] connect [network name]`, enter your password and run `exit`. You can test if you have internet connection by running `ping google.com`, and then Press Ctrl and C to stop the ping test. +## Reporting Issues + +An issue is easier to resolve if it contains a few important pieces of information. +1. Chosen configuration from /configs/setup.conf (DONT INCLUDE PASSWORDS) +1. Errors seen in .log files +1. What commit/branch you used +1. Where you were installing (VMWare, Virtualbox, Virt-Manager, Baremetal, etc) + 1. If a VM, what was the configuration used. ## Credits - Original packages script was a post install cleanup script called ArchMatic located here: https://github.com/rickellis/ArchMatic diff --git a/REFERENCE-0-preinstall.md b/REFERENCE-0-preinstall.md new file mode 100644 index 0000000..c19244f --- /dev/null +++ b/REFERENCE-0-preinstall.md @@ -0,0 +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 new file mode 100644 index 0000000..1f18ef8 --- /dev/null +++ b/REFERENCE-1-setup.md @@ -0,0 +1,8 @@ +# Setup + +Configures installed system, installs base packages, and creates user. + +# Functions + + + diff --git a/REFERENCE-2-user.md b/REFERENCE-2-user.md new file mode 100644 index 0000000..a64d508 --- /dev/null +++ b/REFERENCE-2-user.md @@ -0,0 +1,8 @@ +# User + +User customizations and AUR package installation. + +# Functions + + + diff --git a/REFERENCE-3-post-setup.md b/REFERENCE-3-post-setup.md new file mode 100644 index 0000000..623e2e0 --- /dev/null +++ b/REFERENCE-3-post-setup.md @@ -0,0 +1,8 @@ +# Post-Setup + +Finalizing installation configurations and cleaning up after script. + +# Functions + + + diff --git a/REFERENCE-archtitus.md b/REFERENCE-archtitus.md new file mode 100644 index 0000000..ecd766e --- /dev/null +++ b/REFERENCE-archtitus.md @@ -0,0 +1,8 @@ +# ArchTitus + +Entrance script that launches children scripts for each phase of installation. + +# Functions + + + diff --git a/REFERENCE-startup.md b/REFERENCE-startup.md new file mode 100644 index 0000000..221d4bf --- /dev/null +++ b/REFERENCE-startup.md @@ -0,0 +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/REFERENCE.md b/REFERENCE.md new file mode 100644 index 0000000..8fa58c7 --- /dev/null +++ b/REFERENCE.md @@ -0,0 +1,8 @@ +# Reference +**Library Files** +* [scripts/startup.sh](REFERENCE-startup.md) +* [scripts/0-preinstall.sh](REFERENCE-0-preinstall.md) +* [archtitus.sh](REFERENCE-archtitus.md) +* [scripts/1-setup.sh](REFERENCE-1-setup.md) +* [scripts/3-post-setup.sh](REFERENCE-3-post-setup.md) +* [scripts/2-user.sh](REFERENCE-2-user.md) diff --git a/archtitus.sh b/archtitus.sh index 693b248..afed5fa 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -1,4 +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/pkg-files/awesome.text b/pkg-files/awesome.text new file mode 100644 index 0000000..4d14242 --- /dev/null +++ b/pkg-files/awesome.text @@ -0,0 +1,44 @@ +awesome +lightdm +lightdm-gtk-greeter +thunar +lxsession +rxvt-unicode +--END OF MINIMAL INSTALL-- +alsa-utils +pulseaudio +pulseaudio-alsa +wireless_tools +zsh +dunst +rofi +feh +lightdm-webkit2-greeter +lightdm-webkit-theme-litarvan +lxappearance +qt5ct +gsimplecal +xautolock +xclip +scrot +thunar-archive-plugin +thunar-volman +thunar-media-tags-plugin +tumbler +jq +w3m +geany +nano +viewnior +pavucontrol +parcellite +neofetch +htop +picom +gtk2-perl +xfce4-power-manager +imagemagick +playerctl +xsettingsd +obconf + diff --git a/pkg-files/xfce.txt b/pkg-files/xfce.txt index 953826a..0d365c4 100644 --- a/pkg-files/xfce.txt +++ b/pkg-files/xfce.txt @@ -1,3 +1,3 @@ xfce4 -xfce-goodies +xfce4-goodies --END OF MINIMAL INSTALL-- diff --git a/scripts/0-preinstall.sh b/scripts/0-preinstall.sh index b289307..63af03a 100755 --- a/scripts/0-preinstall.sh +++ b/scripts/0-preinstall.sh @@ -7,7 +7,10 @@ # ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ # ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ #------------------------------------------------------------------------- - +#github-action genshdoc +# +# @file Preinstall +# @brief Contains the steps necessary to configure and pacstrap the install to selected drive. echo -ne " ------------------------------------------------------------------------- █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ @@ -69,6 +72,7 @@ echo -ne " Creating Filesystems ------------------------------------------------------------------------- " +# @description Creates the btrfs subvolumes. createsubvolumes () { btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@home @@ -77,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 @@ -84,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 9f0e1ad..6ad2f93 100755 --- a/scripts/1-setup.sh +++ b/scripts/1-setup.sh @@ -1,4 +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 b1b2c43..8e60e6f 100755 --- a/scripts/2-user.sh +++ b/scripts/2-user.sh @@ -1,4 +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 34c67a0..c31cdab 100755 --- a/scripts/3-post-setup.sh +++ b/scripts/3-post-setup.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash +#github-action genshdoc +# +# @file Post-Setup +# @brief Finalizing installation configurations and cleaning up after script. echo -ne " ------------------------------------------------------------------------- █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ @@ -102,6 +106,8 @@ systemctl enable NetworkManager.service echo " NetworkManager enabled" systemctl enable bluetooth echo " Bluetooth enabled" +systemctl enable avahi-daemon.service +echo " Avahi enabled" if [[ "${FS}" == "luks" || "${FS}" == "btrfs" ]]; then echo -ne " diff --git a/scripts/startup.sh b/scripts/startup.sh index 258c6b9..4b834ed 100755 --- a/scripts/startup.sh +++ b/scripts/startup.sh @@ -1,15 +1,21 @@ #!/usr/bin/env bash -# This script will ask users about their prefrences -# like disk, file system, timezone, keyboard layout, -# user name, password, etc. +#github-action genshdoc +# +# @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 @@ -164,6 +170,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 " @@ -179,9 +187,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 " @@ -212,6 +220,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)" @@ -234,6 +243,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" @@ -247,6 +257,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: @@ -264,7 +275,7 @@ case ${options[$?]} in esac } -# selection for disk type +# @description Disk selection for drive to be used with installation. diskpart () { echo -ne " ------------------------------------------------------------------------ @@ -287,6 +298,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 @@ -308,6 +321,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" @@ -317,6 +331,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" @@ -326,6 +341,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