summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2019-12-15 11:39:20 +0100
committerxengineering <mail2xengineering@protonmail.com>2019-12-15 11:39:20 +0100
commit2a64f2483771ede6310b18a94e7301618d8dc4f7 (patch)
treea9ba6c6988b6e079752ba6ba48bae6c93cccc788
parenta5eb7e67ca1ea36c3c6ea6dc7c86c2703fe70620 (diff)
downloadarchinstall-2a64f2483771ede6310b18a94e7301618d8dc4f7.tar
archinstall-2a64f2483771ede6310b18a94e7301618d8dc4f7.tar.zst
archinstall-2a64f2483771ede6310b18a94e7301618d8dc4f7.zip
Started change to new stages/util concept.
-rw-r--r--archinstall.sh24
-rw-r--r--stages/first_stage.sh36
-rw-r--r--stages/second_stage.sh3
-rw-r--r--util/check_bootmode.sh3
4 files changed, 57 insertions, 9 deletions
diff --git a/archinstall.sh b/archinstall.sh
index 50444ca..b7d9f28 100644
--- a/archinstall.sh
+++ b/archinstall.sh
@@ -32,11 +32,19 @@
TESTSERVER="8.8.8.8" # hostnames will not work properly
NETWORK_DEADLINE=1 # in seconds
-REPOSITORY_URL="https://github.com/xengineering/archinstall/"
-REPOSITORY_PATH="/opt/archinstall"
-BRANCH_OR_COMMIT="master" # select another branch name or commit hash if needed
-LOG_FILE_PATH="/var/log/archinstall.log"
-CONFIG_FILE_PATH="/etc/archinstall/config.json"
+export REPOSITORY_URL="https://github.com/xengineering/archinstall/"
+export REPOSITORY_PATH="/opt/archinstall"
+export BRANCH_OR_COMMIT="master" # select another branch name or commit hash if needed
+export LOG_FILE_PATH="/var/log/archinstall.log"
+export CONFIG_FILE_PATH="/etc/archinstall/config.json"
+
+# PATH expansion
+
+export PATH=$PATH:$(REPOSITORY_PATH)/stages
+export PATH=$PATH:$(REPOSITORY_PATH)/util
+echo "New PATH:"
+echo $PATH
+echo ""
# Greetings
@@ -99,5 +107,7 @@ echo ""
# Launching first stage
-bash $REPOSITORY_PATH/bin/first_stage.sh \
-$DELAY $REPOSITORY_PATH $LOG_FILE_PATH $CONFIG_FILE_PATH | tee -a $LOG_FILE_PATH
+#bash $REPOSITORY_PATH/bin/first_stage.sh \
+#$REPOSITORY_PATH $LOG_FILE_PATH $CONFIG_FILE_PATH | tee -a $LOG_FILE_PATH
+
+bash first_stage.sh | tee -a $LOG_FILE_PATH
diff --git a/stages/first_stage.sh b/stages/first_stage.sh
index 2d19b9a..756c8ff 100644
--- a/stages/first_stage.sh
+++ b/stages/first_stage.sh
@@ -16,3 +16,39 @@
# 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 "Entering first_stage.sh - OK"
+
+
+mkdir $(dirname "$CONFIG_FILE_PATH")
+touch $CONFIG_FILE_PATH
+python 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
+
+
+bash check_bootmode.sh
+
+bash partition_disk.sh $disk_path
+
+bash create_filesystems.sh $(disk_path)1 $(disk_path)2
+
+bash mount_filesystems.sh $(disk_path)2
diff --git a/stages/second_stage.sh b/stages/second_stage.sh
index 2d19b9a..5810806 100644
--- a/stages/second_stage.sh
+++ b/stages/second_stage.sh
@@ -16,3 +16,6 @@
# 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 "Entering second_stage.sh - OK"
diff --git a/util/check_bootmode.sh b/util/check_bootmode.sh
index 560e2b7..299856a 100644
--- a/util/check_bootmode.sh
+++ b/util/check_bootmode.sh
@@ -20,8 +20,7 @@
if [ -d "/sys/firmware/efi/efivars" ]; then
echo "Booted with UEFI"
- echo "Checked bootmode - OK"
else
echo "Not booted with UEFI. Please enable it in your mainboard settings. - FAILED"
- echo "Checked bootmode - OK"
+ exit
fi