From 4e657a1be5764cf1f81ec23fd78302046882a415 Mon Sep 17 00:00:00 2001 From: mfgbhatti Date: Mon, 24 Jan 2022 20:25:53 +0000 Subject: [PATCH] added partition layout --- startup.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/startup.sh b/startup.sh index eddce7d..306d602 100644 --- a/startup.sh +++ b/startup.sh @@ -85,6 +85,48 @@ echo -ne " " } +setpartionlayout() { + # Set partioning layouts + title "Partioning Layout" + LAYOUTS=("Default" "LVM" "LVM+LUKS" "Maintain Current") + PS3="$PROMPT" + select OPT in "${LAYOUTS[@]}"; do + if elements_present "$OPT" "${LAYOUTS[@]}"; then + case "$REPLY" in + 1) + set_option "LAYOUT" 1 + break + ;; + 2) + set_option "LAYOUT" "$OPT" + set_option "LVM" 1 + set_option "LUKS" 0 + break + ;; + 3) + set_option "LAYOUT" "$OPT" + set_password "LUKS_PASSWORD" + set_option "LUKS" 1 + set_option "LVM" 1 + break + ;; + 4) + echo -ne "Maintaining current settings" + set_option "LAYOUT" 0 + break + ;; + *) + invalid_option + setpartionlayout + ;; + esac + else + invalid_option + filesystem + fi + done +} + filesystem () { # This function will handle file systems. At this movement we are handling only # btrfs and ext4. Others will be added in future.