-
Notifications
You must be signed in to change notification settings - Fork 1
/
3_install_system.sh
executable file
·63 lines (51 loc) · 2.02 KB
/
3_install_system.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#* clear screen
clear
#! make this part interactive for sure :)
#* variables that should be edited
MACHINE_NAME='machinename'
ROOT_PASSWORD='password'
USER_NAME='username'
USER_PASSWORD='password'
#* setting time
ln -sf /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
hwclock --systohc
#* generating locales and setting up the host information
#? use sed to uncomment line instead of appending a new one
#sed '/en_US.UTF-8/s/^#//' -i /etc/locale.gen
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
echo "${MACHINE_NAME}" >> /etc/hostname
echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 ${MACHINE_NAME}.localdomain ${MACHINE_NAME}" >> /etc/hosts
echo root:${ROOT_PASSWORD} | chpasswd
#* set up the pacman configuration
rm /etc/pacman.conf
wget --directory-prefix /etc/ https://raw.githubusercontent.com/Hibrit/archlinuxsettings/master/pacman/pacman.conf
pacman -Syy
#* installing essential packages
pacman -S --needed --noconfirm grub efibootmgr networkmanager network-manager-applet wireless_tools wpa_supplicant dialog mtools dosfstools base-devel linux-headers reflector openssh xdg-user-dirs tldr #os-prober ntfs-3g
#! install grub !!!THIS IS FOR UEFI USAGE ONLY!!!
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
#! if installing to a legacy system use this installation type instead
#! remember to change /dev/sdX path to drive
# grub-install --target=i386-pc /dev/sdX
grub-mkconfig -o /boot/grub/grub.cfg
systemctl enable NetworkManager
#* adding user
useradd -mG wheel ${USER_NAME}
echo ${USER_NAME}:${USER_PASSWORD} | chpasswd
#* informing about suders file and going into edit mode
echo
echo 'please uncomment the relevant wheel line from sudoers file'
echo
sleep 3
EDITOR=vim visudo
mkdir /home/${USER_NAME}/Documents
cp -r /ais /home/${USER_NAME}/Documents/ais
chown -R ${USER_NAME}:${USER_NAME} /home/${USER_NAME}/Documents
echo
echo 'please exit this tty session and proceed with scripts'
echo