Skip to content

Instantly share code, notes, and snippets.

@fanfan54old
Last active February 28, 2020 10:37
Show Gist options
  • Select an option

  • Save fanfan54old/8fec2cd13bf7d992f7c064d5d0381ec5 to your computer and use it in GitHub Desktop.

Select an option

Save fanfan54old/8fec2cd13bf7d992f7c064d5d0381ec5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Author: fanfan54 (https://gist.github.com/fanfan54/8fec2cd13bf7d992f7c064d5d0381ec5)
# Licensed under the GNU GPL v3.0 license
# Version 6 (first working version)
# TODO Add sources for all the commands
echo "[i] Starting the chroot script"
echo "> Linking /hostlvm to /run/lvm..."
ln -s /hostlvm /run/lvm
echo "> Setting the persistant timezone to Europe/Paris..."
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
echo "> Setting vconsole.conf"
echo "KEYMAP=fr-latin9" > /etc/vconsole.conf
echo "FONT=eurlatgr" >> /etc/vconsole.conf
echo "> Setting locale.conf"
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "LANGUAGE=en_US" >> /etc/locale.conf
echo "LC_COLLATE=C" >> /etc/locale.conf
echo "> Setting locale.gen"
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
echo "> locale-gen"
locale-gen
echo "[i] Done locale gen, sleeping for 10 seconds"
sleep 10
echo "> hostname"
echo "ap20xps" > /etc/hostname
echo "> /etc/hosts"
echo "127.0.0.1 localhost" > /etc/hosts
echo "127.0.1.1 ap20xps.home ap20xps" >> /etc/hosts
echo "# The following lines are desirable for IPv6 capable hosts" >> /etc/hosts
echo "::1 ip6-localhost ip6-loopback" >> /etc/hosts
echo "fe00::0 ip6-localnet" >> /etc/hosts
echo "ff00::0 ip6-mcastprefix" >> /etc/hosts
echo "ff02::1 ip6-allnodes" >> /etc/hosts
echo "ff02::2 ip6-allrouters" >> /etc/hosts
echo "> mkinitcpio"
mkinitcpio -p linux
echo "[i] Done mkinitcpio, sleeping for 10 seconds"
sleep 10
echo "> grub install"
mount | grep efivars &> /dev/null || mount -t efivarfs efivarfs /sys/firmware/efi/efivars
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck
echo "[i] GRUB installed, sleeping for 10 seconds"
sleep 10
echo "> Acquiring the custom GRUB config..."
rm -f /etc/default/grub
wget -qO/etc/default/grub https://gist.github.com/fanfan54/24cad8368ad4b39bd86e24a8f1a23309/raw/c5de9c87bda76871ddb08b4f4372e5f600d9413d/arch_install_script_ap20xps_grub
chmod 644 /etc/default/grub
echo "> intel microcode"
pacman -S intel-ucode
echo "> grub-mkconfig"
grub-mkconfig -o /boot/grub/grub.cfg
echo "> Setting root password [i] ENTER IT"
passwd root
echo "> Installing NetworkManager"
pacman -Syy networkmanager
systemctl enable NetworkManager
echo "[i] Done. Going back to arch iso..."
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment