diff options
28 files changed, 22 insertions, 1040 deletions
diff --git a/archinstall.sh b/archinstall.sh index 2dfbf9e..47afe7c 100644 --- a/archinstall.sh +++ b/archinstall.sh @@ -28,20 +28,9 @@ ################################################################# -# Settings +# Stop at any error to optimize debugging: -export TESTSERVER="archlinux.org" # IP or hostname -export NETWORK_DEADLINE=1 # in seconds -export REPOSITORY_URL="https://github.com/xengineering/archinstall/" # remote -export REPOSITORY_PATH="/opt/archinstall" # local -export BRANCH_OR_COMMIT="master" # select another branch or commit hash for checkout if needed -export LOG_FILE_PATH="/var/log/archinstall.log" - - -# PATH expansion - -export PATH=$PATH:$REPOSITORY_PATH/stages -export PATH=$PATH:$REPOSITORY_PATH/util +set -e # Greetings @@ -63,45 +52,21 @@ cat << EOF EOF -# Check internet connection - -if ping -w $NETWORK_DEADLINE -c 1 $TESTSERVER; then - echo "Internet connection is ready - OK" - echo "" -else - echo "Could not reach testserver '$TESTSERVER' - FAILED" - exit -fi - - -# Update the system clock - -timedatectl set-ntp true -if [ $? -eq 0 ]; then - echo "Updated system clock - OK" - echo "" -else - echo "Could not update system clock - FAILED" - exit -fi - - -# Cloning Git repository - -echo "Cloning git repository ..." -echo "" - -pacman --noconfirm -Sy git -mkdir $REPOSITORY_PATH -git clone $REPOSITORY_URL $REPOSITORY_PATH -cd $REPOSITORY_PATH -git checkout $BRANCH_OR_COMMIT -cd +# Constants -echo "Git repository cloned - OK" -echo "" +export INTERNET_TEST_SERVER="archlinux.org" +export INTERNET_TEST_PING_TIMEOUT=1 # seconds +export FIRST_STAGE_LINK="" +export SECOND_STAGE_LINK="" +export PACKAGE_LIST="base linux linux-firmware nano networkmanager" +export DEFAULT_PASSWORD="archinstall" -# Launching first stage +# Variables -bash first_stage.sh | tee -a $LOG_FILE_PATH +export boot_mode="unknown" # alternatives: "bios" or "uefi" +export luks_encryption="unknown" # alternatives: "yes" or "no" +export path_to_timezone="/usr/share/zoneinfo/Europe/Berlin" +export locales_to_generate="de_DE.UTF-8 UTF-8;de_DE ISO-8859-1;de_DE@euro ISO-8859-15" +export keymap="de-latin1" +export hostname="archlinux" # will be set to a user-chosen hostname diff --git a/stages/first_stage.sh b/stages/first_stage.sh index cdf661e..fe5e1bb 100644 --- a/stages/first_stage.sh +++ b/stages/first_stage.sh @@ -18,79 +18,9 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. -echo "Entering first_stage.sh - OK" - - -# Settings - -export CONFIG_FILE_PATH="/etc/archinstall/config.json" -export DEFAULT_PASSWORD="archinstall" - - -# Write config - -mkdir $(dirname "$CONFIG_FILE_PATH") -touch $CONFIG_FILE_PATH -python -u $REPOSITORY_PATH/util/write_config.py $CONFIG_FILE_PATH - - -# Reading config values to bash - -export disk=$(python -u $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "disk") -export disk_path=/dev/$disk -export hostname=$(python -u $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "hostname") -export desktop=$(python -u $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "desktop") -export admin_username=$(python -u $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "admin_username") -export system_encryption=$(python -u $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "system_encryption") - - -bash confirm_installation.sh $disk +# Stop at any error to optimize debugging: -if [ "$(bash check_bootmode.sh)" == "Booted with UEFI" ];then - echo "Booted with UEFI - OK" - export boot_mode="UEFI" - export efi_partition_path="${disk_path}1" - export boot_partition_path="${disk_path}2" - export main_partition_path="${disk_path}3" -elif [ "$(bash check_bootmode.sh)" == "Booted with legacy boot / BIOS" ];then - echo "Booted with BIOS - OK" - export boot_mode="BIOS" - export efi_partition_path="/dev/null" - export boot_partition_path="/dev/null" - export main_partition_path="${disk_path}1" -else - echo "Unknown boot mode - FAILED" - exit -fi +set -e -bash partition_disk.sh $disk_path $boot_mode -if [ $system_encryption == "yes" ];then - bash format_crypto_partition.sh $main_partition_path $DEFAULT_PASSWORD - bash open_crypto_partition.sh $main_partition_path $DEFAULT_PASSWORD - export root_partition_path="/dev/mapper/main" -else - export root_partition_path=$main_partition_path -fi - -bash create_filesystems.sh $efi_partition_path $boot_partition_path $root_partition_path - -bash mount_filesystems.sh $boot_partition_path $root_partition_path - -bash install_packages.sh $desktop - -bash install_archinstall.sh $REPOSITORY_PATH - -bash write_fstab.sh - -echo "bash second_stage.sh" | arch-chroot /mnt - -bash copy_archinstall_log.sh $LOG_FILE_PATH - -bash unmount_filesystems.sh $boot_partition_path $root_partition_path - -if [ $system_encryption == "yes" ];then - bash close_crypto_partition.sh $main_partition_path -fi - -bash print_final_message.sh $DEFAULT_PASSWORD +echo "Entering first_stage.sh - OK" diff --git a/stages/second_stage.sh b/stages/second_stage.sh index 30dc495..abb8ed9 100644 --- a/stages/second_stage.sh +++ b/stages/second_stage.sh @@ -18,21 +18,9 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. -echo "Entering second_stage.sh - OK" - - -bash configure_keyboard.sh de-latin1 - -bash configure_locales.sh +# Stop at any error to optimize debugging: -bash configure_timezone.sh /usr/share/zoneinfo/Europe/Berlin +set -e -bash configure_network.sh $hostname -bash configure_initramfs.sh - -bash configure_users.sh $admin_username $DEFAULT_PASSWORD - -bash install_bootloader.sh $efi_partition_path $system_encryption $main_partition_path $boot_mode - -bash configure_desktop.sh +echo "Entering second_stage.sh - OK" diff --git a/util/check_bootmode.sh b/util/check_bootmode.sh deleted file mode 100644 index 26f929c..0000000 --- a/util/check_bootmode.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -if [ -d "/sys/firmware/efi/efivars" ]; then - echo "Booted with UEFI" -else - echo "Booted with legacy boot / BIOS" -fi diff --git a/util/close_crypto_partition.sh b/util/close_crypto_partition.sh deleted file mode 100644 index de96f6c..0000000 --- a/util/close_crypto_partition.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -cryptsetup close main - -echo "Closed crypto partition - OK" diff --git a/util/configure_desktop.sh b/util/configure_desktop.sh deleted file mode 100644 index c002e70..0000000 --- a/util/configure_desktop.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -systemctl enable lightdm - -cat > /etc/X11/xorg.conf.d/00-keyboard.conf << EOF -# Written by systemd-localed(8), read by systemd-localed and Xorg. It's -# probably wise not to edit this file manually. Use localectl(1) to -# instruct systemd-localed to update it. -Section "InputClass" - Identifier "system-keyboard" - MatchIsKeyboard "on" - Option "XkbLayout" "de" - Option "XkbModel" "pc105" - Option "XkbVariant" "nodeadkeys" -EndSection -EOF - -echo "Configured desktop - OK" diff --git a/util/configure_initramfs.sh b/util/configure_initramfs.sh deleted file mode 100644 index 3222a89..0000000 --- a/util/configure_initramfs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -new_hooks_config_line="HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)" -echo "new_hooks_config_line: $new_hooks_config_line" -old_hooks_config_line=$(cat /etc/mkinitcpio.conf | grep "^HOOKS=") -echo "old_hooks_config_line: $old_hooks_config_line" - -sed -i "s|$old_hooks_config_line|$new_hooks_config_line|" /etc/mkinitcpio.conf - -mkinitcpio -P - - -echo "Configured initramfs - OK" diff --git a/util/configure_keyboard.sh b/util/configure_keyboard.sh deleted file mode 100644 index 9a1a1a3..0000000 --- a/util/configure_keyboard.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -keymap=$1 # e.g. "de-latin1" - - -touch /etc/vconsole.conf -echo "KEYMAP=$keymap" > /etc/vconsole.conf - -echo "Keyboard configuration done - OK" diff --git a/util/configure_locales.sh b/util/configure_locales.sh deleted file mode 100644 index 3488bb7..0000000 --- a/util/configure_locales.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen -echo "de_DE ISO-8859-1" >> /etc/locale.gen -echo "de_DE@euro ISO-8859-15" >> /etc/locale.gen - -locale-gen - -touch /etc/locale.conf -echo "LANG=de_DE.UTF-8" > /etc/locale.conf - -echo "Configured locales - OK" diff --git a/util/configure_network.sh b/util/configure_network.sh deleted file mode 100644 index fd85e36..0000000 --- a/util/configure_network.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -hostname=$1 - - -touch /etc/hostname -echo $hostname > /etc/hostname - -touch /etc/hosts -echo "" >> /etc/hosts -echo "127.0.0.1 localhost" >> /etc/hosts -echo "::1 localhost" >> /etc/hosts - -systemctl enable dhcpcd - -echo "Configured network - OK" diff --git a/util/configure_timezone.sh b/util/configure_timezone.sh deleted file mode 100644 index fce6d99..0000000 --- a/util/configure_timezone.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -timezone=$1 # e.g. /usr/share/zoneinfo/Europe/Berlin - - -ln -sf $timezone /etc/localtime -hwclock --systohc - -echo "Configured timezone - OK" diff --git a/util/configure_users.sh b/util/configure_users.sh deleted file mode 100644 index 4c5f4ea..0000000 --- a/util/configure_users.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -admin_username=$1 -default_password=$2 - - -echo "root:${default_password}" | chpasswd - -useradd -m $admin_username # create user and according home directory -usermod -aG wheel $admin_username # add user to sudo-priviledged wheel group -echo "${admin_username}:${default_password}" | chpasswd - -sed -i '/%wheel ALL=(ALL) ALL/s/^# //g' /etc/sudoers # activate wheel group - # by uncommenting special - # line in sudoers file -passwd -l root # lock the root account - -echo "Configured users - OK" diff --git a/util/confirm_installation.sh b/util/confirm_installation.sh deleted file mode 100644 index 35112dd..0000000 --- a/util/confirm_installation.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -disk=$1 # e.g. sda - - -echo "All data on disk '$disk' will be finally lost!" -echo "Are you SURE that you want to install Arch Linux to '$disk'?!" -echo "Type 'Yes' for installation and 'No' for abort." -read answer -if [ $answer == "Yes" ]; then - echo "" - echo "Confirmed installation - OK" - echo "" -else - echo "" - echo "Abort of installation process!" - exit -fi diff --git a/util/copy_archinstall_config.sh b/util/copy_archinstall_config.sh deleted file mode 100644 index a56a222..0000000 --- a/util/copy_archinstall_config.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -config_file_path=$1 # e.g. "/var/log/archinstall.log" - - -cp $config_file_path /mnt$config_file_path - -echo "Copied archinstall configuration - OK" diff --git a/util/copy_archinstall_log.sh b/util/copy_archinstall_log.sh deleted file mode 100644 index 5f2a8b8..0000000 --- a/util/copy_archinstall_log.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -log_file_path=$1 # e.g. "/etc/archinstall/config.json" - - -mkdir /mnt$(dirname "$log_file_path") -cp $log_file_path /mnt$log_file_path - -echo "Copied archinstall log - OK" diff --git a/util/create_filesystems.sh b/util/create_filesystems.sh deleted file mode 100644 index 917363e..0000000 --- a/util/create_filesystems.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -efi_partition_path=$1 # e.g. /dev/sda1 or /dev/null if not needed -boot_partition_path=$2 # e.g. /dev/sda2 or /dev/null if not needed -root_partition_path=$3 # e.g. /dev/sda3 or /dev/SystemVolumeGroup/root - - -if [ "$efi_partition_path" != "/dev/null" ]; then # if efi partition is needed - echo "EFI partition needed." - mkfs.fat -F32 $efi_partition_path - fatlabel $efi_partition_path "EFI" -else - echo "EFI partition not needed." -fi -if [ "$boot_partition_path" != "/dev/null" ]; then # if boot partition is needed - echo "BOOT partition needed." - mkfs.ext4 $boot_partition_path - e2label $boot_partition_path "BOOT" -else - echo "BOOT partition not needed." -fi -mkfs.ext4 $root_partition_path -e2label $root_partition_path "ROOT" - -echo "Created filesystems - OK" diff --git a/util/format_crypto_partition.sh b/util/format_crypto_partition.sh deleted file mode 100644 index 688e280..0000000 --- a/util/format_crypto_partition.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -main_partition_path=$1 -DEFAULT_PASSWORD=$2 - - -echo -n "$DEFAULT_PASSWORD" | cryptsetup luksFormat $main_partition_path - - -echo "Formatted crypto partition - OK" diff --git a/util/install_archinstall.sh b/util/install_archinstall.sh deleted file mode 100644 index 67aee15..0000000 --- a/util/install_archinstall.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -repository_path=$1 # e.g. "/opt/archinstall" - - -cp -r $repository_path /mnt$repository_path - -echo "Installed archinstall - OK" diff --git a/util/install_bootloader.sh b/util/install_bootloader.sh deleted file mode 100644 index 78ca49b..0000000 --- a/util/install_bootloader.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -efi_partition_path=$1 -system_encryption=$2 -main_partition_path=$3 -boot_mode=$4 # "UEFI" or "BIOS" - - -if [ "$boot_mode" == "UEFI" ]; then - mount $efi_partition_path /mnt - grub-install --target=x86_64-efi --efi-directory=/mnt --bootloader-id=GRUB \ - --removable -elif [ "$boot_mode" == "BIOS" ]; then - grub-install --target=i386-pc $disk_path -else - echo "Unknown boot mode - FAILED" - exit -fi - -if [ $system_encryption == "yes" ];then - - cryptdevice_uuid=$(lsblk --fs | grep "$(basename $main_partition_path)" | awk '{print $3}') - echo "cryptdevice_uuid: $cryptdevice_uuid" - old_kernel_param_line=$(cat /etc/default/grub | grep "GRUB_CMDLINE_LINUX_DEFAULT") - echo "old_kernel_param_line: $old_kernel_param_line" - new_kernal_param_line="GRUB_CMDLINE_LINUX_DEFAULT=\"loglevel=3 quiet cryptdevice=UUID=${cryptdevice_uuid}:main root=/dev/mapper/main\"" - echo "new_kernel_param_line: $new_kernal_param_line" - echo "Adding kernel parameters to /etc/default/grub" - sed -i "s|$old_kernel_param_line|$new_kernal_param_line|" /etc/default/grub - -fi - -grub-mkconfig -o /boot/grub/grub.cfg - -if [ "$boot_mode" == "UEFI" ];then - umount $efi_partition_path -fi - -echo "Installed bootloader - OK" diff --git a/util/install_packages.sh b/util/install_packages.sh deleted file mode 100644 index 44fe0b4..0000000 --- a/util/install_packages.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -desktop_wanted=$1 # e.g. "yes" - - -pacstrap /mnt base linux linux-firmware dhcpcd nano sudo grub efibootmgr -if [ "$desktop_wanted" = "yes" ]; then - pacstrap /mnt xorg lightdm lightdm-gtk-greeter light-locker accountsservice gnome-screensaver xfce4-pulseaudio-plugin network-manager-applet xfce4 mousepad -fi - -echo "Installed packages - OK" diff --git a/util/mount_filesystems.sh b/util/mount_filesystems.sh deleted file mode 100644 index 75bbb14..0000000 --- a/util/mount_filesystems.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -boot_partition_path=$1 -root_partition_path=$2 - - -mount $root_partition_path /mnt - -if [ "$boot_partition_path" != "/dev/null" ];then - mkdir /mnt/boot - mount $boot_partition_path /mnt/boot -fi - -echo "Mounted filesystems - OK" diff --git a/util/open_crypto_partition.sh b/util/open_crypto_partition.sh deleted file mode 100644 index 40e7a61..0000000 --- a/util/open_crypto_partition.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -main_partition_path=$1 -DEFAULT_PASSWORD=$2 - - -echo -n "$DEFAULT_PASSWORD" | cryptsetup open $main_partition_path main - - -echo "Opened crypto partition - OK" diff --git a/util/partition_disk.sh b/util/partition_disk.sh deleted file mode 100644 index a7a1087..0000000 --- a/util/partition_disk.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -disk_path=$1 # e.g. /dev/sda -boot_mode=$2 # "UEFI" or "BIOS" - - -if [ "$boot_mode" == "UEFI" ]; then - echo "Partitioning for UEFI mode." - wipefs -a $disk_path # make sure that fdisk does not ask for removing - # signatures which breaks the script - fdisk $disk_path << EOF -g -n -1 - -+512M -n -2 - -+200M -n -3 - - -p -w -EOF - - echo "Partitioned disk for UEFI/GPT- OK" -elif [ "$boot_mode" == "BIOS" ]; then - echo "Partitioning for BIOS mode." - wipefs -a $disk_path # make sure that fdisk does not ask for removing - # signatures which breaks the script - fdisk $disk_path << EOF -o -n -p -1 - - -p -w -EOF - - echo "Partitioned disk for BIOS/MBR - OK" -else - -fi diff --git a/util/print_final_message.sh b/util/print_final_message.sh deleted file mode 100644 index 46e99b9..0000000 --- a/util/print_final_message.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -default_password=$1 - - -cat << EOF -##################################################################### - - The default password for your user and root is '${default_password}'. - It is also the default password for drive encryption. - You can now power off your machine with 'poweroff', - remove the installation media and boot your new - Arch Linux machine! - -##################################################################### - -EOF - -echo "Printed final message - OK" diff --git a/util/read_config_string.py b/util/read_config_string.py deleted file mode 100644 index 86febd1..0000000 --- a/util/read_config_string.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -########################## -# get_config_string.py # -########################## - - -import sys -import json - - -config_file_path = sys.argv[1] -requested_detail = sys.argv[2] - - -with open(config_file_path) as f: - config_json = f.read() - -config = json.loads(config_json) - - -print(config[requested_detail]) diff --git a/util/unmount_filesystems.sh b/util/unmount_filesystems.sh deleted file mode 100644 index 0980e5a..0000000 --- a/util/unmount_filesystems.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -boot_partition_path=$1 -root_partition_path=$2 - - -cd /root -if [ "$boot_partition_path" != "/dev/null" ];then - umount $boot_partition_path -fi -umount $root_partition_path - -echo "Unmounted filesystems - OK" diff --git a/util/write_config.py b/util/write_config.py deleted file mode 100644 index 2c694eb..0000000 --- a/util/write_config.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -import sys -import json -import subprocess - - -config_file_path = sys.argv[1] # e.g. "/etc/archinstall/config.json" - - -def print_separator(): - print() - print("#################################################################") - print() - - -config = {} - - -# Disk selection - -print_separator() -print("Please type in the 'NAME' of the hard disk on which you want to \ninstall Arch Linux:") -print() -subprocess.run("lsblk -o NAME,SIZE,TYPE | grep -v part", shell=True) -print() -config["disk"] = input(">>> ") - - -# Select hostname - -print_separator() -print("Please type in the hostname of your new machine:") -print() -config["hostname"] = input(">>> ") - - -# Desktop or no desktop - -print_separator() -print("Do you want to install a desktop? [Y/n]:") -print() -answer = input(">>> ") -if answer in ["", "Y", "y", "Yes", "yes"]: - config["desktop"] = "yes" -else: - config["desktop"] = "no" - - -# Admin account - -print_separator() -print("Please select your username (like 'paul' or 'alice'):") -print() -config["admin_username"] = input(">>> ") - - -# System encryption - -print_separator() -print("System encryption protects all your data if your device is stolen.") -print("A second password will be required at startup to decrypt the system.") -print("Do you want to encrypt your system? [Y/n]") -print() -answer = input(">>> ") -if answer in ["", "Y", "y", "Yes", "yes"]: - config["system_encryption"] = "yes" -else: - config["system_encryption"] = "no" - - -# Write config to json file - -config_json = json.dumps(config, indent=4) -with open(config_file_path, 'w') as f: - f.write(config_json) - - -# Output json config for logging purpose - -print_separator() -print("Config for this installation:") -print() -print(config_json) -print_separator() - -print("Wrote config - OK") diff --git a/util/write_fstab.sh b/util/write_fstab.sh deleted file mode 100644 index 61b1128..0000000 --- a/util/write_fstab.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - - -# archinstall - A minimal Installation Script for Arch Linux -# Copyright (C) 2019 xengineering - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - - -genfstab -U /mnt >> /mnt/etc/fstab - -echo "Wrote /etc/fstab - OK" |