godalming123 2022-03-05 09:41:58 +00:00 committed by GitHub
parent 7aff03901b
commit f81e2ac865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 142 additions and 94 deletions

View File

@ -19,15 +19,17 @@ echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
Scripts are in directory named ArchTitus Scripts are in directory named ArchTitus
" "
( bash $SCRIPT_DIR/scripts/startup.sh )|& tee startup.log mkdir $SCRIPT_DIR/logs
source $CONFIGS_DIR/setup.conf ( bash $SCRIPT_DIR/scripts/startup.sh )|& tee $SCRIPT_DIR/logs/startup.log
( bash $SCRIPT_DIR/scripts/0-preinstall.sh )|& tee 0-preinstall.log source $CONFIGS_DIR/setup.conf
( arch-chroot /mnt $HOME/ArchTitus/scripts/1-setup.sh )|& tee 1-setup.log ( bash $SCRIPT_DIR/scripts/0-preinstall.sh )|& tee $SCRIPT_DIR/logs/0-preinstall.log
if [[ ! $DESKTOP_ENV == server ]]; then ( arch-chroot /mnt $HOME/ArchTitus/scripts/1-setup.sh )|& $SCRIPT_DIR/logs/tee 1-setup.log
( arch-chroot /mnt /usr/bin/runuser -u $USERNAME -- /home/$USERNAME/ArchTitus/scripts/2-user.sh )|& tee 2-user.log if [[ ! $DESKTOP_ENV == server ]]; then
fi ( arch-chroot /mnt /usr/bin/runuser -u $USERNAME -- /home/$USERNAME/ArchTitus/scripts/2-user.sh )|& tee $SCRIPT_DIR/logs/2-user.log
( arch-chroot /mnt $HOME/ArchTitus/scripts/3-post-setup.sh )|& tee 3-post-setup.log fi
cp -v *.log /mnt/home/$USERNAME ( arch-chroot /mnt $HOME/ArchTitus/scripts/3-post-setup.sh )|& tee $SCRIPT_DIR/logs/3-post-setup.log
mkdir /mnt/home/$USERNAME/installLogs
cp -v $SCRIPT_DIR/logs/*.log /mnt/home/$USERNAME/installLogs
echo -ne " echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------

View File

@ -19,7 +19,6 @@ echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
Automated Arch Linux Installer Automated Arch Linux Installer
------------------------------------------------------------------------- -------------------------------------------------------------------------
Setting up mirrors for optimal download Setting up mirrors for optimal download
" "
source $CONFIGS_DIR/setup.conf source $CONFIGS_DIR/setup.conf
@ -155,6 +154,7 @@ echo "
Generated /etc/fstab: Generated /etc/fstab:
" "
cat /mnt/etc/fstab cat /mnt/etc/fstab
if [${GRUB_INSTALL} == "yes"]; then
echo -ne " echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
GRUB BIOS Bootloader Install & Check GRUB BIOS Bootloader Install & Check
@ -165,6 +165,7 @@ if [[ ! -d "/sys/firmware/efi" ]]; then
else else
pacstrap /mnt efibootmgr --noconfirm --needed pacstrap /mnt efibootmgr --noconfirm --needed
fi fi
fi
echo -ne " echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
Checking for low memory systems <8G Checking for low memory systems <8G
@ -187,4 +188,4 @@ echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
SYSTEM READY FOR 1-setup.sh SYSTEM READY FOR 1-setup.sh
------------------------------------------------------------------------- -------------------------------------------------------------------------
" "

View File

@ -11,46 +11,45 @@ echo -ne "
Automated Arch Linux Installer Automated Arch Linux Installer
SCRIPTHOME: ArchTitus SCRIPTHOME: ArchTitus
------------------------------------------------------------------------- -------------------------------------------------------------------------
Installing AUR Softwares Installing AUR Softwares
" "
source $HOME/ArchTitus/configs/setup.conf source $HOME/ArchTitus/configs/setup.conf
cd ~ addAUR () {
mkdir "/home/$USERNAME/.cache" git clone "https://aur.archlinux.org/$1.git"
touch "/home/$USERNAME/.cache/zshhistory" cd $1
git clone "https://github.com/ChrisTitusTech/zsh"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
ln -s "~/zsh/.zshrc" ~/.zshrc
sed -n '/'$INSTALL_TYPE'/q;p' ~/ArchTitus/pkg-files/${DESKTOP_ENV}.txt | while read line
do
if [[ ${line} == '--END OF MINIMAL INSTALL--' ]]
then
# If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line
continue
fi
echo "INSTALLING: ${line}"
sudo pacman -S --noconfirm --needed ${line}
done
if [[ ! $AUR_HELPER == none ]]; then
cd ~
git clone "https://aur.archlinux.org/$AUR_HELPER.git"
cd ~/$AUR_HELPER
makepkg -si --noconfirm makepkg -si --noconfirm
cd ../
rm -r $1
}
installFromFile () {
# sed $INSTALL_TYPE is using install type to check for MINIMAL installation, if it's true, stop # sed $INSTALL_TYPE is using install type to check for MINIMAL installation, if it's true, stop
# stop the script and move on, not installing any more packages below that line # stop the script and move on, not installing any more packages below that line
sed -n '/'$INSTALL_TYPE'/q;p' ~/ArchTitus/pkg-files/aur-pkgs.txt | while read line sed -n '/'$INSTALL_TYPE'/q;p' $1 | while read line
do do
if [[ ${line} == '--END OF MINIMAL INSTALL--' ]]; then if [[ ${line} == '--END OF MINIMAL INSTALL--' ]]
then
# If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line # If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line
continue continue
fi fi
echo "INSTALLING: ${line}" echo "INSTALLING: ${line}"
$AUR_HELPER -S --noconfirm --needed ${line} sudo pacman -S --noconfirm --needed ${line}
done done
}
cd ~
mkdir "/home/$USERNAME/.cache"
touch "/home/$USERNAME/.cache/zshhistory"
git clone "https://github.com/ChrisTitusTech/zsh"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
ln -s "~/zsh/.zshrc" ~/.zshrc
installFromFile ~/ArchTitus/pkg-files/${DESKTOP_ENV}.txt
if [[ ! $AUR_HELPER == none ]]; then
addAUR $AUR_HELPER
installFromFile ~/ArchTitus/pkg-files/aur-pkgs.txt
fi fi
export PATH=$PATH:~/.local/bin export PATH=$PATH:~/.local/bin
@ -75,4 +74,4 @@ echo -ne "
SYSTEM READY FOR 3-post-setup.sh SYSTEM READY FOR 3-post-setup.sh
------------------------------------------------------------------------- -------------------------------------------------------------------------
" "
exit exit

View File

@ -11,7 +11,6 @@ echo -ne "
Automated Arch Linux Installer Automated Arch Linux Installer
SCRIPTHOME: ArchTitus SCRIPTHOME: ArchTitus
------------------------------------------------------------------------- -------------------------------------------------------------------------
Final Setup and Configurations Final Setup and Configurations
GRUB EFI Bootloader Install & Check GRUB EFI Bootloader Install & Check
" "
@ -33,22 +32,27 @@ fi
# set kernel parameter for adding splash screen # set kernel parameter for adding splash screen
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[^"]*/& splash /' /etc/default/grub sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="[^"]*/& splash /' /etc/default/grub
echo -e "Installing CyberRe Grub theme..." if [[ ${GRUB_THEME} == "cyberRE" ]]; then
THEME_DIR="/boot/grub/themes" echo -e "Installing CyberRe Grub theme..."
THEME_NAME=CyberRe THEME_DIR="/boot/grub/themes"
echo -e "Creating the theme directory..." THEME_NAME=CyberRe
mkdir -p "${THEME_DIR}/${THEME_NAME}" echo -e "Creating the theme directory..."
echo -e "Copying the theme..." mkdir -p "${THEME_DIR}/${THEME_NAME}"
cd ${HOME}/ArchTitus echo -e "Copying the theme..."
cp -a configs${THEME_DIR}/${THEME_NAME}/* ${THEME_DIR}/${THEME_NAME} cd ${HOME}/ArchTitus
echo -e "Backing up Grub config..." cp -a configs${THEME_DIR}/${THEME_NAME}/* ${THEME_DIR}/${THEME_NAME}
cp -an /etc/default/grub /etc/default/grub.bak echo -e "Backing up Grub config..."
echo -e "Setting the theme as the default..." cp -an /etc/default/grub /etc/default/grub.bak
grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub echo -e "Setting the theme as the default..."
echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub grep "GRUB_THEME=" /etc/default/grub 2>&1 >/dev/null && sed -i '/GRUB_THEME=/d' /etc/default/grub
echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
fi
if [[ ${GRUB_INSTALL} == "Yes" ]]; then
echo -e "Updating grub..." echo -e "Updating grub..."
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
echo -e "All set!" echo -e "All set!"
fi
echo -ne " echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
@ -155,4 +159,4 @@ rm -r $HOME/ArchTitus
rm -r /home/$USERNAME/ArchTitus rm -r /home/$USERNAME/ArchTitus
# Replace in the same state # Replace in the same state
cd $pwd cd $pwd

View File

@ -1,24 +1,25 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# This script will ask users about their prefrences # This script will ask users about their prefrences
# like disk, file system, timezone, keyboard layout, # like disk, file system, timezone, keyboard layout,
# user name, password, etc. # user name, password, etc.
# set up a config file # === set up a config file ===
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 # === set options in setup.conf ===
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
# user using up, down and enter keys and returns the chosen 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 # Arguments : list of options, maximum of 256
# "opt1" "opt2" ... # "opt1" "opt2" ...
# Return value: selected index (0 for opt1, 1 for opt2 ...) # Return value: selected index (0 for opt1, 1 for opt2 ...)
@ -125,8 +126,9 @@ select_option() {
return $(( $active_col + $active_row * $colmax )) return $(( $active_col + $active_row * $colmax ))
} }
# === This will be shown on every set as user is progressing ===
logo () { logo () {
# This will be shown on every set as user is progressing
echo -ne " echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
█████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗
@ -140,9 +142,12 @@ echo -ne "
------------------------------------------------------------------------ ------------------------------------------------------------------------
" "
} }
# === This function will handle file systems. At this movement we are handling only ===
# === btrfs and ext4. Others will be added in future. ===
filesystem () { filesystem () {
# This function will handle file systems. At this movement we are handling only clear
# btrfs and ext4. Others will be added in future. logo
echo -ne " echo -ne "
Please Select your file system for both boot and root Please Select your file system for both boot and root
" "
@ -173,8 +178,11 @@ done
*) echo "Wrong option please select again"; filesystem;; *) echo "Wrong option please select again"; filesystem;;
esac esac
} }
# === Added this from arch wiki https://wiki.archlinux.org/title/System_time ===
timezone () { timezone () {
# Added this from arch wiki https://wiki.archlinux.org/title/System_time clear
logo
time_zone="$(curl --fail https://ipapi.co/timezone)" time_zone="$(curl --fail https://ipapi.co/timezone)"
echo -ne " echo -ne "
System detected your timezone to be '$time_zone' \n" System detected your timezone to be '$time_zone' \n"
@ -195,7 +203,11 @@ case ${options[$?]} in
*) echo "Wrong option. Try again";timezone;; *) echo "Wrong option. Try again";timezone;;
esac esac
} }
# === To select the keymap
keymap () { keymap () {
clear
logo
echo -ne " echo -ne "
Please select key board layout from this list" Please select key board layout from this list"
# These are default key maps as presented in official arch repo archinstall # These are default key maps as presented in official arch repo archinstall
@ -208,6 +220,7 @@ echo -ne "Your key boards layout: ${keymap} \n"
set_option KEYMAP $keymap set_option KEYMAP $keymap
} }
# === Select if the drive is an ssd or not===
drivessd () { drivessd () {
echo -ne " echo -ne "
Is this an ssd? yes/no: Is this an ssd? yes/no:
@ -225,15 +238,16 @@ case ${options[$?]} in
esac esac
} }
# selection for disk type # === selection for disk type ===
diskpart () { diskpart () {
clear
logo
echo -ne " echo -ne "
------------------------------------------------------------------------ ------------------------------------------------------------------------
THIS WILL FORMAT AND DELETE ALL DATA ON THE DISK THIS WILL FORMAT AND DELETE ALL DATA ON THE DISK
Please make sure you know what you are doing because Please make sure you know what you are doing because
after formating your disk there is no way to get data back after formating your disk there is no way to get data back
------------------------------------------------------------------------ ------------------------------------------------------------------------
" "
PS3=' PS3='
@ -248,15 +262,18 @@ echo -e "\n${disk%|*} selected \n"
drivessd drivessd
} }
# === select userinfo ===
userinfo () { userinfo () {
clear
logo
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
while true; do while true; do
echo -ne "Please enter your password: \n" read -s -p "Please enter your password: " password # read password without echo
read -s password # read password without echo echo ""
read -s -p "Please repeat your password: " password2 # read password without echo
echo -ne "Please repeat your password: \n" echo ""
read -s password2 # read password without echo
if [ "$password" = "$password2" ]; then if [ "$password" = "$password2" ]; then
set_option PASSWORD $password set_option PASSWORD $password
@ -269,8 +286,40 @@ read -rep "Please enter your hostname: " nameofmachine
set_option NAME_OF_MACHINE $nameofmachine set_option NAME_OF_MACHINE $nameofmachine
} }
# === install grub or not ===
grubInstall () {
echo -ne "Install grub?:\n"
options=("Yes" "No")
select_option $? 1 "${options[@]}"
grub_install=${options[$?]}
set_option GRUB_INSTALL $grub_install
}
# === select grub theme ===
grubTheme () {
echo -ne "Select your grub theme:\n"
options=(cyberRE none)
select_option $? 4 "${options[@]}"
grub_theme=${options[$?]}
set_option GRUB_THEME $grub_theme
}
# === show all the grub options ===
grubOptions () {
clear
logo
grubInstall
if [[ "$grub_install" == "yes" ]]; then
grubTheme
else
set_option GRUB_THEME none
fi
}
# === Let the user choose AUR helper from predefined list ===
aurhelper () { aurhelper () {
# Let the user choose AUR helper from predefined list clear
logo
echo -ne "Please enter your desired AUR helper:\n" echo -ne "Please enter your desired AUR helper:\n"
options=(paru yay picaur aura trizen pacaur none) options=(paru yay picaur aura trizen pacaur none)
select_option $? 4 "${options[@]}" select_option $? 4 "${options[@]}"
@ -278,8 +327,10 @@ aurhelper () {
set_option AUR_HELPER $aur_helper set_option AUR_HELPER $aur_helper
} }
# === Let the user choose Desktop Enviroment from predefined list ===
desktopenv () { desktopenv () {
# Let the user choose Desktop Enviroment from predefined list clear
logo
echo -ne "Please select your desired Desktop Enviroment:\n" echo -ne "Please select your desired Desktop Enviroment:\n"
options=(gnome kde cinnamon xfce mate budgie lxde deepin openbox server) options=(gnome kde cinnamon xfce mate budgie lxde deepin openbox server)
select_option $? 4 "${options[@]}" select_option $? 4 "${options[@]}"
@ -287,7 +338,10 @@ desktopenv () {
set_option DESKTOP_ENV $desktop_env set_option DESKTOP_ENV $desktop_env
} }
# === select installation type ===
installtype () { installtype () {
clear
logo
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
Minimal Install: Installs only apps few selected apps to get you started\n" Minimal Install: Installs only apps few selected apps to get you started\n"
@ -297,36 +351,24 @@ installtype () {
set_option INSTALL_TYPE $install_type set_option INSTALL_TYPE $install_type
} }
# More features in future # === More features in future ===
# language (){} # language (){}
# Starting functions # === setup basic options for server installation ===
clear
logo
userinfo userinfo
clear grubOptions
logo
desktopenv desktopenv
# Set fixed options that installation uses if user choses server installation
set_option INSTALL_TYPE MINIMAL set_option INSTALL_TYPE MINIMAL
set_option AUR_HELPER NONE
# === configure extra options for DE installation ===
if [[ ! $desktop_env == server ]]; then if [[ ! $desktop_env == server ]]; then
clear aurhelper
logo
aurhelper
clear
logo
installtype installtype
fi fi
clear
logo # === more basic options ===
diskpart diskpart
clear
logo
filesystem filesystem
clear
logo
timezone timezone
clear keymap
logo
keymap