summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2019-12-15 13:10:04 +0100
committerxengineering <mail2xengineering@protonmail.com>2019-12-15 13:10:04 +0100
commitb5e454658004691d9cc9c9f7d1dd366c6c6c5444 (patch)
tree26eac993715eef9b04d91f45c20a1558d471e6df
parent5259030286c8f65892d3210098661778a5152956 (diff)
downloadarchinstall-b5e454658004691d9cc9c9f7d1dd366c6c6c5444.tar
archinstall-b5e454658004691d9cc9c9f7d1dd366c6c6c5444.tar.zst
archinstall-b5e454658004691d9cc9c9f7d1dd366c6c6c5444.zip
Finally moved to new stages/util system.
-rw-r--r--.gitignore1
-rw-r--r--bin/configure_desktop.sh39
-rw-r--r--bin/first_stage.sh172
-rw-r--r--bin/install_bootloader.sh35
-rw-r--r--bin/localization.sh51
-rw-r--r--bin/network_configuration.sh40
-rw-r--r--bin/second_stage.sh74
-rw-r--r--bin/write_config.py70
-rw-r--r--stages/first_stage.sh6
-rw-r--r--stages/second_stage.sh6
-rw-r--r--util/read_config_string.py (renamed from bin/get_config_string.py)0
11 files changed, 3 insertions, 491 deletions
diff --git a/.gitignore b/.gitignore
index 0b67bc9..61d1487 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
**/__pycache__
archive
-functional_structure.txt
diff --git a/bin/configure_desktop.sh b/bin/configure_desktop.sh
deleted file mode 100644
index 78fd745..0000000
--- a/bin/configure_desktop.sh
+++ /dev/null
@@ -1,39 +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/>.
-
-
-########################
-# install_desktop.sh #
-########################
-
-
-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
diff --git a/bin/first_stage.sh b/bin/first_stage.sh
deleted file mode 100644
index 6ced555..0000000
--- a/bin/first_stage.sh
+++ /dev/null
@@ -1,172 +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/>.
-
-
-####################
-# first_stage.sh #
-####################
-
-
-DELAY=$1
-REPOSITORY_PATH=$2
-LOG_FILE_PATH=$3
-CONFIG_FILE_PATH=$4
-
-
-mkdir $(dirname "$CONFIG_FILE_PATH")
-touch $CONFIG_FILE_PATH
-python $REPOSITORY_PATH/bin/write_config.py $CONFIG_FILE_PATH
-disk=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "disk")
-disk_path=/dev/$disk
-hostname=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "hostname")
-desktop=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "desktop")
-
-
-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 "Starting installation process - OK"
- echo ""
-else
- echo ""
- echo "Abort of installation process!"
- exit
-fi
-
-
-# Check if booted with UEFI
-
-if [ -d "/sys/firmware/efi/efivars" ]; then
- echo "Booted with UEFI - OK"
- echo ""
- sleep $DELAY
-else
- echo "Not booted with UEFI. Please enable it in your mainboard settings. - FAILED"
- exit
-fi
-
-
-# Partitioning
-
-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
-
-
-p
-w
-EOF
-boot_partition_path="${disk_path}1"
-root_partition_path="${disk_path}2"
-echo "Partitioning finished - OK"
-sleep $DELAY
-echo ""
-
-
-# Create Filesystems
-
-mkfs.fat -F32 $boot_partition_path
-mkfs.ext4 $root_partition_path
-fatlabel $boot_partition_path "BOOT"
-e2label $root_partition_path "ROOT"
-echo "Created filesystems - OK"
-sleep $DELAY
-echo ""
-
-
-# Mount Root Filesystem
-
-mount $root_partition_path /mnt
-echo "Mounted root partition - OK"
-sleep $DELAY
-echo ""
-
-
-# Install basic Packages
-
-echo "Going to install packages ..."
-sleep $DELAY
-echo ""
-pacstrap /mnt base linux linux-firmware dhcpcd nano sudo grub efibootmgr
-if [ "$desktop" = "yes" ]; then
- pacstrap /mnt xorg lightdm lightdm-gtk-greeter xfce4 mousepad
-fi
-echo ""
-echo "Installed packages - OK"
-sleep $DELAY
-echo ""
-
-
-# Copy repository from live image to root partition
-
-cp -r $REPOSITORY_PATH /mnt$REPOSITORY_PATH
-
-
-# Generate /etc/fstab file
-
-genfstab -U /mnt >> /mnt/etc/fstab
-echo "Generated /etc/fstab - OK"
-sleep $DELAY
-echo ""
-
-
-# Launch second stage in chroot
-
-echo "bash $REPOSITORY_PATH/bin/second_stage.sh $hostname \
-${disk_path}1 $REPOSITORY_PATH $CONFIG_FILE_PATH $desktop" | arch-chroot /mnt
-
-
-# Copy log and config from live image to root partition
-
-cp $LOG_FILE_PATH /mnt$LOG_FILE_PATH
-mkdir /mnt$(dirname "$CONFIG_FILE_PATH")
-cp $CONFIG_FILE_PATH /mnt$CONFIG_FILE_PATH
-
-
-# Unmount root partition
-
-cd /root && umount $root_partition_path
-echo "Unmounted root partition - OK"
-sleep $DELAY
-echo ""
-
-
-# Final Messages
-
-cat << EOF
-#################################################################
-# #
-# The default login is user root with password 'root'. #
-# You can now power off your machine with 'poweroff', #
-# remove the installation media and boot your new #
-# Arch Linux machine! #
-# #
-#################################################################
-
-EOF
diff --git a/bin/install_bootloader.sh b/bin/install_bootloader.sh
deleted file mode 100644
index 6e2bb8e..0000000
--- a/bin/install_bootloader.sh
+++ /dev/null
@@ -1,35 +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/>.
-
-
-###########################
-# install_bootloader.sh #
-###########################
-
-
-# Install Grub
-
-mount $1 /mnt
-grub-install --target=x86_64-efi --efi-directory=/mnt --bootloader-id=GRUB \
---removable
-grub-mkconfig -o /boot/grub/grub.cfg
-umount $1
-echo "Grub bootloader installed - OK"
-echo ""
-sleep 1
diff --git a/bin/localization.sh b/bin/localization.sh
deleted file mode 100644
index d5f1f90..0000000
--- a/bin/localization.sh
+++ /dev/null
@@ -1,51 +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/>.
-
-
-#####################
-# localization.sh #
-#####################
-
-
-# Set timezone
-
-ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
-hwclock --systohc
-echo "Timezone set - OK"
-echo ""
-sleep 1
-
-
-# Localization - Greetings from Germany
-
-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
-
-touch /etc/vconsole.conf
-echo "KEYMAP=de-latin1" > /etc/vconsole.conf
-
-echo "German localization done - OK"
-echo ""
-sleep 1
diff --git a/bin/network_configuration.sh b/bin/network_configuration.sh
deleted file mode 100644
index b27b342..0000000
--- a/bin/network_configuration.sh
+++ /dev/null
@@ -1,40 +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/>.
-
-
-##############################
-# network_configuration.sh #
-##############################
-
-
-# Network Configuration
-
-touch /etc/hostname
-echo $1 > /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 "Network configuration done - OK"
-echo ""
-sleep 1
diff --git a/bin/second_stage.sh b/bin/second_stage.sh
deleted file mode 100644
index bd6ddf9..0000000
--- a/bin/second_stage.sh
+++ /dev/null
@@ -1,74 +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/>.
-
-
-#####################
-# second_stage.sh #
-#####################
-
-
-# Argument Processing
-
-hostname=$1
-boot_partition_path=$2
-REPOSITORY_PATH=$3
-CONFIG_FILE_PATH=$4
-desktop=$5
-
-
-# Localization
-
-bash $REPOSITORY_PATH/bin/localization.sh
-
-
-# Network Configuration
-
-bash $REPOSITORY_PATH/bin/network_configuration.sh $hostname
-
-
-# Initramfs
-
-# implement if needed ...
-
-
-# Set default Password
-
-echo "root:root" | chpasswd
-echo "Default password for user root set - OK"
-echo ""
-sleep 1
-
-
-# Bootloader Installation
-
-bash $REPOSITORY_PATH/bin/install_bootloader.sh $boot_partition_path
-
-
-# Desktop Installation
-
-if [ "$desktop" = "yes" ]; then
- bash $REPOSITORY_PATH/bin/configure_desktop.sh
-fi
-
-
-# Good bye chroot
-
-echo "Leaving chroot environment - OK"
-echo ""
-sleep 1
diff --git a/bin/write_config.py b/bin/write_config.py
deleted file mode 100644
index 704ea33..0000000
--- a/bin/write_config.py
+++ /dev/null
@@ -1,70 +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/>.
-
-
-#####################
-# write_config.py #
-#####################
-
-
-import sys
-import json
-import subprocess
-
-
-config_file_path = sys.argv[1]
-
-
-config = {}
-
-
-# Disk selection
-
-print("Please type in the 'NAME' of the hard disk on which you want to install Arch Linux:")
-subprocess.run("lsblk -o NAME,SIZE,TYPE | grep -v part", shell=True)
-config["disk"] = input()
-
-
-# Select hostname
-
-print("Please type in the hostname of your new machine:")
-config["hostname"] = input()
-
-
-# Desktop or no Desktop
-
-print("Do you want to install a desktop? [Y/n]:")
-answer = input()
-if answer in ["", "Y", "y", "Yes", "yes"]:
- config["desktop"] = "yes"
-else:
- config["desktop"] = "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("Config for this installation:")
-print(config_json)
diff --git a/stages/first_stage.sh b/stages/first_stage.sh
index 036443b..a748db1 100644
--- a/stages/first_stage.sh
+++ b/stages/first_stage.sh
@@ -30,12 +30,12 @@ python $REPOSITORY_PATH/util/write_config.py $CONFIG_FILE_PATH
# Reading config values to bash
-export disk=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "disk")
+export disk=$(python $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "disk")
export disk_path=/dev/$disk
export boot_partition_path="${disk_path}1"
export root_partition_path="${disk_path}2"
-export hostname=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "hostname")
-export desktop=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "desktop")
+export hostname=$(python $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "hostname")
+export desktop=$(python $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "desktop")
# Confirmation
diff --git a/stages/second_stage.sh b/stages/second_stage.sh
index 4cae372..f4b867e 100644
--- a/stages/second_stage.sh
+++ b/stages/second_stage.sh
@@ -21,12 +21,6 @@
echo "Entering second_stage.sh - OK"
-echo "Debug values:"
-echo $PATH
-echo $REPOSITORY_PATH
-echo "End of debug"
-
-
bash configure_keyboard.sh de-latin1
bash configure_locales.sh
diff --git a/bin/get_config_string.py b/util/read_config_string.py
index 86febd1..86febd1 100644
--- a/bin/get_config_string.py
+++ b/util/read_config_string.py