-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchroot_script.sh
73 lines (53 loc) · 1.57 KB
/
chroot_script.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
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
source ./config.sh
# Installing some useful packages
pacman nano
# Time zone
echo "Setting time zone"
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
echo "Generating /etc/adjtime"
hwclock --systohc
# Localization
echo "Generating locales"
sed -i 's/#de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
locale-gen
# Creating locale.conf
localectl set-locale LANG=de_DE.UTF-8
# Keyboard layout
echo KEYMAP=$KEYMAP > /etc/vconsole.conf
# Network configuration
# Hostname file
echo $HOSTNAME > /etc/hostname
# Hosts
cat << EOF >> /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 $HOSTNAME.localdomain $HOSTNAME
EOF
# echo "$password" | passwd "$username" --stdin for automated password input
# PASS_HASH=$(echo "hunter2" | openssl passwd -6 -stdin)
# chpasswd -e <<< "your_username:$PASS_HASH"
# Root password (user input)
echo "Enter root password"
passwd
# Adding user
useradd -m $USER
echo "Enter user password"
passwd $USER
# Assing user to groups
usermod -aG wheel,audio,video,optical,storage $USER
# Installing some packages
# Configuring sudo
pacman -S sudo
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
# Downloading and installing GRUB
echo "Installing GRUB"
pacman -S grub efibootmgr dosfstools os-prober mtools
mkdir /boot/EFI
mount /dev/sda1 /boot/EFI
grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
grub-mkconfig -o /boot/grub/grub.cfg
# Post-installation
pacman -S networkmanager nano git
systemctl enable NetworkManager