1
0
mirror of https://github.com/tommytran732/Arch-Setup-Script synced 2024-11-24 10:31:34 -05:00

Compare commits

..

No commits in common. "f82897b299ed90de9a7a5ecd47d5dd45110480aa" and "9f56c5b0e2857e7523b685eaef764ee5044b8809" have entirely different histories.

View File

@ -87,7 +87,7 @@ luks_password_prompt () {
disk_prompt (){ disk_prompt (){
lsblk lsblk
output 'Please select the number of the corresponding disk (e.g. 1):' output 'Please select the number of the corresponding disk (e.g. 1):'
select entry in $(lsblk -dpnoNAME|grep -P "/dev/nvme|sd|mmcblk|vd"); select entry in $(lsblk -dpnoNAME|grep -P "/dev/sd|nvme|vd");
do do
disk="${entry}" disk="${entry}"
output "Arch Linux will be installed on the following disk: ${disk}" output "Arch Linux will be installed on the following disk: ${disk}"
@ -96,25 +96,15 @@ disk_prompt (){
} }
username_prompt (){ username_prompt (){
output 'Please enter the name for a user account:' output 'Enter your username:'
read -r username read -r username
if [ -z "${username}" ]; then if [ -z "${username}" ]; then
output 'Sorry, You need to enter a username.' output 'You need to enter a username.'
username_prompt username_prompt
fi fi
} }
fullname_prompt (){
output 'Please enter the full name for the user account:'
read -r fullname
if [ -z "${fullname}" ]; then
output 'Please enter the full name of the users account.'
fullname_prompt
fi
}
user_password_prompt () { user_password_prompt () {
output 'Enter your user password (the password will not be shown on the screen):' output 'Enter your user password (the password will not be shown on the screen):'
read -r -s user_password read -r -s user_password
@ -179,7 +169,6 @@ luks_prompt
luks_password_prompt luks_password_prompt
disk_prompt disk_prompt
username_prompt username_prompt
fullname_prompt
user_password_prompt user_password_prompt
hostname_prompt hostname_prompt
network_daemon_prompt network_daemon_prompt
@ -458,7 +447,6 @@ fi
## Setup NTS ## Setup NTS
unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/chrony.conf | tee /mnt/etc/chrony.conf > /dev/null unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/chrony.conf | tee /mnt/etc/chrony.conf > /dev/null
mkdir -p /mnt/etc/sysconfig
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/sysconfig/chronyd | tee /mnt/etc/sysconfig/chronyd > /dev/null unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/sysconfig/chronyd | tee /mnt/etc/sysconfig/chronyd > /dev/null
## Remove nullok from system-auth ## Remove nullok from system-auth
@ -474,7 +462,6 @@ mkdir -p /mnt/etc/systemd/system/sshd.service.d/
unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/systemd/system/sshd.service.d/local.conf | tee /mnt/etc/systemd/system/sshd.service.d/override.conf > /dev/null unpriv curl -s https://raw.githubusercontent.com/GrapheneOS/infrastructure/main/systemd/system/sshd.service.d/local.conf | tee /mnt/etc/systemd/system/sshd.service.d/override.conf > /dev/null
## Disable coredump ## Disable coredump
mkdir -p /mnt/etc/security/limits.d/
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/security/limits.d/30-disable-coredump.conf | tee /mnt/etc/security/limits.d/30-disable-coredump.conf > /dev/null unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/security/limits.d/30-disable-coredump.conf | tee /mnt/etc/security/limits.d/30-disable-coredump.conf > /dev/null
mkdir -p /mnt/etc/systemd/coredump.conf.d mkdir -p /mnt/etc/systemd/coredump.conf.d
unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/systemd/coredump.conf.d/disable.conf | tee /mnt/etc/systemd/coredump.conf.d/disable.conf > /dev/null unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/systemd/coredump.conf.d/disable.conf | tee /mnt/etc/systemd/coredump.conf.d/disable.conf > /dev/null
@ -557,14 +544,18 @@ arch-chroot /mnt /bin/bash -e <<EOF
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
# Adding user with sudo privilege # Adding user with sudo privilege
useradd -c "$fullname" -m "$username" useradd -m $username
usermod -aG wheel "$username" usermod -aG wheel $username
if [ "${install_mode}" = 'desktop' ]; then if [ "${install_mode}" = 'desktop' ]; then
# Setting up dconf # Setting up dconf
dconf update dconf update
fi fi
# Use systemd-resolved for DNS resolution
rm /etc/resolv.conf
ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
# Snapper configuration # Snapper configuration
umount /.snapshots umount /.snapshots
rm -r /.snapshots rm -r /.snapshots
@ -601,8 +592,6 @@ fi
if [ "${install_mode}" = 'desktop' ]; then if [ "${install_mode}" = 'desktop' ]; then
systemctl enable gdm --root=/mnt systemctl enable gdm --root=/mnt
rm /mnt/etc/resolv.conf
ln -s /run/systemd/resolve/stub-resolv.conf /mnt/etc/resolv.conf
systemctl enable systemd-resolved --root=/mnt systemctl enable systemd-resolved --root=/mnt
fi fi