mirror of
https://gitlab.manjaro.org/applications/manjaro-architect
synced 2024-11-08 01:10:26 +00:00
FIx util-disk.sh backwards navigation
This commit is contained in:
parent
dd25a38120
commit
0e616bd74f
@ -34,7 +34,7 @@ select_device() {
|
||||
DEVICE="${DEVICE} ${i}"
|
||||
done
|
||||
|
||||
DIALOG " $_DevSelTitle " --menu "$_DevSelBody" 0 0 4 ${DEVICE} 2>${ANSWER} || prep_menu
|
||||
DIALOG " $_DevSelTitle " --menu "$_DevSelBody" 0 0 4 ${DEVICE} 2>${ANSWER} || break
|
||||
DEVICE=$(cat ${ANSWER})
|
||||
}
|
||||
|
||||
@ -208,10 +208,10 @@ delete_partition_in_list() {
|
||||
PARTITIONS="${parts[*]}"
|
||||
check_for_error "partitions: $PARTITIONS"
|
||||
NUMBER_PARTITIONS=$(( "${#parts[*]}" / 2 ))
|
||||
return 0
|
||||
break
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
break
|
||||
}
|
||||
|
||||
# Revised to deal with partion sizes now being displayed to the user
|
||||
@ -290,7 +290,7 @@ select_filesystem() {
|
||||
CHK_NUM=9
|
||||
fs_opts="discard filestreams ikeep largeio noalign nobarrier norecovery noquota wsync"
|
||||
;;
|
||||
*) return 0
|
||||
*) break
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -406,19 +406,19 @@ mount_current_partition() {
|
||||
|
||||
make_swap() {
|
||||
# Ask user to select partition or create swapfile
|
||||
DIALOG " $_PrepMntPart " --menu "$_SelSwpBody" 0 0 12 "$_SelSwpNone" $"-" "$_SelSwpFile" $"-" ${PARTITIONS} 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepMntPart " --menu "$_SelSwpBody" 0 0 12 "$_SelSwpNone" $"-" "$_SelSwpFile" $"-" ${PARTITIONS} 2>${ANSWER} || break
|
||||
|
||||
if [[ $(cat ${ANSWER}) != "$_SelSwpNone" ]]; then
|
||||
PARTITION=$(cat ${ANSWER})
|
||||
|
||||
if [[ $PARTITION == "$_SelSwpFile" ]]; then
|
||||
total_memory=$(grep MemTotal /proc/meminfo | awk '{print $2/1024}' | sed 's/\..*//')
|
||||
DIALOG " $_SelSwpFile " --inputbox "\nM = MB, G = GB\n" 9 30 "${total_memory}M" 2>${ANSWER} || return 0
|
||||
DIALOG " $_SelSwpFile " --inputbox "\nM = MB, G = GB\n" 9 30 "${total_memory}M" 2>${ANSWER} || break
|
||||
m_or_g=$(cat ${ANSWER})
|
||||
|
||||
while [[ $(echo ${m_or_g: -1} | grep "M\|G") == "" ]]; do
|
||||
DIALOG " $_SelSwpFile " --msgbox "\n$_SelSwpFile $_ErrTitle: M = MB, G = GB\n\n" 0 0
|
||||
DIALOG " $_SelSwpFile " --inputbox "\nM = MB, G = GB\n" 9 30 "${total_memory}M" 2>${ANSWER} || return 0
|
||||
DIALOG " $_SelSwpFile " --inputbox "\nM = MB, G = GB\n" 9 30 "${total_memory}M" 2>${ANSWER} || break
|
||||
m_or_g=$(cat ${ANSWER})
|
||||
done
|
||||
|
||||
@ -439,7 +439,7 @@ make_swap() {
|
||||
mkswap ${PARTITION} >/dev/null 2>$ERR
|
||||
check_for_error "Swap partition: mkswap" "$?"
|
||||
else
|
||||
return 0
|
||||
break
|
||||
fi
|
||||
fi
|
||||
# Whether existing to newly created, activate swap
|
||||
@ -456,10 +456,10 @@ make_swap() {
|
||||
# "create LUKS" function for default and "advanced" modes were interpreted as commands,
|
||||
# not mere string statements. Not happy with it, but it works...
|
||||
luks_password() {
|
||||
DIALOG " $_PrepLUKS " --clear --insecure --passwordbox "$_LuksPassBody" 0 0 2> ${ANSWER} || return 0
|
||||
DIALOG " $_PrepLUKS " --clear --insecure --passwordbox "$_LuksPassBody" 0 0 2> ${ANSWER} || break
|
||||
PASSWD=$(cat ${ANSWER})
|
||||
|
||||
DIALOG " $_PrepLUKS " --clear --insecure --passwordbox "$_PassReEntBody" 0 0 2> ${ANSWER} || return 0
|
||||
DIALOG " $_PrepLUKS " --clear --insecure --passwordbox "$_PassReEntBody" 0 0 2> ${ANSWER} || break
|
||||
PASSWD2=$(cat ${ANSWER})
|
||||
|
||||
if [[ $PASSWD != $PASSWD2 ]]; then
|
||||
@ -475,11 +475,11 @@ luks_open() {
|
||||
find_partitions
|
||||
|
||||
# Select encrypted partition to open
|
||||
DIALOG " $_LuksOpen " --menu "$_LuksMenuBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || return 0
|
||||
DIALOG " $_LuksOpen " --menu "$_LuksMenuBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || break
|
||||
PARTITION=$(cat ${ANSWER})
|
||||
|
||||
# Enter name of the Luks partition and get password to open it
|
||||
DIALOG " $_LuksOpen " --inputbox "$_LuksOpenBody" 10 50 "cryptroot" 2>${ANSWER} || return 0
|
||||
DIALOG " $_LuksOpen " --inputbox "$_LuksOpenBody" 10 50 "cryptroot" 2>${ANSWER} || break
|
||||
LUKS_ROOT_NAME=$(cat ${ANSWER})
|
||||
luks_password
|
||||
|
||||
@ -499,11 +499,11 @@ luks_setup() {
|
||||
umount_partitions
|
||||
find_partitions
|
||||
# Select partition to encrypt
|
||||
DIALOG " $_LuksEncrypt " --menu "$_LuksCreateBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || return 0
|
||||
DIALOG " $_LuksEncrypt " --menu "$_LuksCreateBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || break
|
||||
PARTITION=$(cat ${ANSWER})
|
||||
|
||||
# Enter name of the Luks partition and get password to create it
|
||||
DIALOG " $_LuksEncrypt " --inputbox "$_LuksOpenBody" 10 50 "cryptroot" 2>${ANSWER} || return 0
|
||||
DIALOG " $_LuksEncrypt " --inputbox "$_LuksOpenBody" 10 50 "cryptroot" 2>${ANSWER} || break
|
||||
LUKS_ROOT_NAME=$(cat ${ANSWER})
|
||||
luks_password
|
||||
}
|
||||
@ -521,7 +521,7 @@ luks_default() {
|
||||
}
|
||||
|
||||
luks_key_define() {
|
||||
DIALOG " $_PrepLUKS " --inputbox "$_LuksCipherKey" 0 0 "-s 512 -c aes-xts-plain64" 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepLUKS " --inputbox "$_LuksCipherKey" 0 0 "-s 512 -c aes-xts-plain64" 2>${ANSWER} || break
|
||||
|
||||
# Encrypt selected partition or LV with credentials given
|
||||
DIALOG " $_LuksEncryptAdv " --infobox "$_PlsWaitBody" 0 0
|
||||
@ -561,7 +561,7 @@ luks_menu() {
|
||||
luks_key_define
|
||||
luks_show
|
||||
;;
|
||||
*) return 0
|
||||
*) break
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -599,19 +599,19 @@ lvm_create() {
|
||||
PARTITIONS=$(echo $PARTITIONS | sed 's/M\|G\|T/& off/g')
|
||||
|
||||
# Name the Volume Group
|
||||
DIALOG " $_LvmCreateVG " --inputbox "$_LvmNameVgBody" 0 0 "" 2>${ANSWER} || prep_menu
|
||||
DIALOG " $_LvmCreateVG " --inputbox "$_LvmNameVgBody" 0 0 "" 2>${ANSWER} || break
|
||||
LVM_VG=$(cat ${ANSWER})
|
||||
|
||||
# Loop while the Volume Group name starts with a "/", is blank, has spaces, or is already being used
|
||||
while [[ ${LVM_VG:0:1} == "/" ]] || [[ ${#LVM_VG} -eq 0 ]] || [[ $LVM_VG =~ \ |\' ]] || [[ $(lsblk | grep ${LVM_VG}) != "" ]]; do
|
||||
DIALOG "$_ErrTitle" --msgbox "$_LvmNameVgErr" 0 0
|
||||
DIALOG " $_LvmCreateVG " --inputbox "$_LvmNameVgBody" 0 0 "" 2>${ANSWER} || prep_menu
|
||||
DIALOG " $_LvmCreateVG " --inputbox "$_LvmNameVgBody" 0 0 "" 2>${ANSWER} || break
|
||||
LVM_VG=$(cat ${ANSWER})
|
||||
done
|
||||
|
||||
# Select the partition(s) for the Volume Group
|
||||
DIALOG " $_LvmCreateVG " --checklist "$_LvmPvSelBody\n\n$_UseSpaceBar" 0 0 12 ${PARTITIONS} 2>${ANSWER} || prep_menu
|
||||
[[ $(cat ${ANSWER}) != "" ]] && VG_PARTS=$(cat ${ANSWER}) || prep_menu
|
||||
DIALOG " $_LvmCreateVG " --checklist "$_LvmPvSelBody\n\n$_UseSpaceBar" 0 0 12 ${PARTITIONS} 2>${ANSWER} || break
|
||||
[[ $(cat ${ANSWER}) != "" ]] && VG_PARTS=$(cat ${ANSWER}) || break
|
||||
|
||||
# Once all the partitions have been selected, show user. On confirmation, use it/them in 'vgcreate' command.
|
||||
# Also determine the size of the VG, to use for creating LVs for it.
|
||||
@ -647,18 +647,18 @@ lvm_create() {
|
||||
|
||||
# Loop while the number of LVs is greater than 1. This is because the size of the last LV is automatic.
|
||||
while [[ $NUMBER_LOGICAL_VOLUMES -gt 1 ]]; do
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1" 0 0 "lvol" 2>${ANSWER} || prep_menu
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1" 0 0 "lvol" 2>${ANSWER} || break
|
||||
LVM_LV_NAME=$(cat ${ANSWER})
|
||||
|
||||
# Loop if preceeded with a "/", if nothing is entered, if there is a space, or if that name already exists.
|
||||
while [[ ${LVM_LV_NAME:0:1} == "/" ]] || [[ ${#LVM_LV_NAME} -eq 0 ]] || [[ ${LVM_LV_NAME} =~ \ |\' ]] || [[ $(lsblk | grep ${LVM_LV_NAME}) != "" ]]; do
|
||||
DIALOG " $_ErrTitle " --msgbox "$_LvmLvNameErrBody" 0 0
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1" 0 0 "lvol" 2>${ANSWER} || prep_menu
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1" 0 0 "lvol" 2>${ANSWER} || break
|
||||
LVM_LV_NAME=$(cat ${ANSWER})
|
||||
done
|
||||
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "\n${LVM_VG}: ${VG_SIZE}${VG_SIZE_TYPE} (${LVM_VG_MB}MB \
|
||||
$_LvmLvSizeBody1).$_LvmLvSizeBody2" 0 0 "" 2>${ANSWER} || prep_menu
|
||||
$_LvmLvSizeBody1).$_LvmLvSizeBody2" 0 0 "" 2>${ANSWER} || break
|
||||
LVM_LV_SIZE=$(cat ${ANSWER})
|
||||
check_lv_size
|
||||
|
||||
@ -666,7 +666,7 @@ lvm_create() {
|
||||
while [[ $LV_SIZE_INVALID -eq 1 ]]; do
|
||||
DIALOG " $_ErrTitle " --msgbox "$_LvmLvSizeErrBody" 0 0
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "\n${LVM_VG}: ${VG_SIZE}${VG_SIZE_TYPE} \
|
||||
(${LVM_VG_MB}MB $_LvmLvSizeBody1).$_LvmLvSizeBody2" 0 0 "" 2>${ANSWER} || prep_menu
|
||||
(${LVM_VG_MB}MB $_LvmLvSizeBody1).$_LvmLvSizeBody2" 0 0 "" 2>${ANSWER} || break
|
||||
LVM_LV_SIZE=$(cat ${ANSWER})
|
||||
check_lv_size
|
||||
done
|
||||
@ -679,13 +679,13 @@ lvm_create() {
|
||||
done
|
||||
|
||||
# Now the final LV. Size is automatic.
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1 $_LvmLvNameBody2 (${LVM_VG_MB}MB)." 0 0 "lvol" 2>${ANSWER} || prep_menu
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1 $_LvmLvNameBody2 (${LVM_VG_MB}MB)." 0 0 "lvol" 2>${ANSWER} || break
|
||||
LVM_LV_NAME=$(cat ${ANSWER})
|
||||
|
||||
# Loop if preceeded with a "/", if nothing is entered, if there is a space, or if that name already exists.
|
||||
while [[ ${LVM_LV_NAME:0:1} == "/" ]] || [[ ${#LVM_LV_NAME} -eq 0 ]] || [[ ${LVM_LV_NAME} =~ \ |\' ]] || [[ $(lsblk | grep ${LVM_LV_NAME}) != "" ]]; do
|
||||
DIALOG " $_ErrTitle " --msgbox "$_LvmLvNameErrBody" 0 0
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1 $_LvmLvNameBody2 (${LVM_VG_MB}MB)." 0 0 "lvol" 2>${ANSWER} || prep_menu
|
||||
DIALOG " $_LvmCreateVG (LV:$NUMBER_LOGICAL_VOLUMES) " --inputbox "$_LvmLvNameBody1 $_LvmLvNameBody2 (${LVM_VG_MB}MB)." 0 0 "lvol" 2>${ANSWER} || break
|
||||
LVM_LV_NAME=$(cat ${ANSWER})
|
||||
done
|
||||
|
||||
@ -694,7 +694,7 @@ lvm_create() {
|
||||
check_for_error "lvcreate -l +100%FREE ${LVM_VG} -n ${LVM_LV_NAME}" "$?"
|
||||
NUMBER_LOGICAL_VOLUMES=$(( NUMBER_LOGICAL_VOLUMES - 1 ))
|
||||
LVM=1
|
||||
DIALOG " $_LvmCreateVG " --yesno "$_LvmCompBody" 0 0 && show_devices || return 0
|
||||
DIALOG " $_LvmCreateVG " --yesno "$_LvmCompBody" 0 0 && show_devices || break
|
||||
}
|
||||
|
||||
check_lv_size() {
|
||||
@ -755,11 +755,11 @@ lvm_del_vg() {
|
||||
# If no VGs, no point in continuing
|
||||
if [[ $VG_LIST == "" ]]; then
|
||||
DIALOG " $_ErrTitle " --msgbox "$_LvmVGErr" 0 0
|
||||
return 0
|
||||
break
|
||||
fi
|
||||
|
||||
# Select VG
|
||||
DIALOG " $_PrepLVM " --menu "$_LvmSelVGBody" 0 0 5 ${VG_LIST} 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepLVM " --menu "$_LvmSelVGBody" 0 0 5 ${VG_LIST} 2>${ANSWER} || break
|
||||
|
||||
# Ask for confirmation
|
||||
DIALOG " $_LvmDelVG " --yesno "$_LvmDelQ" 0 0
|
||||
@ -813,7 +813,7 @@ lvm_menu() {
|
||||
"$_LvmCreateVG") lvm_create ;;
|
||||
"$_LvmDelVG") lvm_del_vg ;;
|
||||
"$_LvMDelAll") lvm_del_all ;;
|
||||
*) return 0 ;;
|
||||
*) break ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -838,7 +838,7 @@ mount_partitions() {
|
||||
done
|
||||
|
||||
# Identify and mount root
|
||||
DIALOG " $_PrepMntPart " --menu "$_SelRootBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepMntPart " --menu "$_SelRootBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || break
|
||||
PARTITION=$(cat ${ANSWER})
|
||||
ROOT_PART=${PARTITION}
|
||||
|
||||
@ -853,7 +853,7 @@ mount_partitions() {
|
||||
|
||||
# Extra Step for VFAT UEFI Partition. This cannot be in an LVM container.
|
||||
if [[ $SYSTEM == "UEFI" ]]; then
|
||||
DIALOG " $_PrepMntPart " --menu "$_SelUefiBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepMntPart " --menu "$_SelUefiBody" 0 0 12 ${PARTITIONS} 2>${ANSWER} || break
|
||||
PARTITION=$(cat ${ANSWER})
|
||||
UEFI_PART=${PARTITION}
|
||||
|
||||
@ -872,7 +872,7 @@ mount_partitions() {
|
||||
"/boot" "" on \
|
||||
"/boot/efi" "" off 2>${ANSWER}
|
||||
|
||||
[[ $(cat ${ANSWER}) != "" ]] && UEFI_MOUNT=$(cat ${ANSWER}) || return 0
|
||||
[[ $(cat ${ANSWER}) != "" ]] && UEFI_MOUNT=$(cat ${ANSWER}) || break
|
||||
|
||||
mkdir -p ${MOUNTPOINT}${UEFI_MOUNT} 2>$ERR
|
||||
check_for_error "create ${MOUNTPOINT}${UEFI_MOUNT}" "$?"
|
||||
@ -883,7 +883,7 @@ mount_partitions() {
|
||||
|
||||
# All other partitions
|
||||
while [[ $NUMBER_PARTITIONS > 0 ]]; do
|
||||
DIALOG " $_PrepMntPart " --menu "$_ExtPartBody" 0 0 12 "$_Done" $"-" ${PARTITIONS} 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepMntPart " --menu "$_ExtPartBody" 0 0 12 "$_Done" $"-" ${PARTITIONS} 2>${ANSWER} || break
|
||||
PARTITION=$(cat ${ANSWER})
|
||||
|
||||
if [[ $PARTITION == $_Done ]]; then
|
||||
@ -894,7 +894,7 @@ mount_partitions() {
|
||||
|
||||
# Ask user for mountpoint. Don't give /boot as an example for UEFI systems!
|
||||
[[ $SYSTEM == "UEFI" ]] && MNT_EXAMPLES="/home\n/var" || MNT_EXAMPLES="/boot\n/home\n/var"
|
||||
DIALOG " $_PrepMntPart $PARTITON " --inputbox "$_ExtPartBody1$MNT_EXAMPLES\n" 0 0 "/" 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepMntPart $PARTITON " --inputbox "$_ExtPartBody1$MNT_EXAMPLES\n" 0 0 "/" 2>${ANSWER} || break
|
||||
MOUNT=$(cat ${ANSWER})
|
||||
|
||||
# loop while the mountpoint specified is incorrect (is only '/', is blank, or has spaces).
|
||||
@ -902,7 +902,7 @@ mount_partitions() {
|
||||
# Warn user about naming convention
|
||||
DIALOG " $_ErrTitle " --msgbox "$_ExtErrBody" 0 0
|
||||
# Ask user for mountpoint again
|
||||
DIALOG " $_PrepMntPart $PARTITON " --inputbox "$_ExtPartBody1$MNT_EXAMPLES\n" 0 0 "/" 2>${ANSWER} || return 0
|
||||
DIALOG " $_PrepMntPart $PARTITON " --inputbox "$_ExtPartBody1$MNT_EXAMPLES\n" 0 0 "/" 2>${ANSWER} || break
|
||||
MOUNT=$(cat ${ANSWER})
|
||||
done
|
||||
|
||||
|
459
lib/util-menu.sh
459
lib/util-menu.sh
@ -1,3 +1,4 @@
|
||||
|
||||
# !/bin/bash
|
||||
#
|
||||
# Architect Installation Framework (2016-2017)
|
||||
@ -186,6 +187,89 @@ install_graphics_menu() {
|
||||
done
|
||||
}
|
||||
|
||||
install_vanilla_de_wm() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 4
|
||||
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
|
||||
--menu "$_InstGrMenuBody" 0 0 4 \
|
||||
"1" "$_InstGrMenuDS" \
|
||||
"2" "$_InstGrDE" \
|
||||
"3" "$_InstGrMenuDM" \
|
||||
"4" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") install_xorg_input
|
||||
;;
|
||||
"2") install_de_wm
|
||||
;;
|
||||
"3") install_dm
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
install_desktop_menu() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 4
|
||||
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
|
||||
--menu "$_InstDEMenuTitle" 0 0 4 \
|
||||
"1" "$_InstDEStable" \
|
||||
"2" "$_InstDEGit" \
|
||||
"3" "$_InstDE|>" \
|
||||
"4" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") install_manjaro_de_wm_pkg
|
||||
;;
|
||||
"2") install_manjaro_de_wm_git
|
||||
;;
|
||||
"3") install_vanilla_de_wm
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Install Accessibility Applications
|
||||
install_acc_menu() {
|
||||
echo "" > ${PACKAGES}
|
||||
|
||||
DIALOG " $_InstAccTitle " --checklist "$_InstAccBody" 0 0 15 \
|
||||
"accerciser" "-" off \
|
||||
"at-spi2-atk" "-" off \
|
||||
"at-spi2-core" "-" off \
|
||||
"brltty" "-" off \
|
||||
"caribou" "-" off \
|
||||
"dasher" "-" off \
|
||||
"espeak" "-" off \
|
||||
"espeakup" "-" off \
|
||||
"festival" "-" off \
|
||||
"java-access-bridge" "-" off \
|
||||
"java-atk-wrapper" "-" off \
|
||||
"julius" "-" off \
|
||||
"orca" "-" off \
|
||||
"qt-at-spi" "-" off \
|
||||
"speech-dispatcher" "-" off 2>${PACKAGES}
|
||||
|
||||
clear
|
||||
# If something has been selected, install
|
||||
if [[ $(cat ${PACKAGES}) != "" ]]; then
|
||||
basestrap ${MOUNTPOINT} ${PACKAGES} 2>$ERR
|
||||
check_for_error "$FUNCNAME" $? || return $?
|
||||
fi
|
||||
}
|
||||
|
||||
edit_configs() {
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
@ -250,7 +334,7 @@ edit_configs() {
|
||||
done
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -266,4 +350,375 @@ edit_configs() {
|
||||
DIALOG " $_ErrTitle " --msgbox "$_SeeConfErrBody" 0 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
####################################################################################################################
|
||||
####################################################################################################################
|
||||
|
||||
main_menu() {
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
if [[ $HIGHLIGHT != 5 ]]; then
|
||||
HIGHLIGHT=$(( HIGHLIGHT + 1 ))
|
||||
fi
|
||||
|
||||
DIALOG " $_MMTitle " --default-item ${HIGHLIGHT} \
|
||||
--menu "$_MMBody" 0 0 6 \
|
||||
"1" "$_PrepMenuTitle|>" \
|
||||
"2" "$_InstBsMenuTitle|>" \
|
||||
"3" "$_InstGrMenuTitle|>" \
|
||||
"4" "$_ConfBseMenuTitle|>" \
|
||||
"5" "$_SeeConfOptTitle|>" \
|
||||
"6" "$_Done" 2>${ANSWER}
|
||||
HIGHLIGHT=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") prep_menu
|
||||
;;
|
||||
"2") check_mount && install_base_menu
|
||||
;;
|
||||
"3") check_base && install_graphics_menu
|
||||
;;
|
||||
"4") check_base && config_base_menu
|
||||
;;
|
||||
"5") check_base && edit_configs
|
||||
;;
|
||||
*) loopmenu=0
|
||||
exit_done
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Preparation
|
||||
prep_menu() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 7
|
||||
DIALOG "$_PrepMenuTitle " --default-item ${HIGHLIGHT_SUB} \
|
||||
--menu "$_PrepMenuBody" 0 0 7 \
|
||||
"1" "$_VCKeymapTitle" \
|
||||
"2" "$_DevShowOpt" \
|
||||
"3" "$_PrepPartDisk" \
|
||||
"4" "$_PrepLUKS" \
|
||||
"5" "$_PrepLVM $_PrepLVM2" \
|
||||
"6" "$_PrepMntPart" \
|
||||
"7" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") set_keymap
|
||||
;;
|
||||
"2") show_devices
|
||||
;;
|
||||
"3") umount_partitions
|
||||
select_device
|
||||
if [[ $DEVICE != "" ]]; then
|
||||
create_partitions
|
||||
fi
|
||||
;;
|
||||
"4") luks_menu
|
||||
;;
|
||||
"5") lvm_menu
|
||||
;;
|
||||
"6") mount_partitions
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Base Installation
|
||||
install_base_menu() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 5
|
||||
DIALOG " $_InstBsMenuTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_InstBseMenuBody" 0 0 5 \
|
||||
"1" "$_PrepMirror" \
|
||||
"2" "$_PrepPacKey" \
|
||||
"3" "$_InstBse" \
|
||||
"4" "$_InstBootldr" \
|
||||
"5" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") configure_mirrorlist
|
||||
;;
|
||||
"2") clear
|
||||
pacman-key --init
|
||||
pacman-key --populate archlinux manjaro
|
||||
pacman-key --refresh-keys
|
||||
check_for_error "refresh pacman-keys"
|
||||
;;
|
||||
"3") install_base
|
||||
;;
|
||||
"4") install_bootloader
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Base Configuration
|
||||
config_base_menu() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 8
|
||||
DIALOG "$_ConfBseBody" --default-item ${HIGHLIGHT_SUB} --menu " $_ConfBseMenuTitle " \
|
||||
0 0 8 \
|
||||
"1" "$_ConfBseFstab" \
|
||||
"2" "$_ConfBseHost" \
|
||||
"3" "$_ConfBseSysLoc" \
|
||||
"4" "$_ConfBseTimeHC" \
|
||||
"5" "$_ConfUsrRoot" \
|
||||
"6" "$_ConfUsrNew" \
|
||||
"7" "$_MMRunMkinit" \
|
||||
"8" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") generate_fstab
|
||||
;;
|
||||
"2") set_hostname
|
||||
;;
|
||||
"3") set_locale
|
||||
;;
|
||||
"4") set_timezone
|
||||
set_hw_clock
|
||||
;;
|
||||
"5") set_root_password
|
||||
;;
|
||||
"6") create_new_user
|
||||
;;
|
||||
"7") run_mkinitcpio
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
install_graphics_menu() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 4
|
||||
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
|
||||
--menu "$_InstGrMenuBody" 0 0 4 \
|
||||
"1" "$_InstGrMenuDD" \
|
||||
"2" "$_InstGrMenuGE|>" \
|
||||
"3" "$_PrepKBLayout" \
|
||||
"4" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") setup_graphics_card
|
||||
;;
|
||||
"2") install_manjaro_de_wm_pkg
|
||||
;;
|
||||
"3") set_xkbmap
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
install_vanilla_de_wm() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 4
|
||||
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
|
||||
--menu "$_InstGrMenuBody" 0 0 4 \
|
||||
"1" "$_InstGrMenuDS" \
|
||||
"2" "$_InstGrDE" \
|
||||
"3" "$_InstGrMenuDM" \
|
||||
"4" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") install_xorg_input
|
||||
;;
|
||||
"2") install_de_wm
|
||||
;;
|
||||
"3") install_dm
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
install_desktop_menu() {
|
||||
local PARENT="$FUNCNAME"
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
submenu 4
|
||||
DIALOG " $_InstGrMenuTitle " --default-item ${HIGHLIGHT_SUB} \
|
||||
--menu "$_InstDEMenuTitle" 0 0 4 \
|
||||
"1" "$_InstDEStable" \
|
||||
"2" "$_InstDEGit" \
|
||||
"3" "$_InstDE|>" \
|
||||
"4" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") install_manjaro_de_wm_pkg
|
||||
;;
|
||||
"2") install_manjaro_de_wm_git
|
||||
;;
|
||||
"3") install_vanilla_de_wm
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Install Accessibility Applications
|
||||
install_acc_menu() {
|
||||
echo "" > ${PACKAGES}
|
||||
|
||||
DIALOG " $_InstAccTitle " --checklist "$_InstAccBody" 0 0 15 \
|
||||
"accerciser" "-" off \
|
||||
"at-spi2-atk" "-" off \
|
||||
"at-spi2-core" "-" off \
|
||||
"brltty" "-" off \
|
||||
"caribou" "-" off \
|
||||
"dasher" "-" off \
|
||||
"espeak" "-" off \
|
||||
"espeakup" "-" off \
|
||||
"festival" "-" off \
|
||||
"java-access-bridge" "-" off \
|
||||
"java-atk-wrapper" "-" off \
|
||||
"julius" "-" off \
|
||||
"orca" "-" off \
|
||||
"qt-at-spi" "-" off \
|
||||
"speech-dispatcher" "-" off 2>${PACKAGES}
|
||||
|
||||
clear
|
||||
# If something has been selected, install
|
||||
if [[ $(cat ${PACKAGES}) != "" ]]; then
|
||||
basestrap ${MOUNTPOINT} ${PACKAGES} 2>$ERR
|
||||
check_for_error "$FUNCNAME" $? || return $?
|
||||
fi
|
||||
}
|
||||
|
||||
edit_configs() {
|
||||
declare -i loopmenu=1
|
||||
while ((loopmenu)); do
|
||||
local PARENT="$FUNCNAME"
|
||||
|
||||
# Clear the file variables
|
||||
FILE=""
|
||||
user_list=""
|
||||
|
||||
submenu 13
|
||||
DIALOG " $_SeeConfOptTitle " --default-item ${HIGHLIGHT_SUB} --menu "$_SeeConfOptBody" 0 0 13 \
|
||||
"1" "/etc/vconsole.conf" \
|
||||
"2" "/etc/locale.conf" \
|
||||
"3" "/etc/hostname" \
|
||||
"4" "/etc/hosts" \
|
||||
"5" "/etc/sudoers" \
|
||||
"6" "/etc/mkinitcpio.conf" \
|
||||
"7" "/etc/fstab" \
|
||||
"8" "/etc/crypttab" \
|
||||
"9" "grub/syslinux/systemd-boot" \
|
||||
"10" "lxdm/lightdm/sddm" \
|
||||
"11" "/etc/pacman.conf" \
|
||||
"12" "~/.xinitrc" \
|
||||
"13" "$_Back" 2>${ANSWER}
|
||||
HIGHLIGHT_SUB=$(cat ${ANSWER})
|
||||
|
||||
case $(cat ${ANSWER}) in
|
||||
"1") [[ -e ${MOUNTPOINT}/etc/vconsole.conf ]] && FILE="${MOUNTPOINT}/etc/vconsole.conf"
|
||||
;;
|
||||
"2") [[ -e ${MOUNTPOINT}/etc/locale.conf ]] && FILE="${MOUNTPOINT}/etc/locale.conf"
|
||||
;;
|
||||
"3") [[ -e ${MOUNTPOINT}/etc/hostname ]] && FILE="${MOUNTPOINT}/etc/hostname"
|
||||
;;
|
||||
"4") [[ -e ${MOUNTPOINT}/etc/hosts ]] && FILE="${MOUNTPOINT}/etc/hosts"
|
||||
;;
|
||||
"5") [[ -e ${MOUNTPOINT}/etc/sudoers ]] && FILE="${MOUNTPOINT}/etc/sudoers"
|
||||
;;
|
||||
"6") [[ -e ${MOUNTPOINT}/etc/mkinitcpio.conf ]] && FILE="${MOUNTPOINT}/etc/mkinitcpio.conf"
|
||||
;;
|
||||
"7") [[ -e ${MOUNTPOINT}/etc/fstab ]] && FILE="${MOUNTPOINT}/etc/fstab"
|
||||
;;
|
||||
"8") [[ -e ${MOUNTPOINT}/etc/crypttab ]] && FILE="${MOUNTPOINT}/etc/crypttab"
|
||||
;;
|
||||
"9") [[ -e ${MOUNTPOINT}/etc/default/grub ]] && FILE="${MOUNTPOINT}/etc/default/grub"
|
||||
[[ -e ${MOUNTPOINT}/boot/syslinux/syslinux.cfg ]] && FILE="$FILE ${MOUNTPOINT}/boot/syslinux/syslinux.cfg"
|
||||
if [[ -e ${MOUNTPOINT}${UEFI_MOUNT}/loader/loader.conf ]]; then
|
||||
files=$(ls ${MOUNTPOINT}${UEFI_MOUNT}/loader/entries/*.conf)
|
||||
for i in ${files}; do
|
||||
FILE="$FILE ${i}"
|
||||
done
|
||||
fi
|
||||
;;
|
||||
"10") [[ -e ${MOUNTPOINT}/etc/lxdm/lxdm.conf ]] && FILE="${MOUNTPOINT}/etc/lxdm/lxdm.conf"
|
||||
[[ -e ${MOUNTPOINT}/etc/lightdm/lightdm.conf ]] && FILE="${MOUNTPOINT}/etc/lightdm/lightdm.conf"
|
||||
[[ -e ${MOUNTPOINT}/etc/sddm.conf ]] && FILE="${MOUNTPOINT}/etc/sddm.conf"
|
||||
;;
|
||||
"11") [[ -e ${MOUNTPOINT}/etc/pacman.conf ]] && FILE="${MOUNTPOINT}/etc/pacman.conf"
|
||||
;;
|
||||
"12") user_list=$(ls ${MOUNTPOINT}/home/ | sed "s/lost+found//")
|
||||
for i in ${user_list}; do
|
||||
[[ -e ${MOUNTPOINT}/home/$i/.xinitrc ]] && FILE="$FILE ${MOUNTPOINT}/home/$i/.xinitrc"
|
||||
done
|
||||
;;
|
||||
*) loopmenu=0
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ $FILE != "" ]]; then
|
||||
nano $FILE
|
||||
if [[ $FILE == "${MOUNTPOINT}/etc/mkinitcpio.conf" ]]; then
|
||||
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "${_MMRunMkinit}?" 0 0 && {
|
||||
run_mkinitcpio 2>$ERR
|
||||
check_for_error "run_mkinitcpio" $?
|
||||
}
|
||||
fi
|
||||
else
|
||||
DIALOG " $_ErrTitle " --msgbox "$_SeeConfErrBody" 0 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user