<commit_before>#!/usr/bin/env bash

set -e

source ./999-print-functions.sh
boot_type=$([ -d /sys/firmware/efi ] && echo UEFI || echo BIOS)

clear
print_multiline_message "Beginning $boot_type installation" "output is captured in the file 'install.log'"
print_multiline_message "$(date +%d-%m-%Y---%H:%M:%S)" "Core install started" >> install.log

loadkeys us

print_message "Available devices"
lsblk
printf "\n"
read -p "Enter the device to use: " DEVICE_ID

if [[ "$boot_type" == "UEFI" ]]
then
    gdisk $DEVICE_ID
else
    cfdisk $DEVICE_ID
fi

clear
print_message "Formatting file systems"

if [[ "$boot_type" == "UEFI" ]]
then
    mkfs.vfat "${DEVICE_ID}1" >> install.log 

    mkswap "${DEVICE_ID}2" >> install.log
    swapon "${DEVICE_ID}2"

    mkfs.ext4 "${DEVICE_ID}3" >> install.log
    mkfs.ext4 "${DEVICE_ID}4" >> install.log
    mkfs.ext4 "${DEVICE_ID}5" >> install.log   
else
    mkswap "${DEVICE_ID}1" >> install.log
    swapon "${DEVICE_ID}1"

    mkfs.ext4 "${DEVICE_ID}2" >> install.log
    mkfs.ext4 "${DEVICE_ID}3" >> install.log
    mkfs.ext4 "${DEVICE_ID}4" >> install.log
fi

print_message "Mounting file systems"

if [[ "$boot_type" == "UEFI" ]]
then
    mount "${DEVICE_ID}3" /mnt
    mkdir /mnt/boot
    mount "${DEVICE_ID}1" /mnt/boot
    mkdir /mnt/var
    mount "${DEVICE_ID}4" /mnt/var
    mkdir /mnt/home
    mount "${DEVICE_ID}5" /mnt/home    
else
    mount "${DEVICE_ID}2" /mnt
    mkdir /mnt/var
    mount "${DEVICE_ID}3" /mnt/var
    mkdir /mnt/home
    mount "${DEVICE_ID}4" /mnt/home
fi

print_message "Complete"

clear
print_message "Installing base system"

pacstrap /mnt base base-devel >> install.log
genfstab -U /mnt >> /mnt/etc/fstab

print_message "Complete"

mv 020-configuring-core.sh /mnt
mv install.log /mnt/home
arch-chroot /mnt ./020-configuring-core.sh
clear
print_message "Cleaning up"
print_multiline_message "$(date +%d-%m-%Y---%H:%M:%S)" "Finished, rebooting system" >> /mnt/home/install.log
rm /mnt/020-configuring-core.sh
print_message "Complete"

clear
print_message "Rebooting, please wait..."
sleep 10

reboot<commit_msg>Fixed missing file after chroot<commit_after>#!/usr/bin/env bash

set -e

source ./999-print-functions.sh
boot_type=$([ -d /sys/firmware/efi ] && echo UEFI || echo BIOS)

clear
print_multiline_message "Beginning $boot_type installation" "output is captured in the file 'install.log'"
print_multiline_message "$(date +%d-%m-%Y---%H:%M:%S)" "Core install started" >> install.log

loadkeys us

print_message "Available devices"
lsblk
printf "\n"
read -p "Enter the device to use: " DEVICE_ID

if [[ "$boot_type" == "UEFI" ]]
then
    gdisk $DEVICE_ID
else
    cfdisk $DEVICE_ID
fi

clear
print_message "Formatting file systems"

if [[ "$boot_type" == "UEFI" ]]
then
    mkfs.vfat "${DEVICE_ID}1" >> install.log 

    mkswap "${DEVICE_ID}2" >> install.log
    swapon "${DEVICE_ID}2"

    mkfs.ext4 "${DEVICE_ID}3" >> install.log
    mkfs.ext4 "${DEVICE_ID}4" >> install.log
    mkfs.ext4 "${DEVICE_ID}5" >> install.log   
else
    mkswap "${DEVICE_ID}1" >> install.log
    swapon "${DEVICE_ID}1"

    mkfs.ext4 "${DEVICE_ID}2" >> install.log
    mkfs.ext4 "${DEVICE_ID}3" >> install.log
    mkfs.ext4 "${DEVICE_ID}4" >> install.log
fi

print_message "Mounting file systems"

if [[ "$boot_type" == "UEFI" ]]
then
    mount "${DEVICE_ID}3" /mnt
    mkdir /mnt/boot
    mount "${DEVICE_ID}1" /mnt/boot
    mkdir /mnt/var
    mount "${DEVICE_ID}4" /mnt/var
    mkdir /mnt/home
    mount "${DEVICE_ID}5" /mnt/home    
else
    mount "${DEVICE_ID}2" /mnt
    mkdir /mnt/var
    mount "${DEVICE_ID}3" /mnt/var
    mkdir /mnt/home
    mount "${DEVICE_ID}4" /mnt/home
fi

print_message "Complete"

clear
print_message "Installing base system"

pacstrap /mnt base base-devel >> install.log
genfstab -U /mnt >> /mnt/etc/fstab

print_message "Complete"

cp 020-configuring-core.sh /mnt
cp 999-print-functions.sh /mnt
mv install.log /mnt/home
arch-chroot /mnt ./020-configuring-core.sh
clear
print_message "Cleaning up"
print_multiline_message "$(date +%d-%m-%Y---%H:%M:%S)" "Finished, rebooting system" >> /mnt/home/install.log
rm /mnt/020-configuring-core.sh
rm /mnt/999-print-functions.sh
print_message "Complete"

clear
print_message "Rebooting, please wait..."
sleep 10

reboot
{'fraction_non_alphanumeric': 0.15694117647058822, 'fraction_numerical': 0.019294117647058823, 'mean_word_length': 3.6972375690607735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5028225', 'n_tokens_mistral': 1676, 'n_tokens_neox': 1612, 'n_words': 390}