summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2019-11-25 13:39:43 +0100
committerxengineering <mail2xengineering@protonmail.com>2019-11-25 13:39:43 +0100
commitd45d41ee0bd52b28226e69317bca1c284009b397 (patch)
tree8ccfb55c07adb593e42ad7e76e673480094f1e3a /bin
parent63d89031176687de9de41c7665d86cea64717c6e (diff)
downloadarchinstall-d45d41ee0bd52b28226e69317bca1c284009b397.tar
archinstall-d45d41ee0bd52b28226e69317bca1c284009b397.tar.zst
archinstall-d45d41ee0bd52b28226e69317bca1c284009b397.zip
First version with desktop installation support.
Diffstat (limited to 'bin')
-rw-r--r--bin/first_stage.sh6
-rw-r--r--bin/install_desktop.sh27
-rw-r--r--bin/second_stage.sh9
-rw-r--r--bin/write_config.py10
4 files changed, 49 insertions, 3 deletions
diff --git a/bin/first_stage.sh b/bin/first_stage.sh
index a3a3240..5981cd9 100644
--- a/bin/first_stage.sh
+++ b/bin/first_stage.sh
@@ -34,9 +34,9 @@ CONFIG_FILE_PATH=$4
mkdir $(dirname "$CONFIG_FILE_PATH")
touch $CONFIG_FILE_PATH
python $2/bin/write_config.py $CONFIG_FILE_PATH
-disk=$(python $2/bin/get_config_string.py $CONFIG_FILE_PATH "disk")
+disk=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "disk")
disk_path=/dev/$disk
-hostname=$(python $2/bin/get_config_string.py $CONFIG_FILE_PATH "hostname")
+hostname=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "hostname")
echo "All data on disk '$disk' will be finally lost!"
@@ -137,7 +137,7 @@ echo ""
# Launch second stage in chroot
echo "bash $REPOSITORY_PATH/bin/second_stage.sh $hostname \
-${disk_path}1 $REPOSITORY_PATH" | arch-chroot /mnt
+${disk_path}1 $REPOSITORY_PATH $CONFIG_FILE_PATH" | arch-chroot /mnt
# Copy log and config from live image to root partition
diff --git a/bin/install_desktop.sh b/bin/install_desktop.sh
new file mode 100644
index 0000000..acc328d
--- /dev/null
+++ b/bin/install_desktop.sh
@@ -0,0 +1,27 @@
+#!/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 #
+########################
+
+
+pacman --noconfirm -Syu xfce4 lightdm
+systemctl enable lightdm
diff --git a/bin/second_stage.sh b/bin/second_stage.sh
index f2fe43a..cd9abf9 100644
--- a/bin/second_stage.sh
+++ b/bin/second_stage.sh
@@ -28,6 +28,7 @@
hostname=$1
boot_partition_path=$2
REPOSITORY_PATH=$3
+CONFIG_FILE_PATH=$4
# Localization
@@ -58,6 +59,14 @@ sleep 1
bash $REPOSITORY_PATH/bin/install_bootloader.sh $boot_partition_path
+# Desktop Installation
+
+desktop=$(python $REPOSITORY_PATH/bin/get_config_string.py $CONFIG_FILE_PATH "desktop")
+if [ "$desktop" = "yes" ]; then
+ bash $REPOSITORY_PATH/bin/install_desktop.sh
+fi
+
+
# Good bye chroot
echo "Leaving chroot environment - OK"
diff --git a/bin/write_config.py b/bin/write_config.py
index c01eb47..704ea33 100644
--- a/bin/write_config.py
+++ b/bin/write_config.py
@@ -47,6 +47,16 @@ 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)