<commit_before>#!/bin/bash
#-------------------------------------------------------
#LOCALE OPTIONS WHICH WILL BE SET MANUALLY BY THE USER |
#-------------------------------------------------------

#TIMEZONE; you can find yours with 'tzselect'
ZONE="Europe"
SUBZONE="Zurich"

#KEYMAP; 'localectl list-keymaps' lists all available options
KEYMAP="de_CH-latin1"

#DON'T CHANGE ANYTHING BELOW THE LINE
#-------------------------------------------------------------------------------

#-----------------
#MAIN INFORMATION|
#-----------------
echo -e "Before you get started here are a few notes.\n* WLAN is not yet supported during the installation.\n* Make sure that the hard drive is clean / wiped.\nhave fun!"
read -p "root (/) volume size (e.g 20G): " ROOT
read -p "Swap volume size (e.g 4G) [empty = auto]: " RAM
read -p "mbr (BIOS) or gpt (UEFI)?: " PART_TABLE
read -p "Hostname: " HOSTNAME
if [[ -z "$RAM" ]]; then
  RAM=$(free -h|awk '/^Mem:/{print $2}')
fi

#--------------
#PARTITIONING |
#--------------
if [[ "$PART_TABLE" = "gpt" ]]; then
  parted /dev/sda <<EOF
  mklabel gpt
  mkpart ESP 1MiB 513MiB
  set 1 boot on
  mkpart primary 513MiB 100%
EOF
  mkfs.vfat -F32 /dev/sda1
elif [[ "$PART_TABLE" = "mbr" ]]; then
  parted /dev/sda <<EOF
  mklabel msdos
  mkpart primary 1MiB 513MiB
  set 1 boot on
  mkpart primary 513MiB 100%
EOF
  mkfs.ext2 /dev/sda1
  else
    echo "False Partition table (only mbr or gpt)"
    exit 1
fi

#--------------------
#ENCRYPTION AND LVM |
#--------------------
echo -e "First type \"YES\" and then enter the chosen password for /dev/sda2 twice and once to unlock."
cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random luksFormat /dev/sda2
cryptsetup open --type luks /dev/sda2 lvm
pvcreate /dev/mapper/lvm
vgcreate archlinux /dev/mapper/lvm

lvcreate -L "$RAM" archlinux -n swapvol
lvcreate -L "$ROOT" archlinux -n rootvol
lvcreate -l +100%FREE archlinux -n homevol

mkfs.ext4 /dev/mapper/archlinux-rootvol
mkfs.ext4 /dev/mapper/archlinux-homevol
mkswap /dev/mapper/archlinux-swapvol

mount /dev/archlinux/rootvol /mnt
mkdir /mnt/home
mount /dev/archlinux/homevol /mnt/home
swapon /dev/archlinux/swapvol

mkdir /mnt/boot
mount /dev/sda1 /mnt/boot<commit_msg>set root and home volume to xfs<commit_after>#!/bin/bash
#-------------------------------------------------------
#LOCALE OPTIONS WHICH WILL BE SET MANUALLY BY THE USER |
#-------------------------------------------------------

#TIMEZONE; you can find yours with 'tzselect'
ZONE="Europe"
SUBZONE="Zurich"

#KEYMAP; 'localectl list-keymaps' lists all available options
KEYMAP="de_CH-latin1"

#DON'T CHANGE ANYTHING BELOW THE LINE
#-------------------------------------------------------------------------------

#-----------------
#MAIN INFORMATION|
#-----------------
echo -e "Before you get started here are a few notes.\n* WLAN is not yet supported during the installation.\n* Make sure that the hard drive is clean / wiped.\nhave fun!"
read -p "root (/) volume size (e.g 20G): " ROOT
read -p "Swap volume size (e.g 4G) [empty = auto]: " RAM
read -p "mbr (BIOS) or gpt (UEFI)?: " PART_TABLE
read -p "Hostname: " HOSTNAME
if [[ -z "$RAM" ]]; then
  RAM=$(free -h|awk '/^Mem:/{print $2}')
fi

#--------------
#PARTITIONING |
#--------------
if [[ "$PART_TABLE" = "gpt" ]]; then
  parted /dev/sda <<EOF
  mklabel gpt
  mkpart ESP 1MiB 513MiB
  set 1 boot on
  mkpart primary 513MiB 100%
EOF
  mkfs.vfat -F32 /dev/sda1
elif [[ "$PART_TABLE" = "mbr" ]]; then
  parted /dev/sda <<EOF
  mklabel msdos
  mkpart primary 1MiB 513MiB
  set 1 boot on
  mkpart primary 513MiB 100%
EOF
  mkfs.ext4 /dev/sda1
  else
    echo "False Partition table (only mbr or gpt)"
    exit 1
fi

#--------------------
#ENCRYPTION AND LVM |
#--------------------
echo -e "First type \"YES\" and then enter the chosen password for /dev/sda2 twice and once to unlock."
cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random luksFormat /dev/sda2
cryptsetup open --type luks /dev/sda2 lvm
pvcreate /dev/mapper/lvm
vgcreate archlinux /dev/mapper/lvm

lvcreate -L "$RAM" archlinux -n swapvol
lvcreate -L "$ROOT" archlinux -n rootvol
lvcreate -l +100%FREE archlinux -n homevol

mkfs.xfs /dev/mapper/archlinux-rootvol
mkfs.xfs /dev/mapper/archlinux-homevol
mkswap /dev/mapper/archlinux-swapvol

mount /dev/archlinux/rootvol /mnt
mkdir /mnt/home
mount /dev/archlinux/homevol /mnt/home
swapon /dev/archlinux/swapvol

mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
{'fraction_non_alphanumeric': 0.23714539007092197, 'fraction_numerical': 0.02349290780141844, 'mean_word_length': 2.11456176673568, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '163425', 'n_tokens_mistral': 1674, 'n_tokens_neox': 1543, 'n_words': 505}