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.

Revisions

  1. fanfan54old revised this gist Feb 28, 2020. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions arch_install_script_ap20xps_chroot.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,12 @@
    #!/bin/bash

    echo "[i] Welcome to chroot script"
    # 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
    @@ -54,7 +60,7 @@ 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/1f922e58e0ffce59e7fa5431d033e33fa49ba69d/arch_install_script_ap20xps_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"
  2. fanfan54old revised this gist Feb 28, 2020. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions arch_install_script_ap20xps_chroot.sh
    Original file line number Diff line number Diff line change
    @@ -23,6 +23,9 @@ 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

    @@ -39,10 +42,16 @@ 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/1f922e58e0ffce59e7fa5431d033e33fa49ba69d/arch_install_script_ap20xps_grub
  3. fanfan54old revised this gist Feb 26, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions arch_install_script_ap20xps_chroot.sh
    Original file line number Diff line number Diff line change
    @@ -48,6 +48,9 @@ rm -f /etc/default/grub
    wget -qO/etc/default/grub https://gist.github.com/fanfan54/24cad8368ad4b39bd86e24a8f1a23309/raw/1f922e58e0ffce59e7fa5431d033e33fa49ba69d/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

  4. fanfan54old revised this gist Feb 26, 2020. 1 changed file with 14 additions and 4 deletions.
    18 changes: 14 additions & 4 deletions arch_install_script_ap20xps_chroot.sh
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,7 @@ 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"
    @@ -40,13 +41,22 @@ mkinitcpio -p linux

    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=arch_grub --recheck


    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck

    echo "> Acquiring the custom GRUB config..."
    rm -f /etc/default/grub
    wget -qO/etc/default/grub https://gist.github.com/fanfan54/24cad8368ad4b39bd86e24a8f1a23309/raw/1f922e58e0ffce59e7fa5431d033e33fa49ba69d/arch_install_script_ap20xps_grub
    chmod 644 /etc/default/grub

    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
  5. fanfan54old created this gist Feb 26, 2020.
    52 changes: 52 additions & 0 deletions arch_install_script_ap20xps_chroot.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    #!/bin/bash

    echo "[i] Welcome to 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 "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 "> 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 "> 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=arch_grub --recheck





    echo "> Setting root password [i] ENTER IT"