-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchroot.sh
More file actions
executable file
·30 lines (22 loc) · 877 Bytes
/
chroot.sh
File metadata and controls
executable file
·30 lines (22 loc) · 877 Bytes
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
#!/bin/bash
set -e
ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime
hwclock --systohc
sed -i -e 's/#en_CA.UTF-8 UTF-8/en_CA.UTF-8 UTF-8/g' /etc/locale.gen
locale-gen
echo "LANG=en_CA.UTF-8" > /etc/locale.conf
read -p "Enter your hostname: " MY_HOSTNAME
echo $MY_HOSTNAME > /etc/hostname
echo "127.0.0.1 localhost" >> /etc/hosts
echo "::1 localhost" >> /etc/hosts
echo "127.0.1.1 $MY_HOSTNAME.localdomain $MY_HOSTNAME" >> /etc/hosts
echo "Enter root password"
passwd
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
read -p "Enter your username: " MY_USERNAME
useradd -m $MY_USERNAME
passwd $MY_USERNAME
sed -i -e 's/# Defaults targetpw/Defaults targetpw/g' /etc/sudoers
sed -i -e 's/# ALL ALL=(ALL:ALL) ALL/ALL ALL=(ALL:ALL) ALL/g' /etc/sudoers
systemctl enable NetworkManager.service