#!/bin/bash set -e DISK="/dev/nvme1n1" HOSTNAME="arch" USERNAME="hacker" PASSWORD="123456" TIMEZONE="America/Sao_Paulo" LOCALE="pt_BR.UTF-8" timedatectl set-ntp true echo ">>> Particionando disco" sgdisk --zap-all $DISK sgdisk -n 1:0:+512M -t 1:ef00 $DISK sgdisk -n 2:0:0 -t 2:8300 $DISK echo ">>> Formatando" mkfs.fat -F32 ${DISK}p1 mkfs.ext4 -F ${DISK}p2 echo ">>> Montando" mount ${DISK}p2 /mnt mkdir /mnt/boot mount ${DISK}p1 /mnt/boot echo ">>> Instalando base" pacstrap /mnt base linux linux-firmware nano sudo networkmanager grub efibootmgr genfstab -U /mnt >> /mnt/etc/fstab arch-chroot /mnt /bin/bash < /etc/locale.conf echo "$HOSTNAME" > /etc/hostname cat < /etc/hosts 127.0.0.1 localhost ::1 localhost 127.0.1.1 $HOSTNAME EOL echo "root:$PASSWORD" | chpasswd useradd -m -G wheel $USERNAME echo "$USERNAME:$PASSWORD" | chpasswd sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers systemctl enable NetworkManager grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=ArchNVMe grub-mkconfig -o /boot/grub/grub.cfg EOF umount -R /mnt echo "=== FIM — REINICIE ==="