To reduce the pain of installing Arch, I just put all usual commands with slight modification in a file and put #!/bin/bash
on top. Here's how it looks like:
#!/bin/bash
pacman -Sy reflector --noconfirm
timedatectl set-ntp true
parted --script /dev/sda \
mklabel msdos \
mkpart primary ext4 1MiB 10GiB \
set 1 boot on \
mkpart primary ext4 10GiB 100%
mkfs.ext4 -F /dev/sda1
mkfs.ext4 -F /dev/sda2
mount /dev/sda1 /mnt
reflector --country Bangladesh --country 'United States' --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
pacstrap /mnt base
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Asia/Dhaka /etc/localtime
hwclock --systohc
sed -i -e 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
echo 'haque' > /etc/hostname
echo '127.0.0.1 localhost
::1 localhost
127.0.1.1 haque.localdomain haque' >> /etc/hosts
pacman -S base-devel grub bash-completion sddm plasma-desktop plasma-nm plasma-pa konsole kwrite dolphin breeze-gtk kde-gtk-config falkon sudo --noconfirm
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
echo '[Theme]
Current=breeze' >> /etc/sddm.conf
sed -i -e 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
echo 'Set root password'
passwd
echo 'Set Username'
read name
useradd -m $name
echo "Set password for $name"
passwd $name
usermod -aG wheel,audio,video,optical,storage $name
systemctl enable sddm NetworkManager
echo 'Setup Complete!'
exit
as soon as it hits
arch-chroot /mnt
execution stops! Can I do it with a single script? or I've to split the script into two and execute second script with rest of the commands in chroot
?
arch-chroot chroot-dir [command]
. So how aboutarch-chroot /mnt another_script.sh
.another_script.sh
contains the rest of the command in chroot environment. – Biswapriyo Sep 15 '19 at 07:32